History

sched: Add Common Applications Kept Enhanced (cake) qdisc

sch_cake targets the home router use case and is intended to squeeze the most bandwidth and latency out of even the slowest ISP links and routers, while presenting an API simple enough that even an ISP can configure it. Example of use on a cable ISP uplink: tc qdisc add dev eth0 cake bandwidth 20Mbit nat docsis ack-filter To shape a cable download link (ifb and tc-mirred setup elided) tc qdisc add dev ifb0 cake bandwidth 200mbit nat docsis ingress wash CAKE is filled with: * A hybrid Codel/Blue AQM algorithm, "Cobalt", tied to an FQ_Codel derived Flow Queuing system, which autoconfigures based on the bandwidth. * A novel "triple-isolate" mode (the default) which balances per-host and per-flow FQ even through NAT. * An deficit based shaper, that can also be used in an unlimited mode. * 8 way set associative hashing to reduce flow collisions to a minimum. * A reasonable interpretation of various diffserv latency/loss tradeoffs. * Support for zeroing diffserv markings for entering and exiting traffic. * Support for interacting well with Docsis 3.0 shaper framing. * Extensive support for DSL framing types. * Support for ack filtering. * Extensive statistics for measuring, loss, ecn markings, latency variation. A paper describing the design of CAKE is available at https://arxiv.org/abs/1804.07617, and will be published at the 2018 IEEE International Symposium on Local and Metropolitan Area Networks (LANMAN). This patch adds the base shaper and packet scheduler, while subsequent commits add the optional (configurable) features. The full userspace API and most data structures are included in this commit, but options not understood in the base version will be ignored. Various versions baking have been available as an out of tree build for kernel versions going back to 3.10, as the embedded router world has been running a few years behind mainline Linux. A stable version has been generally available on lede-17.01 and later. sch_cake replaces a combination of iptables, tc filter, htb and fq_codel in the sqm-scripts, with sane defaults and vastly simpler configuration. CAKE's principal author is Jonathan Morton, with contributions from Kevin Darbyshire-Bryant, Toke Høiland-Jørgensen, Sebastian Moeller, Ryan Mounce, Tony Ambardar, Dean Scarff, Nils Andreas Svee, Dave Täht, and Loganaden Velvindron. Testing from Pete Heist, Georgios Amanakis, and the many other members of the cake@lists.bufferbloat.net mailing list. tc -s qdisc show dev eth2 qdisc cake 8017: root refcnt 2 bandwidth 1Gbit diffserv3 triple-isolate split-gso rtt 100.0ms noatm overhead 38 mpu 84 Sent 51504294511 bytes 37724591 pkt (dropped 6, overlimits 64958695 requeues 12) backlog 0b 0p requeues 12 memory used: 1053008b of 15140Kb capacity estimate: 970Mbit min/max network layer size: 28 / 1500 min/max overhead-adjusted size: 84 / 1538 average network hdr offset: 14 Bulk Best Effort Voice thresh 62500Kbit 1Gbit 250Mbit target 5.0ms 5.0ms 5.0ms interval 100.0ms 100.0ms 100.0ms pk_delay 5us 5us 6us av_delay 3us 2us 2us sp_delay 2us 1us 1us backlog 0b 0b 0b pkts 3164050 25030267 9530280 bytes 3227519915 35396974782 12879808898 way_inds 0 8 0 way_miss 21 366 25 way_cols 0 0 0 drops 5 0 1 marks 0 0 0 ack_drop 0 0 0 sp_flows 1 3 0 bk_flows 0 1 1 un_flows 0 0 0 max_len 68130 68130 68130

Toke Høiland-Jørgensen committed 8 years ago

