Diff for /wikisrc/tutorials/altqd_traffic_shaping_example.mdwn between versions 1.3 and 1.4

version 1.3, 2019/04/09 09:53:27 version 1.4, 2019/04/09 09:56:37
Line 25  You'll need to create an empty `/etc/alt Line 25  You'll need to create an empty `/etc/alt
   
 #   Now configure it   #   Now configure it 
   
 You now want to setup your altqd classes and filters. The class tells altqd what kind of traffic shaping you want to do. There are about five different types and they all have their uses for various situations. In my case I knew that SIP traffic was all UDP, and since people are mostly too stupid these days to use FTP or other non-web services that also use UDP (after all "the web == internet" right?), I didn't bother with any kind of complex filters. I would notice that SIP audio quality would fall anytime people were really cranking on web pages and downloading stuff. So here is what I used in my `/etc/altqd.conf`  You now want to setup your `altqd` classes and filters. The class tells `altqd` what kind of traffic shaping you want to do. There are about five different types and they all have their uses for various situations. In my case I knew that SIP traffic was all UDP, and since people are mostly too stupid these days to use FTP or other non-web services that also use UDP (after all "the web == internet" right?), I didn't bother with any kind of complex filters. I would notice that SIP audio quality would fall anytime people were really cranking on web pages and downloading stuff. So here is what I used in my `/etc/altqd.conf`
   
       
   
Line 62  This line says that we intend on using a Line 62  This line says that we intend on using a
   
 This line says that we want to create a new parent-class for ALTQ. The parent class tells ALTQ what kind of shaping we'll be doing. In this case it's `priq` which is shorthand for priority queuing. This algorithm makes sure that network buffers with my chosen type of traffic will be separated out by using filters, and the ones with higher priorities will be emptied first. Moving on we see that the class applies to the interface `bge0` which is good since we just defined that above. Next is a simple user-defined label for this class. I chose the string `high_class` so it would be clear. You can call it anything you want. I could have chose `voip_class` or `udp_traffic`. It doesn't matter. You'll notice the next item is `NULL`. That's because this class _is_ a parent class and thus it has no parent class of it's own. The man-page was helpful enough to tell me what to use there. The last two items `priority 2` are pretty clear. I'm simply telling this class what priority it is. The higher the value, the more priority it has. In most cases I believe you can assign an integer value of 0-15 with 15 being the highest priority.   This line says that we want to create a new parent-class for ALTQ. The parent class tells ALTQ what kind of shaping we'll be doing. In this case it's `priq` which is shorthand for priority queuing. This algorithm makes sure that network buffers with my chosen type of traffic will be separated out by using filters, and the ones with higher priorities will be emptied first. Moving on we see that the class applies to the interface `bge0` which is good since we just defined that above. Next is a simple user-defined label for this class. I chose the string `high_class` so it would be clear. You can call it anything you want. I could have chose `voip_class` or `udp_traffic`. It doesn't matter. You'll notice the next item is `NULL`. That's because this class _is_ a parent class and thus it has no parent class of it's own. The man-page was helpful enough to tell me what to use there. The last two items `priority 2` are pretty clear. I'm simply telling this class what priority it is. The higher the value, the more priority it has. In most cases I believe you can assign an integer value of 0-15 with 15 being the highest priority. 
   
 Now, we need a way to add certain types of traffic into this class. We'll use the altq filter syntax to do this. That's where the next line comes in   Now, we need a way to add certain types of traffic into this class. We'll use the `altq` filter syntax to do this. That's where the next line comes in 
           
     filter bge0 high_class 0 0 0 0 17      filter bge0 high_class 0 0 0 0 17
           
   
 The first three items should be clear enough. We are writing a filter for interface bge0 and we want traffic that matches the filter to fall under the pervue of the `high_class` class. The integers that follow are the part were I wish the author would have been just a tad more IP-Filterish or PF-like. Here is the template for those from the [[!template id="man" name="altq.c  The first three items should be clear enough. We are writing a filter for interface bge0 and we want traffic that matches the filter to fall under the pervue of the `high_class` class. The integers that follow are the part were I wish the author would have been just a tad more IP-Filterish or PF-like. Here is the template for those from the [[!template id="man" name="altq.conf" section="5"]] man page:
 onf" section="5"]] man page:   
           
     dst_addr [netmask mask] dport src_addr [netmask mask] sport proto [tos value [tosmask value]] [gpi value      dst_addr [netmask mask] dport src_addr [netmask mask] sport proto [tos value [tosmask value]] [gpi value
           

Removed from v.1.3  
changed lines
  Added in v.1.4


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb