Control Internet Bandwidth with tc on Raspberry Pi 3?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0















Chart of Network Hierarchy



Modem/Router is connected to Internet (192.168.1.1)



No DHCP server is running on Modem/Router



Devices connect to the network through Wifi provided by Modem/Router



Devices receive DHCP settings from RPi (DHCP and DNS server) pointing to RPi as gateway (192.168.1.5)



Using IPv4 forwarding and SNAT devices can use the RPi internet connection (SNAT 192.168.1.0/24 to 192.168.1.5)



The problem



 • I want to control traffic to split an DOWN/UP link
with speed 5Mbps/1Mbps and 100GB/ Month quota

• The idea is to not allow a single user to saturate
the link and give priority to PCs for online games

• The quota is mostly used by Youtube buffering at highest quality,
so I need to put speed limit for each user to prevent Youtube
from automatically buffering high quality

• The speed limits are generally there to control the quota I have


What I am looking for



 • Each user gets a certain amount of traffic 1Mbps with a ceiling of 1.5Mbps

• Devices of each user split the traffic between each other as follows

o PC gets by Max 1Mbps with higher priority

o Phone gets Max 1Mbps with lower priority

• PCs usually play online games (mostly League of Legends)
so I need the lowest possible latency for PCs


I made a simple script using tc and the htb qdisc but I notice lag spikes during gaming



The tc script is here



Looking for better Solutions










share|improve this question


























    0















    Chart of Network Hierarchy



    Modem/Router is connected to Internet (192.168.1.1)



    No DHCP server is running on Modem/Router



    Devices connect to the network through Wifi provided by Modem/Router



    Devices receive DHCP settings from RPi (DHCP and DNS server) pointing to RPi as gateway (192.168.1.5)



    Using IPv4 forwarding and SNAT devices can use the RPi internet connection (SNAT 192.168.1.0/24 to 192.168.1.5)



    The problem



     • I want to control traffic to split an DOWN/UP link
    with speed 5Mbps/1Mbps and 100GB/ Month quota

    • The idea is to not allow a single user to saturate
    the link and give priority to PCs for online games

    • The quota is mostly used by Youtube buffering at highest quality,
    so I need to put speed limit for each user to prevent Youtube
    from automatically buffering high quality

    • The speed limits are generally there to control the quota I have


    What I am looking for



     • Each user gets a certain amount of traffic 1Mbps with a ceiling of 1.5Mbps

    • Devices of each user split the traffic between each other as follows

    o PC gets by Max 1Mbps with higher priority

    o Phone gets Max 1Mbps with lower priority

    • PCs usually play online games (mostly League of Legends)
    so I need the lowest possible latency for PCs


    I made a simple script using tc and the htb qdisc but I notice lag spikes during gaming



    The tc script is here



    Looking for better Solutions










    share|improve this question
























      0












      0








      0








      Chart of Network Hierarchy



      Modem/Router is connected to Internet (192.168.1.1)



      No DHCP server is running on Modem/Router



      Devices connect to the network through Wifi provided by Modem/Router



      Devices receive DHCP settings from RPi (DHCP and DNS server) pointing to RPi as gateway (192.168.1.5)



      Using IPv4 forwarding and SNAT devices can use the RPi internet connection (SNAT 192.168.1.0/24 to 192.168.1.5)



      The problem



       • I want to control traffic to split an DOWN/UP link
      with speed 5Mbps/1Mbps and 100GB/ Month quota

      • The idea is to not allow a single user to saturate
      the link and give priority to PCs for online games

      • The quota is mostly used by Youtube buffering at highest quality,
      so I need to put speed limit for each user to prevent Youtube
      from automatically buffering high quality

      • The speed limits are generally there to control the quota I have


      What I am looking for



       • Each user gets a certain amount of traffic 1Mbps with a ceiling of 1.5Mbps

      • Devices of each user split the traffic between each other as follows

      o PC gets by Max 1Mbps with higher priority

      o Phone gets Max 1Mbps with lower priority

      • PCs usually play online games (mostly League of Legends)
      so I need the lowest possible latency for PCs


      I made a simple script using tc and the htb qdisc but I notice lag spikes during gaming



      The tc script is here



      Looking for better Solutions










      share|improve this question














      Chart of Network Hierarchy



      Modem/Router is connected to Internet (192.168.1.1)



      No DHCP server is running on Modem/Router



      Devices connect to the network through Wifi provided by Modem/Router



      Devices receive DHCP settings from RPi (DHCP and DNS server) pointing to RPi as gateway (192.168.1.5)



      Using IPv4 forwarding and SNAT devices can use the RPi internet connection (SNAT 192.168.1.0/24 to 192.168.1.5)



      The problem



       • I want to control traffic to split an DOWN/UP link
      with speed 5Mbps/1Mbps and 100GB/ Month quota

      • The idea is to not allow a single user to saturate
      the link and give priority to PCs for online games

      • The quota is mostly used by Youtube buffering at highest quality,
      so I need to put speed limit for each user to prevent Youtube
      from automatically buffering high quality

      • The speed limits are generally there to control the quota I have


      What I am looking for



       • Each user gets a certain amount of traffic 1Mbps with a ceiling of 1.5Mbps

      • Devices of each user split the traffic between each other as follows

      o PC gets by Max 1Mbps with higher priority

      o Phone gets Max 1Mbps with lower priority

      • PCs usually play online games (mostly League of Legends)
      so I need the lowest possible latency for PCs


      I made a simple script using tc and the htb qdisc but I notice lag spikes during gaming



      The tc script is here



      Looking for better Solutions







      raspberry-pi bandwidth tc quota latency






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 5 at 13:17









      Scorpion_IbmScorpion_Ibm

      12




      12




















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f498796%2fcontrol-internet-bandwidth-with-tc-on-raspberry-pi-3%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f498796%2fcontrol-internet-bandwidth-with-tc-on-raspberry-pi-3%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown






          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)