6LoWPAN TCP: Major re-architecting of TCP logic to properly handle TCP stuf like ACKs and TPC windowing which were not properly covered in the initial design. Still does not work; hangs waiting of ACKs.

This commit is contained in:
Gregory Nutt
2017-06-24 16:00:41 -06:00
parent 96af668ab8
commit 3203f0a93a
5 changed files with 520 additions and 137 deletions
+2 -3
View File
@@ -40,15 +40,14 @@ ifeq ($(CONFIG_NET_6LOWPAN),y)
# Include IEEE 802.15.4 file in the build # Include IEEE 802.15.4 file in the build
NET_CSRCS += sixlowpan_initialize.c sixlowpan_globals.c sixlowpan_utils.c NET_CSRCS += sixlowpan_initialize.c sixlowpan_globals.c sixlowpan_utils.c
NET_CSRCS += sixlowpan_input.c sixlowpan_send.c sixlowpan_framer.c NET_CSRCS += sixlowpan_input.c sixlowpan_framer.c sixlowpan_framelist.c
NET_CSRCS += sixlowpan_framelist.c
ifeq ($(CONFIG_NET_TCP),y) ifeq ($(CONFIG_NET_TCP),y)
NET_CSRCS += sixlowpan_tcpsend.c NET_CSRCS += sixlowpan_tcpsend.c
endif endif
ifeq ($(CONFIG_NET_UDP),y) ifeq ($(CONFIG_NET_UDP),y)
NET_CSRCS += sixlowpan_udpsend.c NET_CSRCS += sixlowpan_udpsend.c sixlowpan_send.c
endif endif
ifeq ($(CONFIG_NET_6LOWPAN_COMPRESSION_HC1),y) ifeq ($(CONFIG_NET_6LOWPAN_COMPRESSION_HC1),y)
+5 -5
View File
@@ -226,9 +226,9 @@ struct iob_s; /* Forward reference */
* Name: sixlowpan_send * Name: sixlowpan_send
* *
* Description: * Description:
* Process an outgoing UDP or TCP packet. Takes an IP packet and formats * Process an outgoing UDP or ICMPv6 packet. Takes an IP packet and formats
* it to be sent on an 802.15.4 network using 6lowpan. Called from common * it to be sent on an 802.15.4 network using 6lowpan. Called from common
* UDP/TCP send logic. * UDP/ICMPv6 send logic.
* *
* The payload data is in the caller 'buf' and is of length 'buflen'. * The payload data is in the caller 'buf' and is of length 'buflen'.
* Compressed headers will be added and if necessary the packet is * Compressed headers will be added and if necessary the packet is
@@ -238,16 +238,16 @@ struct iob_s; /* Forward reference */
* Input Parameters: * Input Parameters:
* dev - The IEEE802.15.4 MAC network driver interface. * dev - The IEEE802.15.4 MAC network driver interface.
* list - Head of callback list for send interrupt * list - Head of callback list for send interrupt
* ipv6hdr - IPv6 plus TCP or UDP headers. * ipv6hdr - IPv6 header followed by UDP or ICMPv6 header.
* buf - Data to send * buf - Data to send
* len - Length of data to send * len - Length of data to send
* raddr - The MAC address of the destination * destmac - The IEEE802.15.4 MAC address of the destination
* timeout - Send timeout in deciseconds * timeout - Send timeout in deciseconds
* *
* Returned Value: * Returned Value:
* Ok is returned on success; Othewise a negated errno value is returned. * Ok is returned on success; Othewise a negated errno value is returned.
* This function is expected to fail if the driver is not an IEEE802.15.4 * This function is expected to fail if the driver is not an IEEE802.15.4
* MAC network driver. In that case, the UDP/TCP will fall back to normal * MAC network driver. In that case, the logic will fall back to normal
* IPv4/IPv6 formatting. * IPv4/IPv6 formatting.
* *
* Assumptions: * Assumptions:
+5 -5
View File
@@ -82,7 +82,7 @@ struct sixlowpan_send_s
int s_result; /* The result of the transfer */ int s_result; /* The result of the transfer */
uint16_t s_timeout; /* Send timeout in deciseconds */ uint16_t s_timeout; /* Send timeout in deciseconds */
systime_t s_time; /* Last send time for determining timeout */ systime_t s_time; /* Last send time for determining timeout */
FAR const struct ipv6_hdr_s *s_ipv6hdr; /* IPv6 header, followed by UDP or TCP header. */ FAR const struct ipv6_hdr_s *s_ipv6hdr; /* IPv6 header, followed by UDP or ICMP header. */
FAR const struct sixlowpan_tagaddr_s *s_destmac; /* Destination MAC address */ FAR const struct sixlowpan_tagaddr_s *s_destmac; /* Destination MAC address */
FAR const void *s_buf; /* Data to send */ FAR const void *s_buf; /* Data to send */
size_t s_len; /* Length of data in buf */ size_t s_len; /* Length of data in buf */
@@ -242,9 +242,9 @@ end_wait:
* Name: sixlowpan_send * Name: sixlowpan_send
* *
* Description: * Description:
* Process an outgoing UDP or TCP packet. Takes an IP packet and formats * Process an outgoing UDP or ICMPv6 packet. Takes an IP packet and formats
* it to be sent on an 802.15.4 network using 6lowpan. Called from common * it to be sent on an 802.15.4 network using 6lowpan. Called from common
* UDP/TCP send logic. * UDP/ICMPv6 send logic.
* *
* The payload data is in the caller 'buf' and is of length 'buflen'. * The payload data is in the caller 'buf' and is of length 'buflen'.
* Compressed headers will be added and if necessary the packet is * Compressed headers will be added and if necessary the packet is
@@ -254,7 +254,7 @@ end_wait:
* Input Parameters: * Input Parameters:
* dev - The IEEE802.15.4 MAC network driver interface. * dev - The IEEE802.15.4 MAC network driver interface.
* list - Head of callback list for send interrupt * list - Head of callback list for send interrupt
* ipv6hdr - IPv6 header followed by TCP or UDP header. * ipv6hdr - IPv6 header followed by UDP or ICMPv6 header.
* buf - Data to send * buf - Data to send
* len - Length of data to send * len - Length of data to send
* destmac - The IEEE802.15.4 MAC address of the destination * destmac - The IEEE802.15.4 MAC address of the destination
@@ -263,7 +263,7 @@ end_wait:
* Returned Value: * Returned Value:
* Ok is returned on success; Othewise a negated errno value is returned. * Ok is returned on success; Othewise a negated errno value is returned.
* This function is expected to fail if the driver is not an IEEE802.15.4 * This function is expected to fail if the driver is not an IEEE802.15.4
* MAC network driver. In that case, the UDP/TCP will fall back to normal * MAC network driver. In that case, the logic will fall back to normal
* IPv4/IPv6 formatting. * IPv4/IPv6 formatting.
* *
* Assumptions: * Assumptions:
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -340,10 +340,10 @@ static uint16_t tcpsend_interrupt(FAR struct net_driver_s *dev,
} }
#endif /* CONFIG_NET_IPv6 */ #endif /* CONFIG_NET_IPv6 */
/* The current acknowledgement number number is the (relative) offset /* The current acknowledgement number is the (relative) offset of the
* of the of the next byte needed by the receiver. The snd_isn is the * next byte needed by the receiver. The snd_isn is the offset of the
* offset of the first byte to send to the receiver. The difference * first byte to send to the receiver. The difference is the number
* is the number of bytes to be acknowledged. * of bytes to be acknowledged.
*/ */
pstate->snd_acked = tcp_getsequence(tcp->ackno) - pstate->snd_isn; pstate->snd_acked = tcp_getsequence(tcp->ackno) - pstate->snd_isn;