nuttx/net
Steve bd3ef36eda SUMMARY
-------
   This patch enhances networking support for the simulation under Linux.
   Includes updated support for Linux TUN/TAP, and the addition of support for
   Linux bridge devices.

CHANGES
-------
   o Check to see if the d_txavail callback is present before calling it in
     the arp send code.  This prevents a segfault when simulating the telnetd
     daemon with arp send enabled.

   o Adjust the simulation's netdriver_loop() so it will detect and respond to
     ARP requests.

   o Do not attempt to take the tap device's hardware address for use by the
     simulation.  That hardware address belongs to the host end of the link,
     not the simulation end.  Generate a randomized MAC address instead.

   o Do not assign an IP address to the interface on the host side of the TAP
     link.

   + Provide two modes: "host route" and "bridge".

   + In host route mode, maintain a host route that points any traffic for the
     simulation's IP address to the tap device.  In this mode, so long as the
     simulation's IP is a free address in the same subnet as the host, no
     additional configuration will be required to talk to it from the host.
     Note that address changes are handled automatically if they follow the
     rule of if-down/set-address/if-up, which everything seems to.

   + In bridge mode, add the tap device to the specified bridge instance.  See
     configs/sim/NETWORK-LINUX.txt for information and usage examples.  This
     enables much more flexible configurations (with fewer headaches), such as
     running multiple simulations on a single host, all of which can access
     the network the host is connected to.

   o Refresh configurations in configs/sim where CONFIG_NET=y.  They default
     to "host route" mode.

   o Add configs/sim/NETWORK-LINUX.txt

CAVEATS
-------
   - The MAC address generation code is extremely simplistic, and does not
     check for potential conflicts on the network.  Probably not an issue, but
     something to be aware of.

   - I was careful to leave it in a state where Cygwin/pcap should still work,
     but I don't have a Windows environment to test in.  This should be
     checked.

   - I don't know if this was ever intended to work with OS X.  I didn't even
     try to test it there.

NOTES
-----
   - Was able to get telnetd working and simulate nsh over telnet, but only so
     long as listen backlogs were disabled.

     There appears to be a bug in the backlog code where sockets are being
     returned in SYN_RCVD state instead of waiting until they're ESTABLISHED;
     if you perform an immediate send after accepting the connection, it will
     confuse the stack and the send will hang; additionally, the connection
     will never reach ESTABLISHED state.

     Can be worked around by adding a sleep(1) after the accept in telnetd.  I
     don't have the necessary knowledge of the IP stack to know what the
     correct fix is.
2016-05-20 17:36:14 -06:00
..
6lowpan net/: Finish IEEE802154->6LOWPAN renaming; remove PF_IEEE804154; Move 6LoWPAN menu to inside Internet Protocol Menu 2016-02-27 07:26:20 -06:00
arp SUMMARY 2016-05-20 17:36:14 -06:00
devif net/: IEEE 802.15-4 basic build build structure. 2016-02-25 10:43:51 -06:00
icmp Remove some empty code section comments 2016-02-25 18:34:36 -06:00
icmpv6 Standardize some naming in code section comments 2016-02-21 18:09:04 -06:00
igmp Remove some empty code section comments 2016-02-25 18:34:36 -06:00
iob Remove some empty code section comments 2016-02-26 07:35:55 -06:00
local Networking: Cosmetic change 2016-02-24 19:02:51 -06:00
loopback Networking: With these changes, I can ping the local loopback device from the simulator 2015-08-24 13:49:12 -06:00
neighbor Networking: Remove the HSEC argument from devif_timer. 2016-02-03 12:12:41 -06:00
netdev net/: Finish IEEE802154->6LOWPAN renaming; remove PF_IEEE804154; Move 6LoWPAN menu to inside Internet Protocol Menu 2016-02-27 07:26:20 -06:00
pkt Remove some empty code section comments 2016-02-26 07:35:55 -06:00
procfs Step 1 in /etc/resolv.conf support 2016-01-13 15:06:44 -06:00
route Remove some empty code section comments 2016-02-25 18:34:36 -06:00
socket VNC: Add basic message receipt logic 2016-04-17 09:17:37 -06:00
tcp Fix a backward conditional test introduced with the last commit 2016-03-20 09:58:07 -06:00
udp Back out most of previous commit 2016-02-26 06:45:37 -06:00
utils Remove some empty code section comments 2016-02-25 18:34:36 -06:00
.gitignore .dSYM only needs to be in the same .gitignore files as .exe 2013-05-30 15:02:04 -06:00
Kconfig Remove most unused references to CONFIG_NET_MULTICAST. Rename other uses of CONFIG_NET_MULTICAST to avoid naming comflicts. 2016-03-20 13:16:17 -06:00
Makefile Several Makefiles: Add .PHONY definitions to prevent 'clean up to date' message weirdness. 2016-05-10 15:44:06 -06:00
net_initialize.c Standardize some naming in code section comments 2016-02-21 18:09:04 -06:00
README.txt Networking: Add NetDB support for the local loopback device 2015-08-24 10:08:26 -06:00

README
======

Directory Structure
===================

  nuttx/
   |
   `- net/
       |
       +- arp      - Address resolution protocol (IPv4)
       +- devif    - Stack/device interface layer
       +- icmp     - Internet Control Message Protocol (IPv4)
       +- icmpv6   - Internet Control Message Protocol (IPv6)
       +- iob      - I/O buffering logic
       +- local    - Unix domain (local) sockets
       +- loopback - Local loopback
       +- neighbor - Neighbor Discovery Protocol (IPv6)
       +- netdev   - Socket network device interface
       +- pkt      - "Raw" packet socket support
       +- socket   - BSD socket interface
       +- route    - Routing table support
       +- tcp      - Transmission Control Protocol
       +- udp      - User Datagram Protocol
       `- utils    - Miscellaneous utility functions


    +----------------------------------------------------------------+
    |                     Application layer                          |
    +----------------------------------------------------------------+
    +----------------------------------------------------------------+
    |                   Socket layer (socket/)                       |
    +----------------------------------------------------------------+
    +------------++--------------------------------------------------+
    |  Network   || Protocol stacks (arp, ipv6, icmp, pkt, tcp, udp) |
    |   Device   |+--------------------------------------------------+
    | Interface  |+------------------------------------++------------+
    | (netdev/)  ||  Network Device Interface (devif/) || Utilities  |
    +------------++------------------------------------++------------+
    +----------------------------------------------------------------+
    |                    Network Device Drivers                      |
    +----------------------------------------------------------------+