2017-01-30 21:56:02 +08:00
|
|
|
.. _ip_stack_migrate:
|
|
|
|
|
|
|
|
Migrating from Zephyr v1.6 IP Stack to v1.7
|
|
|
|
###########################################
|
|
|
|
|
|
|
|
Zephyr v1.6 and earlier is using network IP stack that has its origin in uIP.
|
|
|
|
The uIP stack was modified heavily to use it in Zephyr. The uIP stack had
|
|
|
|
limitations described below that required new and native IP stack to be
|
|
|
|
developed.
|
|
|
|
|
|
|
|
This document is a high level description of the changes between these two
|
|
|
|
major Zephyr releases. For individual changes, the application developer can
|
|
|
|
find more details in the network header file documentation in include/net/.
|
|
|
|
|
|
|
|
Because of this new native IP stack, the following changes are required to
|
|
|
|
migrate applications using the older v1.6 IP stack to the new v1.7 IP stack:
|
|
|
|
|
2017-03-01 07:29:16 +08:00
|
|
|
Dual IPv6 and IPv4 stack support.
|
|
|
|
In Zephyr v1.6, applications could not
|
2017-01-30 21:56:02 +08:00
|
|
|
use both IPv6 and IPv4 simultaneously. This is changed in Zephyr v1.7 and the
|
|
|
|
IP stack supports both IPv6 and IPv4 at the same time. In practice this means
|
|
|
|
that applications should be prepared to support both IPv6 and IPv4 in the
|
|
|
|
code.
|
|
|
|
|
2017-03-01 07:29:16 +08:00
|
|
|
Multiple simultaneous network technologies support.
|
2017-01-30 21:56:02 +08:00
|
|
|
In Zephyr v1.7 it is possible to have multiple network technologies enabled
|
|
|
|
at the same time. This means that applications can utilize concurrently e.g.,
|
|
|
|
IEEE 802.15.4 and Bluetooth IP networking. The different network technologies
|
|
|
|
are abstracted to network interfaces and there can be multiple network
|
2017-02-28 05:15:43 +08:00
|
|
|
interfaces in the system depending on configuration.
|
2017-01-30 21:56:02 +08:00
|
|
|
|
2017-03-01 07:29:16 +08:00
|
|
|
Network Kconfig options are changed.
|
|
|
|
Most of the networking configuration
|
2017-01-30 21:56:02 +08:00
|
|
|
options are renamed. Please check the :ref:`networking` documentation for the
|
|
|
|
new names.
|
|
|
|
|
2017-03-01 07:29:16 +08:00
|
|
|
All uIP based APIs are gone.
|
|
|
|
Those APIs were not public in v1.6 but
|
2017-02-28 05:15:43 +08:00
|
|
|
applications could call them anyway. These uIP APIs were mainly used to set
|
|
|
|
IP address etc. management style operations. The new management APIs can be
|
2017-01-30 21:56:02 +08:00
|
|
|
found in net_if.h and net_mgmt.h in Zephyr v1.7.
|
|
|
|
|
2017-03-01 07:29:16 +08:00
|
|
|
Network buffer management is changed.
|
|
|
|
In earlier Zephyr versions, there
|
2017-01-30 21:56:02 +08:00
|
|
|
were big 1280 byte long buffers that applications could utilize. In Zephyr
|
|
|
|
v1.7 this is changed so that device memory is utilized more efficiently.
|
|
|
|
Now small buffer fragments are allocated to store the data, and these
|
|
|
|
fragments can then be chained together to store larger amount of data. For
|
|
|
|
applications this means that the memory received from network or sent to
|
|
|
|
network is not contiguous and application should use the helper functions
|
|
|
|
found in nbuf.h when reading and writing the network data.
|
|
|
|
|
2017-03-01 07:29:16 +08:00
|
|
|
Network context/socket API is changed.
|
|
|
|
The new API found in net_context.h
|
2017-01-30 21:56:02 +08:00
|
|
|
is more BSD-socket-like than the earlier API. The new context API is not
|
|
|
|
fully BSD socket compatible as it needs to support both synchronous and
|
|
|
|
asynchronous operations. Porting BSD socket application to use the
|
|
|
|
net_context_* API is easier than in Zephyr v1.6.
|
|
|
|
|
2017-03-01 07:29:16 +08:00
|
|
|
CoAP library API is changed.
|
|
|
|
The Zephyr v1.6 CoAP API is removed.
|
2017-01-30 21:56:02 +08:00
|
|
|
The new Zephyr v1.7 API is called ZoAP and it can be found in zoap.h header
|
|
|
|
file.
|
|
|
|
|
2017-03-01 07:29:16 +08:00
|
|
|
The TinyDTLS library is removed.
|
|
|
|
The tinydtls crypto library was used
|
2017-01-30 21:56:02 +08:00
|
|
|
only by CoAP in Zephyr v1.6 and it is removed in Zephyr v1.7. It is replaced
|
|
|
|
by mbedtls library.
|