networking

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
networking [2014/09/25 12:16] – Redistribute Robert's list and remove issues already addressed (such as IFF_NEEDSGIANT) GeorgeNevilleNeilnetworking [2021/04/25 08:13] (current) – Fix DevSummit links. JethroNederhof
Line 1: Line 1:
-This topic is 'mission control' for ongoing work on the %%FreeBSD%% networking code. It is by no means exhaustive or authoritative, however, its use as a tool for effective collaboration is encouraged.+This is 'mission control' for ongoing work on the %%FreeBSD%% networking code. It is by no means exhaustive or authoritative, however, its use as a tool for effective collaboration is encouraged.
  
-If you want to work on a task please put your Wiki name next to it. Participation in other forums such as the net@%%FreeBSD%%.org mailing list is strongly encouraged. There is plenty for volunteers of all aptitude levels to do; some of this work even has the potential to be funded open source work. +If you want to work on a task please put your %%WikiName%% next to it. Participation in other forums such as the [[https://lists.freebsd.org/pipermail/freebsd-net/|freebsd-net mailing list]] is strongly encouraged. There is plenty for volunteers of all aptitude levels to do; some of this work even has the potential to be funded open source work.
- +
-As a general rule of thumb it takes around 2 weeks to get good feedback about changes to %%FreeBSD%%-CURRENT.+
  
 The tasks are arranged roughly in descending order of how quickly they can/should be finished. The tasks are arranged roughly in descending order of how quickly they can/should be finished.
  
-===== TODO ===== +**Subpages** 
-  * Add [[https://www.bountysource.com/|bounties]] to this list. + 
-  * Add NetworkNeedsGiant giant-locked network drivers slated for removal to this list.+  * [[Networking/10GbE|10GbE]] 
 +  * [[Networking/ReceiveSideScaling|ReceiveSideScaling]] 
 +  * [[Networking/WakeOnLan|WakeOnLan]]
  
 ===== Low hanging userland fruit ===== ===== Low hanging userland fruit =====
Line 58: Line 58:
       * wi(4) PRISM2 is known to have broken IFF_ALLMULTI.       * wi(4) PRISM2 is known to have broken IFF_ALLMULTI.
     * Emulate IFF_ALLMULTI using IFF_PROMISC and M_PROMISC.     * Emulate IFF_ALLMULTI using IFF_PROMISC and M_PROMISC.
 +  * Fix warning about adding a new protocol family after finalization.  Quick way to trigger error is to load the bluetooth stack after boot (which is now down by devd by default on HEAD if a USB bluetooth device is found).
 ===== Porting tasks ===== ===== Porting tasks =====
 These are tasks which involve the porting of software to %%FreeBSD%%, using the ports system, which will help future network development by making use of new %%FreeBSD%% features for 'hot topics' in computer networking in the wider world. These are tasks which involve the porting of software to %%FreeBSD%%, using the ports system, which will help future network development by making use of new %%FreeBSD%% features for 'hot topics' in computer networking in the wider world.
Line 65: Line 66:
     * The [[http://www.xorp.org/|XORP]] router control plane can use Click as its forwarding path as an alternative to ip_forward().     * The [[http://www.xorp.org/|XORP]] router control plane can use Click as its forwarding path as an alternative to ip_forward().
   * Make 'Zeroconf' local area DNS service discovery ('DNS-SD') work.   * Make 'Zeroconf' local area DNS service discovery ('DNS-SD') work.
-    * A [[http://people.freebsd.org/~bms/dump/kdnssd_avahi.tar|New port]] for kdnssd_avahi is available for testing, which overwrites the default KDE libkdnssd.so.1 library with one which uses Avahi as a back-end for mdns. -- BruceSimpson+    * A ''%%http://people.freebsd.org/~bms/dump/kdnssd_avahi.tar%%'' (broken) New port for kdnssd_avahi is available for testing, which overwrites the default KDE libkdnssd.so.1 library with one which uses Avahi as a back-end for mdns. -- BruceSimpson
   * Teach the net/olsrd port to use IP_ONESBCAST.   * Teach the net/olsrd port to use IP_ONESBCAST.
     * A patch has been sent to the port maintainer. -- BruceSimpson     * A patch has been sent to the port maintainer. -- BruceSimpson
Line 116: Line 117:
   * Rejig ipfw to not require the aquisition of a lock for every packet.   * Rejig ipfw to not require the aquisition of a lock for every packet.
     * This would also remove a LOR when testing for uid of the sender/receiver process.     * This would also remove a LOR when testing for uid of the sender/receiver process.
-* Generally revisit if_flags, if_drvflags. Look especially hard at the IFF_LINK* flags, which have quite variable semantics and may need to be broken out themselves, as they are sometimes driver flags (and sometimes not).+  * Generally revisit if_flags, if_drvflags. Look especially hard at the IFF_LINK* flags, which have quite variable semantics and may need to be broken out themselves, as they are sometimes driver flags (and sometimes not).
   * General review of struct ifnet locking, ifnet API for device drivers, ifnet locking.   * General review of struct ifnet locking, ifnet API for device drivers, ifnet locking.
   * TCPDEBUG appears not to have been updated for TCP timewait support, and therefore may return incorrect data.  It needs to be updated.   * TCPDEBUG appears not to have been updated for TCP timewait support, and therefore may return incorrect data.  It needs to be updated.
Line 126: Line 127:
   * protosw(9) man page for protocol switch APIs.   * protosw(9) man page for protocol switch APIs.
   * Revisit multi-mbuf allocation, multi-mbuf input.   * Revisit multi-mbuf allocation, multi-mbuf input.
 +    * ether_input() accepts a list of mbufs
   * Investigate solutions to inpcb tear-down races involving timers with tcp -- right now, timers are stopped but not drained, so timers can race with tear-down, hence NULL checks in timer code.   * Investigate solutions to inpcb tear-down races involving timers with tcp -- right now, timers are stopped but not drained, so timers can race with tear-down, hence NULL checks in timer code.
   * Revisit locking and atomicity for uipc_send(), and in particular, with respect to what happens if two threads simultaneously call sendto() on different addresses with the same datagram socket. Currently this is likely prevented by sblock() at the system call layer, but races with connect() aren't, as was shown by the recent race case along the same lines. Somehow this needs to be serialized.   * Revisit locking and atomicity for uipc_send(), and in particular, with respect to what happens if two threads simultaneously call sendto() on different addresses with the same datagram socket. Currently this is likely prevented by sblock() at the system call layer, but races with connect() aren't, as was shown by the recent race case along the same lines. Somehow this needs to be serialized.
Line 131: Line 133:
   * Continue pushing of control of state changes from socket layer to protocol layer so as to improve inter-layer consistency and reduce races between layers on socket state transitions (connect/disconnect/connecting/disconnecting/...)   * Continue pushing of control of state changes from socket layer to protocol layer so as to improve inter-layer consistency and reduce races between layers on socket state transitions (connect/disconnect/connecting/disconnecting/...)
   * Analysis of listen state transitions, which appear poorly defined.  Consider in particular interactions with kqueue, where the order of registering kqueue events vs. calling listen affects the semantics considerably.   * Analysis of listen state transitions, which appear poorly defined.  Consider in particular interactions with kqueue, where the order of registering kqueue events vs. calling listen affects the semantics considerably.
 +  * Integrate solutions for RSS (for reference: [[DevSummit/201305/NetworkReceivePerformance/ComparingMutiqueueSupportLinuxvsFreeBSD|ComparingMultiqueueSupportLinuxvsFreeBSD]] [[Networking/ReceiveSideScaling]])
  
 ===== Long term projects ===== ===== Long term projects =====
Line 140: Line 143:
     * Clean up re-entrancy poop.     * Clean up re-entrancy poop.
       * inet_ntoa() and inet_aton() in kernel have PRs...       * inet_ntoa() and inet_aton() in kernel have PRs...
-    * Consider importing more general abstract data structures from other BSDs, e.g. red-black trees, if these will make a difference to performance for the main use cases. 
   * Port %%NetBSD%%'s MBUFTRACE. Who really owns that mbuf chain which happens to be in your core file?   * Port %%NetBSD%%'s MBUFTRACE. Who really owns that mbuf chain which happens to be in your core file?
     * This was added to %%NetBSD%% MAIN on Feb 26 2003.     * This was added to %%NetBSD%% MAIN on Feb 26 2003.
Line 153: Line 155:
   * Implement source routing policy.   * Implement source routing policy.
     * This is deliberately vague as it needs further research.     * This is deliberately vague as it needs further research.
-    * Original research is currently being conducted in the formal academic world into the issues around implementing DiffServ and IntServ, both of which impact forwarding at all layers of the stack.+    * Original research is currently being conducted in the formal academic world into the issues around implementing %%DiffServ%% and %%IntServ%%, both of which impact forwarding at all layers of the stack.
     * This is an area for funded formal research.     * This is an area for funded formal research.
   * Explore increasing netisr queue depth due to gallatin's report that overflows are causing TCP problems with 10gbps interfaces.   * Explore increasing netisr queue depth due to gallatin's report that overflows are causing TCP problems with 10gbps interfaces.
 +  * NetworkingPerformanceProject
 +  * reentry locking: Yandex (TODO: name) has done a lot of investigation into packet forwarding performance on %%FreeBSD%%-9 and %%FreeBSD%%-10.
 +    * The locking around rtentry is expensive - do we actually need to refcount rtentry, or can we architect it out by not passing it by reference into the forwarding stack?
 +    * Implement counter(9)-based interface for lockless refcounting on ifp's
 +    * Convert current users of rtentry(9) api to new forwarding functions
 +  * Radix trie efficencies (or lack thereof)
 +    * Split routing structures (radix/rtentry stuff) into 2 different things: feature-rich RIB for determining best routes among several ones and fast af-dependent one used to forward packets.
 +    * Fix masks bug in radix (done)
 +    * Fix multipath
 +    * Implement API to program FIB for given family
 +    * Implement IPv4 FIB
 +  * mbuf backing store representation
 +    * Under memory fragmentation, a large send buffer can be represented by a large set of underlying, discontiguous memory pages. In the most pessimistic case, a large read via sendfile() can be decomposed into a small number of 4KiB page entries which are individually converted into separate mbufs and then passed to the network stack to send. If some pages are cached but others aren't, then this also results in a list of mbufs that represent each set of pages. Then in the network driver, this list of mbufs has to be walked again and turned into a gather DMA list for the NIC. This all takes time and touches memory.
 +    * Ideally the network stack should be able to deal with an mbuf which is made up of multiple underlying buffers. For the above case(s), an array of pages could be passed up, or some API that allows for 'struct buf' (and others) to be exposed as the underlying buffer without overhead.
 +    * The trick here is that almost all of the networking code assumes that:
 +    * you can directly fondle the m->m_data pointer for a given mbuf, without modifying the actual backing store, in order to reserve header space;
 +    * there's only one buffer per mbuf, that you can access via mtod();
 +    * walking the buffers that make up an mbuf is done by walking the m_next pointer list.
 +    * It may be quite a win to be able to represent mbufs as an abstract data source that will default to a single buffer, but could be backed by an array of vm_page_t entries, or a 'struct buf', or similar. A lot of code may need modifying to handle this - ie, all the direct mbuf pointer adjustment and manual iteration - but it will result in the mbuf consumer code being tidier.
 +  * Syscall batching
 +    * There's been some recent work by Yahoo (TODO: URL) looking at how effective it is to batch IO related syscalls. They found that batching up to 32 read/write/accept/connect/close (zero copy or otherwise) syscalls into batches gave a significant performance boost.
 +  * Contention between TCP RX (ACK -> TCP window update, transmit) and TCP TX
  
 ===== 802.11 Tasks ===== ===== 802.11 Tasks =====
 802.11 Wireless is a 'killer app' for open source operating systems. Help %%FreeBSD%% to stay ahead. 802.11 Wireless is a 'killer app' for open source operating systems. Help %%FreeBSD%% to stay ahead.
  
-  * Implement 802.11n 'MIMO' features in net80211. +  * Look at a few things: 
-    * Receive and transmit diversity. +
-  * Develop a virtual 802.11 driver, let's call it wtap(4) for example. +
-    * tap emulates 802.3 Ethernet, it would be useful to have same for 802.11. +
-    * This will be instrumental in developing 802.11s ESS Mesh. +
-    * The if_bridge code serves as a reference for doing "Brouting" like this. +
-      * See [[http://research.sun.com/sunlabsday/docs.2004/talks/1.05_Perlman.pdf|Radia Perlman's "RBridges" paper]] +
-    * Confirm that we support 802.11 frame injection via bpf/pcap from userland. +
-  * Such a virtual 802.11 driver could potentially be used to implement the following:+
     * [[http://en.wikipedia.org/wiki/IEEE_802.11f|IEEE 802.11f Inter Access Point Protocol]]     * [[http://en.wikipedia.org/wiki/IEEE_802.11f|IEEE 802.11f Inter Access Point Protocol]]
     * [[http://en.wikipedia.org/wiki/IEEE_802.11k|IEEE 802.11k Radio Resource Management]]     * [[http://en.wikipedia.org/wiki/IEEE_802.11k|IEEE 802.11k Radio Resource Management]]
Line 203: Line 220:
     * If we want to send 802.1p priority, this should be done as part of a full implementation.     * If we want to send 802.1p priority, this should be done as part of a full implementation.
       * When layers are being crossed, something between the protocol layer and link layer will be responsible for mapping the DSCP byte to 802.1p.       * When layers are being crossed, something between the protocol layer and link layer will be responsible for mapping the DSCP byte to 802.1p.
-    * Until RSVP and DiffServ are fully implemented, the IP_TOS socket option can be used to explicitly set the entire ip_tos byte to a DSCP by an application.+    * Until RSVP and %%DiffServ%% are fully implemented, the IP_TOS socket option can be used to explicitly set the entire ip_tos byte to a DSCP by an application.
   * Create a %%FreeBSD%% port of KOM RSVPD (it interoperates with kernel rsvp code and ALTQ).   * Create a %%FreeBSD%% port of KOM RSVPD (it interoperates with kernel rsvp code and ALTQ).
     * Implement generic packet classification capabilities, with a view to the switching of multimedia calls via SIP over lossy / bandwidth limited networks such as 802.11.     * Implement generic packet classification capabilities, with a view to the switching of multimedia calls via SIP over lossy / bandwidth limited networks such as 802.11.
Line 210: Line 227:
     * Both the Ethernet Slow Protocols (802.3ad) and ATM specify OAM now for managing carrier-grade networks.     * Both the Ethernet Slow Protocols (802.3ad) and ATM specify OAM now for managing carrier-grade networks.
   * Implement Multi-Protocol Label Switching (MPLS)   * Implement Multi-Protocol Label Switching (MPLS)
-    * MPLS is widely deployed on Internet network backbones to optimize forwarding and provide advanced IP services. +    * MPLS is widely deployed on Internet network backbones to optimize forwarding and provide advanced IP services.
     * AlexanderChernikov has begun work with MPLS implementation on %%FreeBSD%%.     * AlexanderChernikov has begun work with MPLS implementation on %%FreeBSD%%.
-      * This MPLS implementation is heavily based on netgraph  +      * This MPLS implementation is heavily based on netgraph 
-      * Modified version of bird routing software is used to provide LDP signalling +      * Modified version of bird routing software is used to provide LDP signalling
       * Current project status/wiki/svn can be viewed at [[http://freebsd.mpls.in]]       * Current project status/wiki/svn can be viewed at [[http://freebsd.mpls.in]]
     * MatthewLuckie has begun porting the [[http://www.ayame.org/|Ayame MPLS stack]] to %%FreeBSD%%.     * MatthewLuckie has begun porting the [[http://www.ayame.org/|Ayame MPLS stack]] to %%FreeBSD%%.
Line 221: Line 238:
     * See http://www.scps.org/     * See http://www.scps.org/
     * This is a 'hot topic' in commercial and academic satellite communications (TCP Performance Enhancing Proxies).     * This is a 'hot topic' in commercial and academic satellite communications (TCP Performance Enhancing Proxies).
-  * Port the MITRE MiniRouter to %%FreeBSD%%.+  * Port the MITRE %%MiniRouter%% to %%FreeBSD%%.
     * This potentially builds on and makes use of SCPS.     * This potentially builds on and makes use of SCPS.
     * See http://www.openchannelsoftware.org/projects/MITRE_Minirouter/     * See http://www.openchannelsoftware.org/projects/MITRE_Minirouter/
     * This is a specialist area of research of interest to those in satellite communications.     * This is a specialist area of research of interest to those in satellite communications.
 +
 ===== See also ===== ===== See also =====
-  * [[http://www.freebsd.org/projects/netperf/cluster.html|Information on the Netperf cluster]]+
   * NetperfClusterPointers   * NetperfClusterPointers
 +  * TestClusterOneReservations
  
  • networking.1411647367.txt.gz
  • Last modified: 2014/09/25 12:16
  • by GeorgeNevilleNeil