Feature #2987


Add destination address to hash computation in mac fanout

Added by Sašo Kiselkov almost 10 years ago. Updated about 9 years ago.

Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


Under normal operation, mac worker fanout computes a hash which is then used to select the IP worker to which a given packet is sent for IP processing. The mechanism currently in use only hashes the source IP address and optionally the source and destination port numbers (for TCP, UDP, SCTP and ESP). This is adequate for unicast TCP or low rates of UDP (or other packet-oriented) data, however, it can become a problem when dealing with high rates of packet-oriented flows, especially for IP multicast for IPTV (or other kinds of high-volume multicast streaming).

IPTV streams frequently originate in specialized transmission equipment (such as DVB IRDs and digital content processors) which tend to stream many hundreds of megabits of video sourced at a single IP address and using a single source-destination port combo, instead differentiating each stream based on the destination multicast address. Consider, the following example of an IRD which streams out three different IPTV channels as UDP multicast streams: -> -> ->

In each case, the current hashing algorithm would result in all packets being delivered to the same IP worker thread, which in turn can easily starve a single CPU of resources (in case the volume is sufficient, which in multimedia applications with several Gb/s worth of packet flow, is easy to achieve). On the other hand, switching to round-robin fanout can reorder packets, which for most digital TV applications is equivalent to the packets having been lost in transmission, resulting in unacceptable behavior.

This proposed patch, which is supposed to be applied on top of the patch for issue #918 from Dan McDonald (, implements a new value for mac_fanout_type in mac_sched.c:520, MAC_FANOUT_SRC_DST. When this value is in effect, we simply do a src+dst on the address portion of the packets in hash computation, resulting in correct fanout even for the above noted special case, while guaranteeing correct packet ordering. The default for the mac_fanout_type tunable is left at its original value, thus making sure that no existing systems would be affected by this change.


src-dst_fanout.patch (1.94 KB) src-dst_fanout.patch Sašo Kiselkov, 2012-07-10 02:34 PM
Actions #1

Updated by Sašo Kiselkov about 9 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 90

Awaiting review feedback for webrev at:

Actions #2

Updated by Rich Lowe about 9 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 90 to 100
  • Tags deleted (needs-triage)

Resolved in dea290b


Also available in: Atom PDF