@@ -84,9 +84,35 @@ client only 1 Gbit/s or Wi-Fi. Similarly, a 1 Gbps host may be too fast for a
8484client having only a 100 Mbps interface.
8585
8686As a workaround the transmission speed of the host NIC can be reduced: 1 Gbps
87- instead of 2.5 or 100 Mbps instead of 1 Gbps. ( A technically more advanced
87+ instead of 2.5 or 100 Mbps instead of 1 Gbps. A technically more advanced
8888solution would be to configure traffic shaping rules at the OS-level, so that
89- only Sunshine's traffic is slowed down.)
89+ only Sunshine's traffic is slowed down.
90+
91+ Such a solution on Linux could look like that:
92+
93+ ``` bash
94+ # 1) Remove existing qdisc (pfifo_fast)
95+ sudo tc qdisc del dev < NIC> root
96+
97+ # 2) Add HTB root qdisc with default class 1:1
98+ sudo tc qdisc add dev < NIC> root handle 1: htb default 1
99+
100+ # 3) Create class 1:1 for full 10 Gbit/s (all other traffic)
101+ sudo tc class add dev < NIC> parent 1: classid 1:1 htb \
102+ rate 10000mbit ceil 10000mbit burst 32k
103+
104+ # 4) Create class 1:10 for Sunshine game stream at 1 Gbit/s
105+ sudo tc class add dev < NIC> parent 1: classid 1:10 htb \
106+ rate 1000mbit ceil 1000mbit burst 32k
107+
108+ # 5) Filter UDP source port 47998 into class 1:10
109+ sudo tc filter add dev < NIC> protocol ip parent 1: prio 1 \
110+ u32 match ip protocol 17 0xff \
111+ match ip sport 47998 0xffff flowid 1:10
112+ ```
113+
114+ In that way only the Sunshine traffic is limited by 1 Gbit. This is not persistent on reboots.
115+ If you use a different port for the game stream you need to adjust the last command.
90116
91117Sunshine versions > 0.23.1 include improved networking code that should
92118alleviate or even solve this issue (without reducing the NIC speed).
0 commit comments