Gregory Nutt
d944388888
configs/viewtool-stm32f107: Add a TCP performance test using apps/examples/tcpblaster.
2018-07-05 16:08:03 -06:00
Gregory Nutt
73c4b1610b
net/tcp: Set the default TCP MSS to the value required by RFC 879 and never change it under any circumstance unless the remote host requests a larger MSS via an option the TCP header.
2018-07-05 10:54:45 -06:00
Gregory Nutt
22cd0d47fa
This commit attempts remove some long standard confusion in naming and some actual problems that result from the naming confusion. The basic problem is the standard MTU does not include the size of the Ethernet header. For clarity, I changed the naming of most things called MTU to PKTSIZE. For example, CONFIG_NET_ETH_MTU is now CONFIG_NET_ETH_PKTSIZE.
...
This makes the user interface a little hostile. People thing of an MTU of 1500 bytes, but the corresponding packet is really 1514 bytes (including the 14 byte Ethernet header). A more friendly solution would configure the MTU (as before), but then derive the packet buffer size by adding the MAC header length. Instead, we define the packet buffer size then derive the MTU.
The MTU is not common currency in networking. On the wire, the only real issue is the MSS which is derived from MTU by subtracting the IP header and TCP header sizes (for the case of TCP). Now it is derived for the PKTSIZE by subtracting the IP header, the TCP header, and the MAC header sizes. So we should be all good and without the recurring 14 byte error in MTU's and MSS's.
Squashed commit of the following:
Trivial update to fix some spacing issues.
net/: Rename several macros containing _MTU to _PKTSIZE.
net/: Rename CONFIG_NET_SLIP_MTU to CONFIG_NET_SLIP_PKTSIZE and similarly for CONFIG_NET_TUN_MTU. These are not the MTU which does not include the size of the link layer header. These are the full size of the packet buffer memory (minus any GUARD bytes).
net/: Rename CONFIG_NET_6LOWPAN_MTU to CONFIG_NET_6LOWPAN_PKTSIZE and similarly for CONFIG_NET_TUN_MTU. These are not the MTU which does not include the size of the link layer header. These are the full size of the packet buffer memory (minus any GUARD bytes).
net/: Rename CONFIG_NET_ETH_MTU to CONFIG_NET_ETH_PKTSIZE. This is not the MTU which does not include the size of the link layer header. This is the full size of the packet buffer memory (minus any GUARD bytes).
net/: Rename the file d_mtu in the network driver structure to d_pktsize. That value saved there is not the MTU. The packetsize is the memory large enough to hold the maximum packet PLUS the size of the link layer header. The MTU does not include the link layer header.
2018-07-04 14:10:40 -06:00
Gregory Nutt
e59b26370d
Squashed commit of the following:
...
Fix a few typo/compilation problems.
net/: Remove all CONFIG_NET_xxx_TCP_RECVWNDO configuration variables. They were used only to initialize the d_recwndo of the network device structure which no longer exists.
net/: Remove the device TCP receive window field (d_recvwndo) from the device structure. That value is no longer retained, but is calculated dynamically.
Remove some dangling references to CONFIG_NET_TCP_RWND_CONTROL.
net/tcp: Take read-ahead throttling into account when calculating the TCP receive window size.
net/tcp: tcp_get_recvwindow() now returns the receive window size directly (vs. indirectly via the device structure).
net/tcp: Remove CONFIG_NET_TCP_RWND_CONTROL. TCP window algorithm is now trigged only by CONFIG_NET_TCP_READAHEAD.
2018-07-01 07:59:33 -06:00
Gregory Nutt
b32d8b1714
net/tcp and sixlowpan: Separate the the TCP receive window calculations to a separate header file. It must also be used by the special 6LoWPAN TCP logic.
2018-06-30 20:50:07 -06:00
Gregory Nutt
c65e1aa3df
Squashed commit of the following:
...
syscalls/: Add syscall support for if_nametoindex() and if_indextoname()
net/: Update some comments.
2018-06-25 12:41:28 -06:00
Gregory Nutt
25686a9dac
Remove if #if 0 logic. Update some comments.
2018-06-24 15:50:45 -06:00
Gregory Nutt
715d561c41
Trivial spelling corrections in comments; update some comments in a Kconfig file.
2018-06-24 15:01:49 -06:00
Gregory Nutt
0786b5d053
net/tcp: Re-think CONFIG_NET_TCP_RWND_CONTROL TCP windowing controls.
2018-06-24 14:46:12 -06:00
Gregory Nutt
433f29eea2
net/: Rename CONFIG_TCP_REASSEMBLY to CONFIG_IPv4_REASSEMBLY. Add some fixes to get a clen compile with CONFIG_IPv4_REASSEMBLY enabled. There are several problems with the current implementation: It is untested (and depends on CONFIG_EXPERMIMENTAL). It uses some Ethernet specific definitions (and depends on CONFIG_NET_ETHERNET). There is only a single reassembly buffer. The last two issues prevent use of this feature in any context where IPv4 packets may be reassembled for multiple network devices concurrently).
2018-06-24 12:06:12 -06:00
Gregory Nutt
a0e169ad7b
net/: Fix a sixlowpan typo bug recently introduced; Rename g_ipv6_allzeroaddre with the more meaning g_ipv6_unspecaddr since the all-zero address is the IPv6 unspecified address (sometime IN6_ADDR_ANY). Remove more inline tests for IPv6 multicast with tcommint net_is_addr_mcast() macro. Update some comments.
2018-06-23 12:53:27 -06:00
Gregory Nutt
668df010ec
Committed defconfigs for working configurations should never have CONFIG_EXPERIMENTAL set because the opens the doors for untested and incomplete configurations. Conversely, if there are released configurations that use features with dependencies on CONFIG_EXPERIMENTAL, then those configurations are in use and those dependencies should be removed:
...
graphics/vnc/server/Kconfig: Remove a dependency on CONFIG_EXPERIMENTAL
net/tcp/Kconfig: Remove a dependency on CONFIG_EXPERIMENTAL
wireless/bluetooth/Kconfig: Remove a dependency on CONFIG_EXPERIMENTAL
configs/lc823450-xgevk/audio/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/lc823450-xgevk/bt/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/lc823450-xgevk/ipl2/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/lc823450-xgevk/nsh/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/lc823450-xgevk/rndis/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/lc823450-xgevk/usb/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/lpcxpresso-lpc54628/netnsh/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/moxa/nsh/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/olimex-stm32-p407/module/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/photon/wlan/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/sabre-6quad/smp/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/sam4cmp-db/nsh/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/sama5d4-ek/elf/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/sama5d4-ek/knsh/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/samv71-xult/module/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/samv71-xult/vnc/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/samv71-xult/vnxwm/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/sim/bluetooth/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/sim/pf_ieee802154/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/sim/pktradio/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/sim/sixlowpan/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/sim/traveler/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/sim/userfs/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/stm32f4discovery/hciuart/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/stm32f4discovery/pseudoterm/defconfig: Remove CONFIG_EXPERIMENTAL=y
configs/teensy-3.x/usbnsh/defconfig: Remove CONFIG_EXPERIMENTAL=y
2018-06-17 10:30:01 -06:00
Gregory Nutt
8fdbb1e0a4
Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t
...
Squashed commit of the following:
sched: Rename all use of system_t to clock_t.
syscall: Rename all use of system_t to clock_t.
net: Rename all use of system_t to clock_t.
libs: Rename all use of system_t to clock_t.
fs: Rename all use of system_t to clock_t.
drivers: Rename all use of system_t to clock_t.
arch: Rename all use of system_t to clock_t.
include: Remove definition of systime_t; rename all use of system_t to clock_t.
2018-06-16 12:16:13 -06:00
Gregory Nutt
efed1b6aa1
net/udp: Remove an unused variable warning. Add some comments.
2018-04-27 18:26:38 -06:00
Pelle Windestam
303e6499bd
net/tcp: Extended support for sending to non-blocking tcp sockets.
2018-04-20 07:37:51 -06:00
Gregory Nutt
b54ffe858a
Standardization of some function headers.
2018-03-13 09:52:27 -06:00
Gregory Nutt
ae399b9b62
net/tcp: In tcp_input(), add the logic to detect, decode, and respond to TCP Keep-Alive packets. In tcp_timer(), fix some problems with the way that TCP Keep-Alive probes were being formatted.
2018-03-12 15:54:45 -06:00
Gregory Nutt
251924a734
Squashed commit of the following:
...
net/tcp: Add logic to send probes when SO_KEEPALIVE is enabled.
net/tcp: TCP socket should not have to be connected to configure KeepAlive.
net/: Add a separate configuration to enable/disable KEEPALIVE socket options.
net/tcp: Arguments to TCP keep-alive timing functions probably should be struct timeval as are the times for other time-related socket options.
net/tcp: Fix a backward conditional
net/tcp: Add some more checks and debug output to TCP-protocol socket options.
net/tcp: Cosmetic changes to some alignment.
net/: Adds socket options needed to manage TCP-keepalive and TCP state machine logic to detect if that the remote peer is alive. Still missing the timer poll logic to send the keep-alive probes and the state machine logic to respond to probes.
2018-03-12 10:59:46 -06:00
Gregory Nutt
9812f6f932
Trivial update to some comments
2018-02-22 18:42:27 -06:00
Gregory Nutt
3a2d0a06f4
net/tcp: Generalize Juho Grundstrom's IPv4 change for IPv6 as well.
2018-02-22 16:41:14 -06:00
Juho Grundstrom
13058858f2
net/tcp: tcp_send_[un]buffered.c: And header file inclusion missing in previous commit.
2018-02-22 16:30:46 -06:00
Juho Grundstrom
c065f0fd49
net/tcp: tcp_send_[un]buffered.c: Check routing table in psock_send_addrchck(). Previously only ARP table was considered when determining if the data will actually be sent.
2018-02-22 16:24:15 -06:00
Gianpaolo Ferroni Ariani
2c8eb5b240
net/tcp: Fixes hardfault when network goes done and network monitoring is in place.
2018-02-22 06:29:18 -06:00
Gregory Nutt
2c17bf21af
net/tcp: Missing header file inclusion in tcp_wrbuffer.c
2018-02-14 09:23:55 -06:00
Pelle Windestam
e0142f1d52
net/tcp: Fixed bad return value handling in psock_tcp_send(). send() expects psock_tcp_send() to return a negated errno value, not -1 with the errno set (GN: I added same change for tcp_send_buffered.c which has the same issue as tcp_send_unbuffered.c)
2018-02-13 08:02:42 -06:00
Alan Carvalho de Assis
fb50c44d08
Fix various issues noted by Coverity
2018-02-06 09:13:16 -06:00
Gregory Nutt
7cf88d7dbd
Make sure that labeling is used consistently in all function headers.
2018-02-01 10:00:02 -06:00
Gregory Nutt
82cb799bb6
net/udp: Fix memory leak with UDP + write buffer is closed. Also update TODO and comments and refresh a configuration.
2018-01-23 11:54:03 -06:00
Gregory Nutt
289e4dde06
net/udp and tcp: Yet another (cosmetic) change to UDP and TCP write buffer macro naming.
2018-01-22 19:33:14 -06:00
Gregory Nutt
fef255e5be
This commit adds an as-of-yet untested implemented of UDP write buffering.
...
Squashed commit of the following:
net/udp: Address most of the issues with UDP write buffering. There is a remaining issue with handling one network going down in a multi-network environment. None of this has been test but it is certainly ready for test. Hence, the feature is marked EXPERIMENTAL.
net/udp: Some baby steps toward a corrected write buffering design.
net/udp: Remove pesky write buffer macros.
Eliminate trailing space at the end of lines.
net/udp: A little more UDP write buffering logic. Still at least on big gaping hole in the design.
net/udp: Undefined CONFIG_NET_SENDTO_TIMEOUT.
net/udp: Crude, naive port of the TCP write buffering logic into UDP. This commit is certainly non-functional and is simply a starting point for the implementatin of UDP write buffering.
net/udp: Rename udp/udp_psock_sendto.c udp/udp_psock_sendto_unbuffered.c.
2018-01-22 18:32:02 -06:00
Gregory Nutt
12d7125b75
net/tcp: Write buffering logic should not wait for a free buffer if the socket was opened non-blocking. Also, rename the TCP write buffering macros from WRB_* to TCPWB_* to make room in the namespace for write buffering with other protocols.
2018-01-22 11:11:23 -06:00
Masayuki Ishikawa
30070b06df
Merged in masayuki2009/nuttx.nuttx/tcp_rcvwnd_control (pull request #555 )
...
net/tcp: Introduce tcp receive window control based on I/O buffer
NOTE: The algorithm is still experimental but useful for http streaming.
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-12-18 12:11:52 +00:00
Gregory Nutt
5692e340ab
Move comments describing a problem out of the code and into the TODO list where it belongs.
2017-10-25 12:37:02 -06:00
Gregory Nutt
c3ce23ba35
Cosmetic update to a document and some comments.
2017-10-25 11:17:38 -06:00
Gregory Nutt
8d023cb97f
tcp_lost_connection() is called from two places in tcp_sendfile.c
2017-10-19 16:36:57 -06:00
Gregory Nutt
8c11a73d33
net/tcp: Same change to tcp_send_buffered.c probably also applies to tcp_sendfile.c.
2017-10-19 16:31:28 -06:00
Gregory Nutt
7d62a74915
Fix an error introduced in last commit.
2017-10-19 16:26:09 -06:00
Gregory Nutt
5a416be95b
net/tcp: Same change to tcp_send_buffered.c probably also applies to tcp_send_unbuffered.c.
2017-10-19 16:14:38 -06:00
Gregory Nutt
cf5cba953d
There was a possible recursion that could eventually overflow the stack. The error occurred when closing the socket with inet_close() while a socket callback was still queued. When the socket callback was executed by devif_conn_event(), this resulted in a call to psock_send_eventhandler() with TCP_CLOSE flag set which then called tcp_lost_connection(). tcp_shutdown_monitor() then called tcp_callback() again, which again called psock_send_eventhandler(), and so on.... Noted by Pascal Speck. Solution is also similar to a solution proposed by Pascal Speck.
2017-10-19 11:55:51 -06:00
Gregory Nutt
5ffd034f40
TCP Networking: When CONFIG_NET_TCP_WRITE_BUFF=y there is a situation where a NULL pointer may be dereferenced. In this configuration, the TCP connection's 'semi-permnanent' callback, s_sndcb was nullified in tcp_close_disconnect. However, other logic in tcp_lost_connection() attempt to use that callback reference after it was nullifed. Fixed in tcp_lost_connectino() by adding a NULL pointer change before the access. This was reported by Dmitriy Linikov in Bitbucket Issue 72.
2017-10-13 06:47:40 -06:00
Gregory Nutt
9568600ab1
Squashed commit of the following:
...
This commit backs out most of commit b4747286b1
. That change was added because sem_wait() would sometimes cause cancellation points inappropriated. But with these recent changes, nxsem_wait() is used instead and it is not a cancellation point.
In the OS, all calls to sem_wait() changed to nxsem_wait(). nxsem_wait() does not return errors via errno so each place where nxsem_wait() is now called must not examine the errno variable.
In all OS functions (not libraries), change sem_wait() to nxsem_wait(). This will prevent the OS from creating bogus cancellation points and from modifying the per-task errno variable.
sched/semaphore: Add the function nxsem_wait(). This is a new internal OS interface. It is functionally equivalent to sem_wait() except that (1) it is not a cancellation point, and (2) it does not set the per-thread errno value on return.
2017-10-04 15:22:27 -06:00
Gregory Nutt
42a0796615
Squashed commit of the following:
...
sched/semaphore: Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable. Changed all references to sem_post in the OS to nxsem_post().
sched/semaphore: Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable. Changed all references to sem_destroy() in the OS to nxsem_destroy().
libc/semaphore and sched/semaphore: Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable. Changed all references to sem_setprotocol in the OS to nxsem_setprotocol(). sem_getprotocol() was not used in the OS
2017-10-03 15:35:24 -06:00
Gregory Nutt
83cdb0c552
Squashed commit of the following:
...
libc/semaphore: Add nxsem_getvalue() which is identical to sem_getvalue() except that it never modifies the errno variable. Changed all references to sem_getvalue in the OS to nxsem_getvalue().
sched/semaphore: Rename all internal private functions from sem_xyz to nxsem_xyz. The sem_ prefix is (will be) reserved only for the application semaphore interfaces.
libc/semaphore: Add nxsem_init() which is identical to sem_init() except that it never modifies the errno variable. Changed all references to sem_init in the OS to nxsem_init().
sched/semaphore: Rename sem_tickwait() to nxsem_tickwait() so that it is clear this is an internal OS function.
sched/semaphoate: Rename sem_reset() to nxsem_reset() so that it is clear this is an internal OS function.
2017-10-03 12:52:31 -06:00
Gregory Nutt
e761b80ea7
fs/vfs: file_read() is an internal OS interface and should not errors via the errno
2017-09-28 14:14:32 -06:00
Gregory Nutt
9043b9cb6a
fs/vfs: file_seek() is an internal OS interface and should not errors via the errno
2017-09-28 13:55:36 -06:00
Bruno Herrera
24767a0c66
Fixes for problems found by Coverity in the nuttx repository:
...
net/socket/recvfrom.c: Check fromlen integrity before using it.
net/socket/net_sockets.c: Always check for valid psock before using.
net/tcp/tcp_send_unbuffered.c: Avoid using psock beforing checking its integrity.
sched/timer/timer_create.c: Fix watchdog resource leak if cannot allocate a new timer.
2017-09-25 07:17:09 -06:00
Gregory Nutt
cca15891c9
Networking: Fix some errors found by Coverity
2017-09-13 13:04:26 -06:00
Jussi Kivilinna
547733cbb0
Update net_timedwait() and net_lockedwait() call sites to handle negated errno in return value
2017-09-04 07:56:51 -06:00
Gregory Nutt
8ffb103adb
networking: IGMP: Remove special support for interrupt level processing (there is none) and fix some timer cancellation logic. In many files, correct comments. There is no interrupt level processing in the networking layer.
2017-09-02 10:27:03 -06:00
Gregory Nutt
8c2e3a2d0a
Networking: Fix a copy/paste error introduced with recent disconnection changes.
2017-09-01 11:56:48 -06:00
Gregory Nutt
7ebef900fb
Networking: Fix a race condition. The accept() operation is performed with the network locked. However, the network is unlocked BEFORE the connected state is set. Therefore, a context switch may occur and the socket may no longer be connected when it is marked so. Noted by Pascal Speck.
2017-08-31 07:23:19 -06:00
Gregory Nutt
0b2a4eb4bd
Networking: A little more wording changes related to interrupts vs. events
2017-08-29 15:08:38 -06:00
Gregory Nutt
04ad162540
Networking: Clean up some naming that has bothered me for a long time... There are no interrupts and no interrupt handlers in the network. There are events and event handler (there used to to be interrupt logic in there years ago but that is long, long gone).
2017-08-29 14:08:04 -06:00
Gregory Nutt
171d183e8e
Networking: A placeholder for some missing logic in the previous change related to monitoring network status for dup'ed sockets. If one of the dup'ed socket's is closed, then network monitor resources associated with that one socket must be recovered. Also, in the event that socket is being used on one thread, but then closed on another, any threads waiting for events from the socket should be informed of the closure. That latter requirement is not implemented because current data structures do not support it.
2017-08-29 13:24:49 -06:00
Gregory Nutt
0f7a52bc28
Networking: Fix a runaway recursion problem introduced the previous fixe for shutting down dup'ed sockets.
2017-08-29 12:27:58 -06:00
Gregory Nutt
d40ee8e79d
Networking: Start the network monitor for a socket when a TCP socket is dup'ed.
2017-08-29 10:53:04 -06:00
Gregory Nutt
9db65dea78
Networking: TCP disconnection callbacks are not retained in a list. This will support mutiple callbacks per lower-level TCP connection structure. That is necessary for the cae where a socket is dup'ed and shares the same lower-level connection structure. NOTE: There still needs to be a call to tcp_start_monitor() when the socket is dup'ed.
2017-08-29 10:38:01 -06:00
Gregory Nutt
ed58536c3a
Networking: Move two more TCP specific files from inet/ to tcp/. There is other TCP-specific logic in inet/ that should be moved sometime, but those are more entangled.
2017-08-29 09:25:22 -06:00
Gregory Nutt
92f44c5607
Networking: Move net/inet/net_monitor.c to net/tcp/tcp_monitor.c in preparation for design change to fix monitoring of duplicated sockets.
2017-08-29 08:40:13 -06:00
Gregory Nutt
88a87f8e3f
6LoWPAN: The original, Contiki-based design used only a single buffer for reassemblying larger packets. This could be a problem issue for hub configurations which really need the capability concurrently reassemble multiple incoming streams concurrently. These was also a design issue in that the reassembly buffer could be corrupted by outgoing packets. The design was extended to support multiple reassembly buffers, each associated with the reassembly tag and source address. This assures that there can be be no corruption of the reassembly once it has started.
2017-08-26 10:00:47 -06:00
Gregory Nutt
aeb59383cf
Remove CONFIG_NET_MULTILINK. This increases code size by a little, but greatly reduces the complexity of the network code.
2017-08-08 15:26:09 -06:00
Gregory Nutt
bd7c84b23e
Remove CONFIG_NETDEV_MULTINIC. This increases code size by a little, but greatly reduces the complexity of the network code.
2017-08-08 14:24:12 -06:00
Gregory Nutt
835ae2999d
networking: Move a little more to the inet/ subdirectory.
2017-08-07 13:03:23 -06:00
Gregory Nutt
2ada7d5892
IPv6: Remove comparisons to the address with all ones set. IPv6 does not support broadcast addresses and certainly not in that form. Replace with multicast addresses beginning with 0xff02.
2017-08-07 11:50:50 -06:00
Gregory Nutt
3c6981534f
Networking: Move INET socket interface out of net/sockets to its own directory net/inet
2017-08-06 14:48:19 -06:00
Gregory Nutt
aa2e9c15a5
IP forwarding: Major rearchitecting of the outgoing portion of the IP forwarding logic necessary into to properly received device-related forwarding events.
2017-07-07 20:19:26 -06:00
Gregory Nutt
803235ad4b
IP forwaring: Rename some files to get closer to other naming conventions.
2017-07-07 18:45:58 -06:00
Gregory Nutt
7258f1cbfc
IP forwarding: Move to separate directory. A few fixes from early testing; In TUN driver, do all polling on worker thread. Otherwise, the stack gets very deep.
2017-07-07 18:33:06 -06:00
Gregory Nutt
8d81b35c44
network: Correct some issues that prevent TCP from working correctly when both IPv4 and IPv6 are enabled.
2017-07-07 08:50:01 -06:00
Gregory Nutt
b5d7187df6
IP forwarding design simplication; might save some memory. Also fix some compile issues introduce with last commit in MULTINIC configration.
2017-07-06 16:19:10 -06:00
Gregory Nutt
b297066eb9
IP Forwarding: Add IPv4 packet forwarding logic. Initial commit is an untested clone of the IPv6 forwarding logic with a few minor logic changes for IPv4.
2017-07-05 15:12:29 -06:00
Gregory Nutt
edf16c5805
IP forwarding: In check it the Ethernet MAC address is in the ARP/Neighbor table, add an additional check to skip in the case of CONFIG_NET_MULTILINK and the devices is not an Ethernet device.
2017-07-05 12:40:26 -06:00
Gregory Nutt
31f832d8c5
IP forwarding: Flesh out TCP, UDP, and ICMPv6 packet forwarding logic.
2017-07-05 11:01:16 -06:00
Gregory Nutt
c0c275c8fc
IP forwarding. Adds a little more structure to handle passing packets received on one network device to another network device. Logic is still incomplete.
2017-07-04 10:19:52 -06:00
Gregory Nutt
83a875f394
IP forwarding: Add some fragments of TCP forwarding logic.
2017-07-03 15:58:01 -06:00
Gregory Nutt
5a8668b362
6LoWPAN TCP: Fix more ACK handling, fix some callback flag settings. Now the TCP test appears fully functional on 6LoWPAN.
2017-06-25 13:00:42 -06:00
Gregory Nutt
3203f0a93a
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.
2017-06-24 16:00:41 -06:00
Gregory Nutt
96af668ab8
6LoWPAN: Handle case where the local address is zero (listen socket)
2017-06-24 11:57:59 -06:00
Gregory Nutt
01b0a56371
TCP: tcp_input() now receives IP domain as an input parameter vs. deriving from the IP header length.
2017-05-25 08:02:08 -06:00
Masayuki Ishikawa
32a638cdfe
TCP: Fix tcp_findlistner() in dual stack mode
...
Signed-off-by: Masayuki Ishikawa <masayuki.ishikawa@gmail.com>
2017-05-25 16:54:19 +09:00
Gregory Nutt
56c8456ff0
Update some comments.
2017-05-16 07:38:57 -06:00
Gregory Nutt
914c5dad0c
TCP: An RST recevied suring the 3-way handshake requires a little more clean-up
2017-05-15 08:10:43 -06:00
Gregory Nutt
aa57fb159d
TCP: Send RST if applicaiton 'unlistens()' before we complete the connection sequence.
2017-05-14 13:30:59 -06:00
Gregory Nutt
8acfea1197
Fix some typos
2017-05-14 12:14:31 -06:00
Gregory Nutt
d339ba9e0e
TCP: Fix some potential error conditions that could result from deferring the connection until the full 3-way handshake has completed.
2017-05-14 10:56:25 -06:00
Simon Piriou
8dc7f6d79e
tcp: wait for 3-Way Handshare before accept() returns
2017-05-14 09:08:32 -06:00
Gregory Nutt
0de294a586
Fix lots of occurrences of 'the the', 'the there', 'the these', 'the then', 'the they.
2017-05-11 13:35:56 -06:00
Gregory Nutt
2043e1a114
IOBs: Move from driver/iob to a better location in mm/iob
2017-05-09 07:35:30 -06:00
Gregory Nutt
d5207efb5a
Be consistent... Use Name: consistent in function headers vs Function:
2017-04-21 16:33:14 -06:00
Gregory Nutt
bfb93338f6
Move net/iob to drivers/iob so that the I/O buffering feature can be available to other drivers when networking is disabled.
2017-04-20 16:08:49 -06:00
Gregory Nutt
bcc6b61fc1
Move include/nuttx/net/iob.h to include/drivers/iob.h; rename CONFIG_NET_IOB to CONFIG_DRIVERS_IOB
2017-04-20 14:53:30 -06:00
Gregory Nutt
7cb34d969d
6loWPAN: More fixes from early debug.
2017-04-03 15:25:36 -06:00
Gregory Nutt
1b6630ee75
6loWPAN: Fix compile errors and warnings when building the complete 6loWPAN configuration.
2017-04-02 17:46:22 -06:00
Gregory Nutt
76406af71b
6loWPAN: Add support for sendto()
2017-04-02 11:15:46 -06:00
Gregory Nutt
732f0855c6
6loWPAN: Fleshes out framwork for IEEE802.15.4 send. But still has some gaping holes.
2017-03-31 15:09:07 -06:00
Jussi Kivilinna
cd3c9634c8
Add user-space networking stack API (usrsock)
...
User-space networking stack API allows user-space daemon to
provide TCP/IP stack implementation for NuttX network.
Main use for this is to allow use and seamless integration of
HW-provided TCP/IP stacks to NuttX.
For example, user-space daemon can translate /dev/usrsock
API requests to HW TCP/IP API requests while rest of the
user-space can access standard socket API, with socket
descriptors that can be used with NuttX system calls.
2017-03-31 08:58:14 -06:00
Gregory Nutt
64933246c3
6loWPAN: Tie 6loWPAN send into common socket send logic.
2017-03-28 14:08:54 -06:00
Gregory Nutt
ba2b345990
Remove a few remaining use of the obsolteted 'Compilation Switches' program section
2017-01-22 08:57:18 -06:00
Gregory Nutt
9f7d332028
Minor changes from the review of the last PR
2017-01-18 07:32:27 -06:00
Pascal Speck
2e074ca4f9
- Fixed some issues that prevented ipv6 to work with ipv4 enabled.
2017-01-18 10:57:15 +01:00
Gregory Nutt
7467329a98
Eliminate CONFIG_NO_NOINTS. Lots of files changed -> lots of testing needed.
2016-12-03 16:28:19 -06:00
Gregory Nutt
2d057c28c8
net: Disable priority inheritance on all semaphores used for signaling
2016-11-03 12:17:02 -06:00
Gregory Nutt
9c3bade7b4
net/tcp: tcp_ipvX_bind() not actually using the ported selected with port==0. Also removes duplicate call to pkt_input(). Issues noted by Pascal Speck.
2016-08-30 07:59:57 -06:00
Gregory Nutt
2a751068e6
Without lowsyslog() *llerr() is not useful. Eliminate and replace with *err().
2016-06-20 12:44:38 -06:00
Gregory Nutt
43eb04bb8f
Without lowsyslog() *llinfo() is not useful. Eliminate and replace with *info().
2016-06-20 11:59:15 -06:00
Gregory Nutt
d40a473f72
Without lowsyslog() *llwarn() is not useful. Eliminate and replace with *warn().
2016-06-20 09:37:08 -06:00
Gregory Nutt
2b445ddccc
Remove lowsyslog(). The new syslog() includes all of the functionality of lowsyslog(). No longer any need for two interfaces.
2016-06-20 08:57:08 -06:00
Jakub Łągwa
338b915008
While working with version 7.10 I discovered a problem in TCP stack that could be observed on high network load. Generally speaking, the problem is that RST flag is set in unnecessary case, in which between loss of some TCP packet and its proper retransmission, another packets had been successfully sent. The scenario is as follows: NuttX did not receive ACK for some sent packet, so it has been probably lost somewhere. But before its retransmission starts, NuttX is correctly issuing next TCP packets, with sequence numbers increasing properly. When the retransmission of previously lost packet finally succeeds, tcp_input receives the accumulated ACK value, which acknowledges also the packets sent in the meantime (i.e. between unsuccessful sending of lost packet and its proper retransmission). However, variable unackseq is still set to conn->isn + conn->sent, which is truth only if no further packets transmission occurred in the meantime. Because of incorrect (in such specific case) unackseq value, few lines further condition if (ackseq <= unackseq)is not met, and, as a result, we are going to reset label.
2016-06-20 06:55:29 -06:00
Gregory Nutt
7d0950bb22
net/: Change some nerr() ERRORS to nwarn() WARNINGS. Anomolous network events are not errors.
2016-06-12 07:09:37 -06:00
Gregory Nutt
f4fcdcdb4d
net/: Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition.
2016-06-11 17:37:21 -06:00
Gregory Nutt
a1469a3e95
Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err()
2016-06-11 15:50:49 -06:00
Gregory Nutt
e99301d7c2
Rename *lldbg to *llerr
2016-06-11 14:55:27 -06:00
Gregory Nutt
86b79b33cf
Reserver the name 'err' for other purposes
2016-06-11 14:40:07 -06:00
Gregory Nutt
1cdc746726
Rename CONFIG_DEBUG to CONFIG_DEBUG_FEATURES
2016-06-11 14:14:08 -06:00
Gregory Nutt
fc3540cffe
Replace all occurrences of vdbg with vinfo
2016-06-11 11:59:51 -06:00
Gregory Nutt
c98f00a93b
Update comments; trivial addtion to a document.
2016-06-10 09:36:59 -06:00
Gregory Nutt
4f208600aa
Replace confusing references to uIP with just 'the network'
2016-05-30 09:31:44 -06:00
Gregory Nutt
2dd9777c7e
Fix a backward conditional test introduced with the last commit
2016-03-20 09:58:07 -06:00
Gregory Nutt
00b44959ea
TCP poll: TCP poll events can really only being processed when the poll from the correct device is received.
2016-03-20 08:39:15 -06:00
Gregory Nutt
4639cdd894
TCP timeouts: Fix some logic when there are multiple network interfaces. In this case, TCP timeout events can really only being processed when the poll from the correct device is received.
2016-03-20 08:19:00 -06:00
Gregory Nutt
2c95fef501
Remove some empty code section comments
2016-02-26 07:35:55 -06:00
Gregory Nutt
8db55f6493
Back out most of previous commit
2016-02-26 06:45:37 -06:00
Gregory Nutt
0b441ff1f4
net/: Add basic IEEE 802.15-4 socket support
2016-02-25 14:01:22 -06:00
Gregory Nutt
0fb035f76b
Standardize some naming in code section comments
2016-02-21 18:09:04 -06:00
Andrew Webster
49e5cc5a6f
TCP: check for an active connection before cleaning it up
...
If there is no active connection (e.g. it is waiting in accept), then
the connection object, which doesn't yet exist, should not be cleaned
up when the socket is closed.
2016-01-22 16:22:09 -06:00
Andrew Webster
5e3023bef1
TCP: return from write when there is no buffer space
...
During a write, if there is no more buffer space for the user data,
return the amount that was written instead of waiting until there
is free space. If nothing has been written yet, then block as before.
This solves a deadlock that occurs if the user data is too large to
fit in the available buffer: the write thread will block before any
data is added to the write queue, leaving no possibility that more
buffers will free up when they are ACKed (since they have not yet been
sent). The write thread will then block forever and hold all of the
buffers.
2016-01-22 16:19:20 -06:00
Andrew Webster
cdd187a7f3
TCP: check for sndcb before using it
2016-01-22 15:54:45 -06:00
Andrew Webster
df211ee46a
TCP: add writable check during poll
...
When a poll requesting POLLOUT happens, the poll should return
immediately if a write will not block. This change adds that, as
opposed to the old behaviour of blocking until a timer from the
Ethernet driver eventually triggers the poll to complete.
This is only implemented for buffered TCP. Unbuffered TCP should
behave as before.
2016-01-22 15:52:14 -06:00
Andrew Webster
99f5fcda70
iTCP: use lowlevel syslog to avoid infinte recursion
...
If stdout is a socket (e.g. telnet), then the debug message will cause
more TCP data to be sent, which generates another message, and so on
2016-01-22 15:41:48 -06:00
Gregory Nutt
f348e68069
Update to use 64-bit timer when available
2016-01-21 11:54:26 -06:00
Gregory Nutt
6209c51206
net/: More clean-up of spacing/alignment issues
2015-10-08 15:10:04 -06:00
Gregory Nutt
0b12dbf95d
Fix some spacing problems
2015-10-04 15:04:00 -06:00
Gregory Nutt
cb9e27c3b0
Standardize naming used for public data and function groupings
2015-10-02 16:30:35 -06:00
Gregory Nutt
d700793077
Fix a compile error when IPv6 is enabled
2015-09-07 16:34:25 -06:00
Alan Carvalho de Assis
f10a103108
Fix tcp_send_unbuffered when NET_ETHERNET is not defined.
2015-09-07 13:31:35 -06:00
Gregory Nutt
9c66bde5b0
Fix typo in pre-processor command noted by Pierre-noel Bouteville. Also move # of pre-processior command to column 1
2015-09-05 09:10:48 -06:00
Gregory Nutt
14297afb83
Cosmetic fix to break up long line
2015-09-03 07:33:50 -06:00
Gregory Nutt
36f4d0e9fc
Fix a error in some comments
2015-09-02 20:03:28 -06:00
Gregory Nutt
0e2986f131
net/tcp: The logic that binds a specific networkd device to a connection was faulty for the case of multiple network devices. On bind(), the local address should be used to associate a device with the connection (if the local address is not INADDR_ANY); On connect(), the remote address should be used (in case the local address is INADDR_ANY). On accept(), it does not matter but the remote address is the one guarenteed to be available.
2015-09-02 19:48:31 -06:00
Gregory Nutt
9fcad39a45
Trivial typo fix
2015-09-02 10:09:33 -06:00
Gregory Nutt
63071a563a
Costmetic changes
2015-08-27 10:38:43 -06:00
Gregory Nutt
b1e09d4847
net/socket and net/tcp: Fix a problem in whent there are multiple network devices. Polls were being sent to all TCP sockets before. This is not good because it means that packets may sometimes be sent out on the wrong device. That is inefficient because it will cause retransmissions and bad performance. But, worse, when one of the devices is not Ethernet, it will have a different MSS and, as a result, incorrect data transfers can cause crashes. The fix is to lock into a single device once the MSS is locked locked down.
2015-08-27 09:06:46 -06:00
Gregory Nutt
3bcdb218ff
Networking: Get rid of the tcp_mss macro. It is confusing and only obfuscates what is really going on
2015-08-27 08:39:17 -06:00
Gregory Nutt
007aabc46f
Fix a badly formatted comment
2015-08-26 19:18:04 -06:00
Anton D. Kachalov
b125c36849
Field `d_sndlen' is unsigned. It is always >= 0.
...
Signed-off-by: Anton D. Kachalov <mouse@yandex-team.ru>
2015-08-26 00:16:52 +03:00
SaeHie Park
e983e547e1
Networking: Correct return value from psock_tcp_accept(). From SaeHie Park
2015-08-25 07:15:21 -06:00
Gregory Nutt
342f5fe33d
Fix references to the no-longer-existent misc/ directory in comments, README files, and documentation
2015-06-28 08:08:57 -06:00
Gregory Nutt
8f7752d956
Networking: Modify how callback structures are stored to avoid another potential use of a stal pointer.
2015-06-03 08:11:57 -06:00
Gregory Nutt
33085cb309
Networking: The network device list was protected by a re-entrant semaphore. With the recent change to support network device callback, the network stack needs to access the network device list too. Some drivers, however, run the network stack from the interrupt level -- this is bad but a fact in the current state. Of course,those drivers are unable to take the semaphore and will assert.
...
The solution here is to eliminate the device devices semaphore altogether. This eliminates netdev_semtake() and netdev_semgive() and replaces them with net_lock() and net_unlock() which have larger scope as needed for this purpose.
2015-05-31 08:34:03 -06:00
Gregory Nutt
6687e156e6
Revamp last change. IFF_UP only required when allocating callback, not freeing.
2015-05-30 21:13:58 -06:00