Commit 046f6fd1 parent 52b50924 files · +1993 −0Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/pkt_sched.h+114−0
@@ -955,4 +955,118 @@ enum { · 954 unmodified lines
955 955
956#define TCA_ETF_MAX (__TCA_ETF_MAX - 1)956#define TCA_ETF_MAX (__TCA_ETF_MAX - 1)
957 957
958
959/* CAKE */
960enum {
961 TCA_CAKE_UNSPEC,
962 TCA_CAKE_PAD,
963 TCA_CAKE_BASE_RATE64,
964 TCA_CAKE_DIFFSERV_MODE,
965 TCA_CAKE_ATM,
966 TCA_CAKE_FLOW_MODE,
967 TCA_CAKE_OVERHEAD,
968 TCA_CAKE_RTT,
969 TCA_CAKE_TARGET,
970 TCA_CAKE_AUTORATE,
971 TCA_CAKE_MEMORY,
972 TCA_CAKE_NAT,
973 TCA_CAKE_RAW,
974 TCA_CAKE_WASH,
975 TCA_CAKE_MPU,
976 TCA_CAKE_INGRESS,
977 TCA_CAKE_ACK_FILTER,
978 TCA_CAKE_SPLIT_GSO,
979 __TCA_CAKE_MAX
980};
981#define TCA_CAKE_MAX (__TCA_CAKE_MAX - 1)
982
983enum {
984 __TCA_CAKE_STATS_INVALID,
985 TCA_CAKE_STATS_PAD,
986 TCA_CAKE_STATS_CAPACITY_ESTIMATE64,
987 TCA_CAKE_STATS_MEMORY_LIMIT,
988 TCA_CAKE_STATS_MEMORY_USED,
989 TCA_CAKE_STATS_AVG_NETOFF,
990 TCA_CAKE_STATS_MIN_NETLEN,
991 TCA_CAKE_STATS_MAX_NETLEN,
992 TCA_CAKE_STATS_MIN_ADJLEN,
993 TCA_CAKE_STATS_MAX_ADJLEN,
994 TCA_CAKE_STATS_TIN_STATS,
995 TCA_CAKE_STATS_DEFICIT,
996 TCA_CAKE_STATS_COBALT_COUNT,
997 TCA_CAKE_STATS_DROPPING,
998 TCA_CAKE_STATS_DROP_NEXT_US,
999 TCA_CAKE_STATS_P_DROP,
1000 TCA_CAKE_STATS_BLUE_TIMER_US,
1001 __TCA_CAKE_STATS_MAX
1002};
1003#define TCA_CAKE_STATS_MAX (__TCA_CAKE_STATS_MAX - 1)
1004
1005enum {
1006 __TCA_CAKE_TIN_STATS_INVALID,
1007 TCA_CAKE_TIN_STATS_PAD,
1008 TCA_CAKE_TIN_STATS_SENT_PACKETS,
1009 TCA_CAKE_TIN_STATS_SENT_BYTES64,
1010 TCA_CAKE_TIN_STATS_DROPPED_PACKETS,
1011 TCA_CAKE_TIN_STATS_DROPPED_BYTES64,
1012 TCA_CAKE_TIN_STATS_ACKS_DROPPED_PACKETS,
1013 TCA_CAKE_TIN_STATS_ACKS_DROPPED_BYTES64,
1014 TCA_CAKE_TIN_STATS_ECN_MARKED_PACKETS,
1015 TCA_CAKE_TIN_STATS_ECN_MARKED_BYTES64,
1016 TCA_CAKE_TIN_STATS_BACKLOG_PACKETS,
1017 TCA_CAKE_TIN_STATS_BACKLOG_BYTES,
1018 TCA_CAKE_TIN_STATS_THRESHOLD_RATE64,
1019 TCA_CAKE_TIN_STATS_TARGET_US,
1020 TCA_CAKE_TIN_STATS_INTERVAL_US,
1021 TCA_CAKE_TIN_STATS_WAY_INDIRECT_HITS,
1022 TCA_CAKE_TIN_STATS_WAY_MISSES,
1023 TCA_CAKE_TIN_STATS_WAY_COLLISIONS,
1024 TCA_CAKE_TIN_STATS_PEAK_DELAY_US,
1025 TCA_CAKE_TIN_STATS_AVG_DELAY_US,
1026 TCA_CAKE_TIN_STATS_BASE_DELAY_US,
1027 TCA_CAKE_TIN_STATS_SPARSE_FLOWS,
1028 TCA_CAKE_TIN_STATS_BULK_FLOWS,
1029 TCA_CAKE_TIN_STATS_UNRESPONSIVE_FLOWS,
1030 TCA_CAKE_TIN_STATS_MAX_SKBLEN,
1031 TCA_CAKE_TIN_STATS_FLOW_QUANTUM,
1032 __TCA_CAKE_TIN_STATS_MAX
1033};
1034#define TCA_CAKE_TIN_STATS_MAX (__TCA_CAKE_TIN_STATS_MAX - 1)
1035#define TC_CAKE_MAX_TINS (8)
1036
1037enum {
1038 CAKE_FLOW_NONE = 0,
1039 CAKE_FLOW_SRC_IP,
1040 CAKE_FLOW_DST_IP,
1041 CAKE_FLOW_HOSTS, /* = CAKE_FLOW_SRC_IP | CAKE_FLOW_DST_IP */
1042 CAKE_FLOW_FLOWS,
1043 CAKE_FLOW_DUAL_SRC, /* = CAKE_FLOW_SRC_IP | CAKE_FLOW_FLOWS */
1044 CAKE_FLOW_DUAL_DST, /* = CAKE_FLOW_DST_IP | CAKE_FLOW_FLOWS */
1045 CAKE_FLOW_TRIPLE, /* = CAKE_FLOW_HOSTS | CAKE_FLOW_FLOWS */
1046 CAKE_FLOW_MAX,
1047};
1048
1049enum {
1050 CAKE_DIFFSERV_DIFFSERV3 = 0,
1051 CAKE_DIFFSERV_DIFFSERV4,
1052 CAKE_DIFFSERV_DIFFSERV8,
1053 CAKE_DIFFSERV_BESTEFFORT,
1054 CAKE_DIFFSERV_PRECEDENCE,
1055 CAKE_DIFFSERV_MAX
1056};
1057
1058enum {
1059 CAKE_ACK_NONE = 0,
1060 CAKE_ACK_FILTER,
1061 CAKE_ACK_AGGRESSIVE,
1062 CAKE_ACK_MAX
1063};
1064
1065enum {
1066 CAKE_ATM_NONE = 0,
1067 CAKE_ATM_ATM,
1068 CAKE_ATM_PTM,
1069 CAKE_ATM_MAX
1070};
1071
958#endif1072#endif