Implementation of IPv6 in Embedded Device Using LWIP TCPIP Stack
Implementation of IPv6 in Embedded Device Using LWIP TCPIP Stack
Volume: 3 Issue: 5
ISSN: 2321-8169
2569 - 2573
_______________________________________________________________________________________________
Project Leader
L&T Technology Services Ltd
Mumbai, India
[email protected]
AbstractIt is becoming trend of making every embedded devices connected wirelessly with each other. Due to large scale of deployment of
IPv4 throughout internet, address spaces allowed by IPv4 is saturating and thus there is a strong need for implementing IPv6 into embedded
devices. Despite the fact that there are numerous TCP/IP implementations for embedded and minimal systems, little research has been conducted
in the area. Also currently, Allen Bradleys Power Flex Drives based on Bacnet card implements TCP/IP stack that do not support IPv6. Thus,
IPv6 using LWIP Stack has been implemented and tested on Bacnet card (Renesas H8S/2556 microcontroller). This paper covers brief overview
of LWIP TCP/IP Stack. It also presents a design method to implement IPv6 in embedded device. Furthermore it presents LWIP stack flow,
Tx/Rx packet process in Ethernet controller and actual implementation results of IPv6 in Bacnet card based Power flex drive.
Keywords- TCP/IP, IPv6, Renesas H8S, LWIP, Embedded Systems, Bacnet.
__________________________________________________*****_________________________________________________
I.
INTRODUCTION
2569
IJRITCC | May 2015, Available @ http://www.ijritcc.org
_______________________________________________________________________________________
ISSN: 2321-8169
2569 - 2573
_______________________________________________________________________________________________
Netconn API
lan9221_if_input
RAW API
tcp_ip_input
(create mbox msg)
TCPIP_MSG_ETHINPUT
(received mbox)
LAN9221
Thread
low_level_input
tcpip
mbox
tcpip_thread
III.
recv_tcp
LWIP
Thread
Msg:
received pbuf
IMPLEMENTATION DETAILS
TCPIP_MSG_API:
do_recv
netconn_recv
convert pbuf to netbuf
netconn
recv mbox
User Application
(ESTABLISHED)
tcpip
mbox
do_recv
tcp_recvd
adjust recv window
send ACK
done
User App
Thread
LWIP
Thread
2570
IJRITCC | May 2015, Available @ http://www.ijritcc.org
_______________________________________________________________________________________
ISSN: 2321-8169
2569 - 2573
_______________________________________________________________________________________________
tcp_active_pcbs?
tcp_process()
tcp_tw_pcbs?
lan9221_if__input()
ARP?
LAN9211Begin
PacketReceive()
low_level_input()
ethernet__input()
If (data avail)
EVENT_RECV(data)
tcp_ack_now()
IPv6?
ip__input()
tcp_listen_pcbs?
If (FIN)
EVENT_RECV(NULL)
ethernet__input()
IPv4?
ethernet__input()
tcp_timewait_input()
IP?
ethernet__input()
If (ACK sent)
EVENT_RST
tcp_ack_now()
ip6__input()
tcp_output()
(send SYN/ACK)
tcp_rst()
raw__input()
drop
ICMP
icmp__input()
else
UDP
IGMP
raw__input()
udp__input()
TCP
drop
ICMPv6
TCP
igmp__input()
else
UDP
icmp6__input()
tcp_input()
ND6
query?
Echo req?
Echo req?
drop
ip__input()
ip6__input()
nd6__input()
process ND msg
tcp_write()
tcp_output_segment()
IPv6
IPv4
ip_output()
ip6_output()
ip_output_if()
ip6_output_if()
etharp_output()
ethip6_output()
etharp_send_ip()
ethip6_send_ip()
done
low_level_output()
LAN9211Begin
PacketSend()
(Send pbuf data to netif, one
pbuf at a time)
2571
IJRITCC | May 2015, Available @ http://www.ijritcc.org
_______________________________________________________________________________________
ISSN: 2321-8169
2569 - 2573
_______________________________________________________________________________________________
segment if its remaining size does not exceed the TCP_MSS
value.
The TCP segments are only sent when a call to the
tcp_output() function is made, as shown in Fig. 5. This
function is also automatically triggered by lwIP in the
following cases:
Inside the tcp_input() function (when TCP
acknowledgement has to be sent right away)
Inside the slow and fast timers (where retransmitting
TCP segments can be required)
At this stage, the TCP segment gets encapsulated with the
IPv4 or IPv6 header (ip_output() and ip6_output() function)
and Ethernet header (etharp_output() and ethip6_output()
function). Finally, the Ethernet frame is sent to the LAN9221
via the low_level_output() function located in the lwIP netif
driver.
IV.
IMPLEMENTATION RESULTS
A. Ping Test
LWIP Stack already has a function for creating link-local
IPv6 address. But for configuring manual IPv6 address in
Bacnet card, netif_add_ip6_address( ) function has been
defined which verifies available index in netif and adds the
manual address. Thus, the IP address assigned to the device
are:
2572
IJRITCC | May 2015, Available @ http://www.ijritcc.org
_______________________________________________________________________________________
ISSN: 2321-8169
2569 - 2573
_______________________________________________________________________________________________
V.
[1]
[2]
[3]
[4]
CONCLUSION
http://savannah.nongnu.org/projects/ lwip/.
Rockwell Automation, PowerFlex 753 Drives Manual revision
1.011.
[Online]
Available:
http://www.rockwellautomation.com/support.
[5]
[6]
[7]
2573
IJRITCC | May 2015, Available @ http://www.ijritcc.org
_______________________________________________________________________________________