This FreeRTOS Labs
project is adding IPv6
functionality to the currently IPv4 only FreeRTOS+TCP TCP/IP stack. While the resultant dual IPv4 / IPv6 version is fully functional, it is still undergoing optimisation, test coverage and documentation improvements, and memory safety checks. Until that work is complete the code is available as a branch of the FreeRTOS+TCP GitHub repo
IPv6 Demo Project
For the FreeRTOS Windows Simulator
On this page:
This demo application is available in the labs/ipv6_multi branch of the FreeRTOS+TCP repository. It can be found in the
demos/IPv6_Multi_WinSim_demo directory of the above repository.
This demo demonstrates several protocols ( UDP, TCP, ICMP/ping, NTP ) of the FreeRTOS+TCP IPv6 and multiple interface library. It will use both IPv6 and IPv4 for each of the protocols mentioned.
The FreeRTOS+TCP Multiple Interface Visual Studio project file is in the following
In the .props file, you will find several macros that indicate the location of source files:
- $(FREERTOS_SOURCE_DIR) The kernel sources
- $(FREERTOS_INCLUDE_DIR) The kernel header files
- $(DEMO_COMMON_SOURCE_DIR) The location of the common directory of the demos
- $(PLUS_TCP_SOURCE_DIR) The FreeRTOS+TCP source files
- $(PLUS_TCP_INCLUDE_DIR) The FreeRTOS+TCP header files
- $(UTILITIES_SOURCE_DIR) The location of the tcp_utilities directory
You can changes these macros to let the project work with a different
The project uses the FreeRTOS+TCP FreeRTOS Windows simulator. The Windows simulator provides a convenient evaluation platform, but it does not exhibit real time behavior. Simulated time is much slower than real time.
The project is pre-configured to build with the free Express edition of Microsoft Visual C++ (MSVC). MSVC Express Edition 2010 was used.
The IPv6_Multi_WinSim_demo demo performs some basic network activities:
- ARP address resolution for IPv4 addresses on the LAN
- Neighbour Discovery for IPv6 addresses on the LAN
- Looking up a IPv4 or IPv6 address using DNS, either asynchronous or synchronous.
- Looking up a local host ( IPv4/6 ) using LLMNR ( not considered safe anymore )
- Talk with an NTP server and fetch the time using UDP, with IPv4/6
- Download a file from any public server using TCP/HTTP
- Ping any server on the web or on the LAN, , with IPv4 or IPv6
The demo can be easily adapted to your own needs. It works like a command line interface ( CLI ) that performs the above tasks.
Here are some examples:
http4 google.co.uk /index.html
http6 amazon.com /index.html
The last line will first lookup the mentioned NTP server, send a request, and wait for a reply. The time will be printed in the logging.
Although it is called a CLI, the demo does not have a STDIN. The commands are hard-coded in main.c
The keywords can have some single-letter suffices: 4 or 6 ( for IPv4/6 ), “a” to do an asynchronous DNS lookup, and “c” to clear all caches before starting the task.
- Download the source code via cloning the labs/ipv6_multi branch of the FreeRTOS+TCP repository.
- Open the Visual Studio solution file
FreeRTOS_Plus_TCP_IPv6_Multi.sln from within the Visual Studio IDE. The solution file is located in the “demos/IPv6_Multi_WinSim_demo” directory.
- The demo uses WinPCap to create a virtual network connection by accessing raw Ethernet data on a real network connection – and thus can only work with wired network interfaces. Many computers have more than one real network interface. Set configNETWORK_INTERFACE_TO_USE in FreeRTOSConfig.h. to tell the demo which real interface should be used to create the virtual interface. Available interface numbers are displayed on the console when the application is executed.
The virtual interface has its own MAC address. Set the constants configMAC_ADDR0 to configMAC_ADDR5 to ensure the MAC address used by the virtual network connection is unique on the network. The constants are located at the bottom of FreeRTOSConfig.h.
- IP address assignment is done statically in this case. It is not managed by a DHCP server.
The IP address configured will be valid if the first three octets of the IP address match the first three octets of other IP addresses on the same network – each IP address must be unique on the network.
- Select “Build Solution” from the IDE’s Build menu (or press F7) to build the application.
The standard Visual Studio key used to start a debug session, and break on entry to main() is F10.
The same host computer is used to build the application, debug the application, and (because the Win32 simulator is used) run the application. There are no special debugging instructions.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.