Professional Documents
Culture Documents
Tip 5g Iot Openwrt 2
Tip 5g Iot Openwrt 2
GATEWAY SOLUTION
WITH OPENWRT ON
i.MX 8M PLUS
高磊
工业边缘计算产品市场经理
2022年4月28日
PUBLIC
NXP, THE NXP LOGO AND NXP SECURE CONNECTIONS FOR A SMARTER W ORLD ARE TRADEMARKS OF NXP B.V.
ALL OTHER PRODUCT OR SERVICE NAMES ARE THE PROPERTY OF THEIR RES PECTIVE OW NERS. © 2022 NXP B.V.
AGENDA
• OpenWRT: A Bit of History
• Getting and Building OpenWRT
• Using OpenWRT on i.MX 8M Plus EVK
• 5G Gateway Solution
• i.MX 8M Network Benchmarks
• Q&A
PUBLIC 1
O P E N W R T: A B I T O F H I S T O RY
OpenWrt is an open source project for embedded operating systems based on Linux, used primarily
on embedded devices to route network traffic. Components have been optimized to be small
enough to fit into the limited storage and memory available in home routers. First released in
January 2006, it is a Linux distribution that offers many features not previously found in consumer-
level routers.
In May 2016, OpenWrt was forked by a group of core OpenWrt contributors due to disagreements
on internal process. The fork was dubbed Linux Embedded Development Environment (LEDE). The
schism was reconciled a year later. Following the re-merger, announced in January 2018, the
OpenWrt branding is preserved, with many of the LEDE processes and rules used. The LEDE
project name was used for v17.01, with development versions of 18.01 branded OpenWrt.
https://openwrt.org/about
PUBLIC 2
G E T T I N G AN D B U I L D I N G O P E N W R T
- P R E PAR I N G T H E B U I L D E N V I R O N M E N T
• Run “make menuconfig” to check whether all OpenWRT build pre-requisites are present on your
machine
− Install any missing packages with sudo apt install <package_name>
PUBLIC 3
G E T T I N G AN D B U I L D I N G O P E N W R T
- O P E N W R T D I R E C T O RY T R E E O V E R V I E W
• toolchain
− At build time, the following two new directories are created
▪ toolchain which is a temporary directory used for building the tool chain for a specific architecture
▪ staging_dir where the resulting toolchain binaries are installed
is no need to do anything with the toolchain directory unless a new version of one of these
− There
components is added
• target
− target/linux/<platform/device_name> is platform-specific and contains the kernel .config file
and kernel patches for the platform/device being used
− target/linux/imagebuilder describes how to package a firmware for a specific platform
• package
− Most of the firmware is packaged as .ipk modules (e.g. applications, drivers, libraries) which can be
installed on a running system
− This can provide new features or remove features to save space
PUBLIC 4
G E T T I N G AN D B U I L D I N G O P E N W R T
- O P E N W R T D I R E C T O RY T R E E O V E R V I E W
• bin: contains the final binary images created during the build process
• build_dir: non toolchain source code and compiled images
• configs: configuration files for reference and development boards
• dl: local repository for downloaded OpenWrt source code packages
• docs: OpenWrt documentation
• feeds: additional predefined package build recipes for OpenWrt Buildroot
• include: Default core makefiles (*.mk) for OpenWrt (e.g. kernel, packages, fs)
• packages: OpenWrt Makefiles and source code patches
• scripts: scripts supporting the build makefiles
• staging_dir: compiled toolchain, including library includes, used to compile the rest of
the distribution
• tools: necessary tools to build the image
PUBLIC 5
G E T T I N G AN D B U I L D I N G O P E N W R T
- GETTING THE CODE
PUBLIC 6
G E T T I N G AN D B U I L D I N G O P E N W R T
- U P D AT E O P E N W R T F E E D S AN D I N S TA L L L U C I W E B I N T E R FA C E PAC K A G E
• Install single package (e.g. LuCI – GUI) package into OpenWRT build environment
andy@ubuntu:~/imx_openwrt$ ./scripts/feeds install luci
PUBLIC 7
G E T T I N G AN D B U I L D I N G O P E N W R T
- CONFIGURING OPENWRT BUILD WITH MENUCONFIG
• Run menuconfig:
andy@ubuntu:~/imx_openwrt$ make menuconfig
− This performs a pre-requisite check
• Menu-driven build select and config
− ‘Enter’
selects/enters a next-level menu
− ‘Spacebar’ cycles a selection in square braces [] through ‘blank’, ‘M’ (sometimes), and ‘*’
▪ Blank = not included/selected when the build is performed
▪ M = included/selected and built, but not included in the final binary image
▪ * = included/selected, built, and included in the final binary image
− Cursor keys navigate the screen, along with options at bottom of the screen
• ‘/’ key calls up a search box
− Handy if you know what you want to add, e.g. tcpdump, but don’t know where it lives in the menu
system
• Run “make kernel_menuconfig” to adjust the kernel option if needed
PUBLIC 8
G E T T I N G AN D B U I L D I N G O P E N W R T
- OPENWRT MENUCONFIG M AIN SCREEN
PUBLIC 9
G E T T I N G AN D B U I L D I N G O P E N W R T
- KERNEL MENUCONFIG MAIN SCREEN
PUBLIC 10
G E T T I N G AN D B U I L D I N G O P E N W R T
- CONFIGURE OPENWRT FOR i.MX 8M PLUS EVK
PUBLIC 11
G E T T I N G AN D B U I L D I N G O P E N W R T
- R E - C O N F I G U R E F O R AN O T H E R B O A R D
• If, having built for one i.MX 8M Plus, you want to build for a different board, you should
start with a clean config. Do the following:
− make clean
− Suggest making a copy of .config in <BUILDROOT>/config
▪ e.g. cp .config config/config_imx8mp
− Delete the OpenWRT config file
▪ rm .config
− Run menuconfig as in previous steps to select the new platform and necessary config
− Note: currently only imx8mplus_lpddr_evk board is supported. More board will be added soon.
PUBLIC 12
G E T T I N G AN D B U I L D I N G O P E N W R T
- B U I L D AN D F L AS H O P E N W R T I M A G E
PUBLIC 13
USING OPENWRT ON i.MX 8M PLUS EVK
- B O O T I M A G E AN D I N S TA L L PAC K A G E S I F N E E D E D
• Once booted, set a (root) password from the console, using ‘passwd’ command
− This password is used for the root login via the GUI
root@OpenWrt:/# passwd
Changing password for root
New password:
Retype password:
passwd: password for root changed by root
PUBLIC 14
USING OPENWRT ON i.MX 8M PLUS EVK
- CONFIGURE OPENWRT BY LUCI GUI
PUBLIC 15
USING OPENWRT ON i.MX 8M PLUS EVK
- E N AB L E AN D D E P L O Y N E W O P E N W R T PAC K A G E
• Not all available items are enabled in default build, this is an embedded system…
• Plenty of Menuconfig items can simply be enabled, built, and installed on a running
system
• Make process downloads new package from online repo if needed, confirms MD5 and
builds it
• Example of sysstat if you haven’t already installed it
− Includes mpstat, sar, and other handy monitoring utils
$ make menuconfig
• Under ‘Utilities’ Menu, scroll down to ‘systat’, and hit <spacebar> until ‘<M>’ is seen.
•Hit <ESC> and select <Yes> to save config.
$ make V=99 package/feeds/packages/sysstat/compile
PUBLIC 16
USING OPENWRT ON i.MX 8M PLUS EVK
- E N AB L E AN D D E P L O Y N E W O P E N W R T PAC K A G E
PUBLIC 17
OPENWRT MAIN NETWORK FUNCTIONS
PUBLIC 18
D E FAU LT O P E N W R T i . M X 8 M P L U S N E T W O R K I N T E R FA C E N AM E S
Bridge: br-lan
ENET1.RGMII eth1 wan lan
PUBLIC 19
5 G I N D U S T R I A L I O T AP P L I C AT I O N T O P O L O G Y
eth1
USB3.0
eth0
IMX8MMini Devices
WAN interface is DHCP Client LAN interfaces are bridged together. Static IP
DHCP server at 192.168.1.1, serving LAN DHCP
clients with addresses in 192.168.1.x subnet.
PUBLIC 20
N E T W O R K C O N F I G U R AT I O N F O R 5 G I O T AP P L I C AT I O N
PUBLIC 21
5G NETWORK SPEEDTEST
NOTE: The speed of the 5G network depends on the communication service provider, the test location and time period, etc.
PUBLIC 22
ETHERNET BENCHM ARK
IMX8MPlus OpenWrt
WAN Side LAN
Local IP subnet
IMX8MMini_EVK
IMX8MMini_EVK
eth1 eth0
By default, IMX8MMini_EVK
doesn’t have WAN-side DHCP
server, so need to use static LAN interface has static IP Configure
IP addresses on the WAN side. at 192.168.1.1, and serves iMX8MMini_EVK_LAN to
WAN interface has static
Configure iMX8MMini_EVK_WAN LAN DHCP clients with be DHCP client, IP is
IP of 10.207.203.172
with static IP of addresses in 192.168.1.x 192.168.1.<something>
10.207.203.169. subnet
root@imx8mmevk:~# iperf3 -s From IMX8MPlus console, monitor CPU load using pidstat if root@imx8mmevk:~# iperf3 -c 10.207.203.169
you built it into the OpenWrt image, otherwise use top, or
root@imx8mmevk:~# iperf3 -c 10.207.203.169 –t 120
the GUI Load tab.
PUBLIC 23
N E T W O R K C O N F I G U R AT I O N F O R B E N C H M A R K
config device
option name 'br-lan' config device
PUBLIC 25
IMX8MPLUS_OPENWRT CPU LOAD DURING IPERF3 TEST
CPU load
in iperf3 test
CPU load
in idle
PUBLIC
NXP, THE NXP LOGO AND NXP SECURE CONNECTIONS FOR A SMARTER W ORLD ARE TRADEMARKS OF NXP B.V.
ALL OTHER PRODUCT OR SERVICE NAMES ARE THE PROPERTY OF THEIR RES PECTIVE OW NERS. © 2022 NXP B.V. 27 PUBLIC 27
N E T W O R K I N G U S E - C AS E S
TCP or UDP Application
Internet Network which
Terminus sends/receives
1. Network Termination data
• TCP or UDP handshaking
• Reciving/Sending packets
Wide Area Wi-Fi or
• Acknowledging, resending, discarding, etc.
Network Ethernet
• Aggregating/disaggregating data DUT
• Packets consumed/originated by Device-
Under-Test Application
which
sends/receives
Internet data
TCP or UDP
2. Network Routing packet routing
• TCP or UDP routing
• DUT examines packet headers and forwards
packets to the appropriate route Local/
• DUT may perform additional functions e.g. Wi-Fi or
Wide Area
Firewall, IPSEC encapsulation, Deep Packet DUT Ethernet
Inspection Network
• Most packets pass through DUT
PUBLIC 28
K E Y TAK E - AWAY S F R O M i . M X 8 M N E T W O R K I N G B E N C H M A R K S
• For network termination, i.MX 8M has good performance, and there is no significant
difference in results compared to LS1043A
− This is the most common use-case for i.MX – where it is the terminus of the network
• For network routing, i.MX 8M can support ~500Mbps for mixed packet sizes (IMIX), or
~1.5Gbps for large packets with standard Linux networking stack
− Demo implementation of DPDK on i.MX 8M Mini shows 2-4x improvement
▪ Other options such as XDP software fastpath could also be explored
− LS1043A is significantly faster for routing use-cases, (up to 10Gbps with DPDK)
PUBLIC 29
DUT SYSTEM DESCRIPTION :
Board CPUs Maximum CPU L2 Cache Size Memory size Peak Raw
Frequency DDR
bandwidth
i.Mx8MQ EVK 4x Cortex- 1.5GHz 1MB DDR4 DRAM- 3GB 12.8GB/s
(Rev 1.0) A53
i.Mx8M Mini EVK 4x Cortex- 1.8GHz 512KB LPDDR4 DRAM- 2GB 12GB/s
(Rev 1.0) A53
i.Mx8M Mini EVK 4x Cortex- 1.8GHz 512KB DDR4 DRAM- 2GB 9.6GB/s
(Rev 1.0) A53
PUBLIC 30
T C P T E R M I N AT I O N T E S T R E S U LT S
PUBLIC 31
E T H E R N E T < - > E T H E R N E T L 3 F W D R E S U LT S F O R L I N U X N E T W O R K I N G S TA C K O N i . M X
8 M P L U S , C O M PA R I S O N W I T H L S 1 0 4 3 A
• i.MX 8M Plus achieves ~500Mbps for 390B L3fwd Eth<->Eth throughput comparison, 2 flows
packet sizes (equivalent to IMIX) & 4 cores
• LS1043A delivers superior throughput and
CPU utilization due to: 2500 50%
25%
1000 20%
Notes 15%
PUBLIC 32
5 G I N D U S T R I A L I O T G AT E WAY S O L U T I O N
Quectel(MTK)
Fibocom(MTK)
MeigSmart(QCA)
PUBLIC 33
SUMMARY
PUBLIC 34
JOURNEYS BY DESIRED ENGAGEMENT 40+ VIRTUAL DEMOS
Self-guided tour Focus on system solutions
Live-streaming at set times Set up along NXP verticals
Guided tours
SHOWROOM.NXP.COM
PUBLIC 35
W E L C O M E T O F O L L O W N X P AT S O C I A L P L AT F O R M S
关注NXP客栈公众号,查看恩 关注恩智浦B站官方账号,观
智浦最新官方资讯及技术材料 看恩智浦最新技术视频
PUBLIC 36
Q&A
PUBLIC 37
SHOWROOM.NXP.COM
NXP, THE NXP LOGO AND NXP SECURE CONNECTIONS FOR A SMARTER WORLD ARE TRADEMARKS OF NXP B.V. ALL OTHER PRODUCT OR SERVICE NAMES ARE THE PROPERTY OF THEIR RESPECTIVE OWNERS. © 2022 NXP B.V.