{"id":7,"date":"2025-03-15T21:59:37","date_gmt":"2025-03-15T13:59:37","guid":{"rendered":"https:\/\/archon.net.ph\/blog\/?p=7"},"modified":"2025-03-15T21:59:37","modified_gmt":"2025-03-15T13:59:37","slug":"evaluating-per-asn-traffic-as-stats","status":"publish","type":"post","link":"https:\/\/archon.net.ph\/blog\/2025\/03\/15\/evaluating-per-asn-traffic-as-stats\/","title":{"rendered":"First Post: (Actually) Evaluating Per-ASN Traffic"},"content":{"rendered":"\n<p>As part of our effort to make management more efficient, we&#8217;ve been working on meaningfully monitoring what&#8217;s going on with our infrastructure.<\/p>\n\n\n\n<p>Key word: <em>meaningful<\/em>. It&#8217;s one thing to <em>just keep logs of everything<\/em>. It&#8217;s another to make actionable insights.<\/p>\n\n\n\n<p>And what&#8217;s more actionable than knowing what our clients need? As an Internet Service Provider, a core part of this is <em>traffic<\/em>.<\/p>\n\n\n\n<p>To study what upstreams we need to optimize, we need to monitor where our traffic comes from and where it goes.<\/p>\n\n\n\n<p>There are several tools out there such as <code>pmacct<\/code>, <code>pNRG<\/code>, FastNetMon, SolarWinds, <code>as-stats<\/code> &#8212; but after evaluating options, we chose <code>as-stats<\/code>.<\/p>\n\n\n\n<p>Primarily because it&#8217;s <strong>free<\/strong>.<\/p>\n\n\n\n<p>It&#8217;s also self-contained &#8211; just one component to deal with (<code>as-stats<\/code>) rather than linking multiple tools together (Grafana + InfluxDB + pmacct for instance)<\/p>\n\n\n\n<p>Finally, it&#8217;s PHP-based. Our infrastructure is already mostly centered on Debian and PHP, so <code>as-stats<\/code> was right at home and in line with our technical competencies.<\/p>\n\n\n\n<p>Oh, and APNIC has an existing blog post on the matter <a href=\"https:\/\/blog.apnic.net\/2017\/01\/26\/traffic-analysis-better-peering\/\" data-type=\"link\" data-id=\"https:\/\/blog.apnic.net\/2017\/01\/26\/traffic-analysis-better-peering\/\">here<\/a>. However, it&#8217;s outdated and lacks a lot of steps that took us several hours to deal with.<\/p>\n\n\n\n<p>Without further ado,<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-x-large-font-size\">Getting started with AS-Stats<br>(on a modern system)<\/h2>\n\n\n\n<p>In order to make sure what I&#8217;m writing here actually works, I&#8217;m setting up as-stats <em>again<\/em> and documenting what I do in this post. I&#8217;m setting up a new VM in Proxmox &#8212; I&#8217;m going with<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a Virtual Machine (I have not done this in a container, YMMV)<\/li>\n\n\n\n<li>These settings, as they&#8217;re our standard for VMs:\n<ul class=\"wp-block-list\">\n<li>Ubuntu 24.04.2 LTS from a Live Server ISO<\/li>\n\n\n\n<li>q35 machine type (under System -&gt; Machine)<\/li>\n\n\n\n<li>Large SCSI disk with SSD emulation and Discard enabled<\/li>\n\n\n\n<li>&#8220;Host&#8221; CPU type<\/li>\n\n\n\n<li>And a network interface in the same LAN as our NetFlow source, for ease of setup.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large has-custom-border\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"535\" src=\"https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-1024x535.png\" alt=\"\" class=\"has-border-color has-accent-6-border-color wp-image-10\" srcset=\"https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-1024x535.png 1024w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-300x157.png 300w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-768x401.png 768w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-1536x802.png 1536w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image.png 1626w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">We&#8217;re doing it <strong>from scratch.<\/strong><\/figcaption><\/figure>\n\n\n\n<p>Setting up a VM and installing an OS is out of this article&#8217;s scope.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-x-large-font-size\">Installing Dependencies<\/h3>\n\n\n\n<p>Usual update right after system install.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get update\nsudo apt-get upgrade<\/code><\/pre>\n\n\n\n<p>I&#8217;m trying to go with the latest versions available in apt repositories. This means no PHP 8.4 as of writing.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install librrds-perl librrd-dev rrdtool apache2 php8.3 make gcc git libapache2-mod-php8.3\n\n\n# Required by Perl's Net:Patricia during compilation\nsudo apt install libnsl-dev \n\n\n# Required by as-stats-gui\nsudo apt install php8.3-sqlite3\n\n\n# For debugging\nsudo apt install net-tools<\/code><\/pre>\n\n\n\n<p>Onto the Perl modules required by <code>as-stats<\/code>.<\/p>\n\n\n\n<p>During the first module install, I got asked if I wanted to configure as much as possible automatically. I simply said yes.<\/p>\n\n\n\n<p>I think this is because I&#8217;m using <code>cpan<\/code> for the first time?<\/p>\n\n\n\n<p>Further, some of the modules take <em>a while<\/em> to set up due to compilation and such. I think it would be wise to run these commands individually.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo cpan install File::Find::Rule\nsudo cpan install Net::sFlow     # Long install\nsudo cpan install IO::Select\nsudo cpan install IO::Socket     # Installed quickly\nsudo cpan install Scalar::Util\n\n\n# Not in APNIC guide, required by asstatd.pl\nsudo cpan install JSON::XS \nsudo cpan install Net::Patricia\n\n\n# Not in APNIC guide, required by rrd-extractstats.pl\nsudo cpan install DBI          # Installed in ~2 min\nsudo cpan install TryCatch     # 26m 10.260s\nsudo cpan install DBD::SQLite  # I stopped counting<\/code><\/pre>\n\n\n\n<p>There is a Perl module, <code>ip2as<\/code>, that needs to be installed manually.<\/p>\n\n\n\n<p>First, I checked which version of Perl I had installed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>perl -v\n\nThis is perl 5, version 38, subversion 2 (v5.38.2) built for x86_64-linux-gnu-thread-multi\n(with 44 registered patches, see perl -V for more detail)<\/code><\/pre>\n\n\n\n<p>Thanks. Now I went into what I assume is Perl&#8217;s plugin directory. I then downloaded <a href=\"https:\/\/github.com\/JackSlateur\/perl-ip2as\"><code>ip2as<\/code> by JackSlateur on Github<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Required by asstatd.pl\n\n# Install ip2as module\ncd \/usr\/share\/perl\/5.38.2\nsudo wget https:\/\/raw.githubusercontent.com\/JackSlateur\/perl-ip2as\/master\/ip2as.pm\n\n# Get the current IP-ASN mapping. RRD files are not generated without this.\nsudo wget -O \/opt\/AS-Stats\/bin\/ip.json https:\/\/asndb.network\/get\/latest\/ip.json<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-x-large-font-size\">Setting up as-stats<\/h3>\n\n\n\n<p>As per the APNIC guide, I went ahead and placed as-stats in <code>\/opt<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/opt\/\nsudo git clone https:\/\/github.com\/manuelkasper\/AS-Stats.git\ncd \/opt\/AS-Stats\n\n\n# Also create the directory for RRD storage\nsudo mkdir \/opt\/AS-Stats\/rrd\nsudo chmod 0777 \/opt\/AS-Stats\/rrd<\/code><\/pre>\n\n\n\n<p>I then modified the <code>knownlinks<\/code> file to reflect my current setup.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># nano, or your choice of text editor (vi?)\nsudo nano \/opt\/AS-Stats\/conf\/knownlinks<\/code><\/pre>\n\n\n\n<p>I commented out all the <code>192.0<\/code> examples and put in the interface I was looking to monitor.<\/p>\n\n\n\n<p><em>Now, here&#8217;s the thing with <code>knownlinks<\/code>:<\/em><\/p>\n\n\n\n<p>The entries need to be delimited by <strong>tabs, not spaces<\/strong>. Take care when you copy your config from somewhere else.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For example, if you highlight text in <code>putty<\/code>, tabs may be copied as multiple spaces.<\/li>\n\n\n\n<li><code>as-stats<\/code> <em>will<\/em> throw an error if this is incorrect. It happened in my case. A quick way to check is by pasting your config into Notepad++ and showing all characters\n<ul class=\"wp-block-list\">\n<li>View -&gt; Show Symbol -&gt; Show All Characters<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full has-custom-border\"><img loading=\"lazy\" decoding=\"async\" width=\"616\" height=\"85\" src=\"https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-1.png\" alt=\"\" class=\"has-border-color has-accent-6-border-color wp-image-15\" srcset=\"https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-1.png 616w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-1-300x41.png 300w\" sizes=\"auto, (max-width: 616px) 100vw, 616px\" \/><figcaption class=\"wp-element-caption\">After &#8220;17&#8221;, what seemed like a tab was actually a space.<\/figcaption><\/figure>\n\n\n\n<p><code>ifindex<\/code> is in <strong>decimal<\/strong>, and must reflect IDs as if collecting data via SNMP. In MikroTik, this ID can be acquired via the command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/interface\/print show-ids\n\n\n# Expected output:\n\n&#91;admin@Border-PHLGES] &gt; \/interface\/print show-ids \nFlags: R - RUNNING\nColumns: NAME, TYPE, ACTUAL-MTU\n*     NAME                  TYPE      ACTUAL-MTU\n*6    ether1                ether           1500\n*7    ether2                ether           1500\n*8    ether3                ether           1500\n*9    ether4                ether           1500\n*A    ether5                ether           1500\n*B    ether6                ether           1500\n*C    ether7                ether           1500\n*D    ether8                ether           1500\n*E    ether9                ether           1500\n*F    ether10               ether           1500\n*10   ether11               ether           1500\n*11 R ether12               ether           1500\n*1    ether13               ether           1500\n*2  R sfp-sfpplus1          ether           1500\n*3    sfp-sfpplus2          ether           1500\n*4  R sfp-sfpplus3          ether           1500\n*5    sfp-sfpplus4          ether           1500\n*15 R lo                    loopback       65536\n\n\n# Irrelevant details removed (e.g., MAC address)<\/code><\/pre>\n\n\n\n<p>On the leftmost column is the interface ID (thanks to <code>show-ids<\/code>) <strong>in hexadecimal<\/strong>.<\/p>\n\n\n\n<p>I will be monitoring ether12 and sfp-sfpplus1.<\/p>\n\n\n\n<p>After converting to decimal, I will use <code>ifindex<\/code> 17 and 2 respectively in my <code>knownlinks<\/code> file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Router IP, ifindex, tag, description, graph color, sampling rate\n\n198.51.100.1\t17\ttrans1\tTransit 1\tA6CEE3\t1\n198.51.100.1\t2\ttrans2\tTransit 2\tFB9A99\t1<\/code><\/pre>\n\n\n\n<p>As for the router IP, specify your router&#8217;s public IP address. However during testing, I did not find this too important so long as<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It&#8217;s assigned to an interface<\/li>\n\n\n\n<li>It matches NetFlow&#8217;s source address.<\/li>\n<\/ul>\n\n\n\n<p>It&#8217;s good to verify that we&#8217;re actually receiving NetFlow data. I used <code>tcpdump<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># You may need to change the interface \"-i\"\nsudo tcpdump -i enp6s18 -nn port 9000\n\n\n# Expected output:\n$ sudo tcpdump -i enp6s18 -nn port 9000\n\ntcpdump: verbose output suppressed, use -v&#91;v]... for full protocol decode\nlistening on enp6s18, link-type EN10MB (Ethernet), snapshot length 262144 bytes\n15:32:39.929515 IP 198.51.100.1.9000 &gt; 10.0.0.251.9000: UDP, length 236\n15:32:39.929756 IP 198.51.100.1.9000 &gt; 10.0.0.251.9000: UDP, length 1436\n15:32:39.929756 IP 198.51.100.1.9000 &gt; 10.0.0.251.9000: UDP, length 1436\n15:32:39.929756 IP 198.51.100.1.9000 &gt; 10.0.0.251.9000: UDP, length 1436\n15:32:39.929756 IP 198.51.100.1.9000 &gt; 10.0.0.251.9000: UDP, length 1436<\/code><\/pre>\n\n\n\n<p>We&#8217;re receiving packets. Great! We should be ready to test <code>as-stats<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/AS-Stats\/bin\/asstatd.pl -P 0 -p 9000 -r \/opt\/AS-Stats\/rrd -k \/opt\/AS-Stats\/conf\/knownlinks -m \/opt\/AS-Stats\/bin\/ip.json<\/code><\/pre>\n\n\n\n<p>This command holds the terminal until exit with <code>Ctrl+C<\/code>.<\/p>\n\n\n\n<p>At this point, I opened a new terminal and did checks.<\/p>\n\n\n\n<p>First, I checked if Perl is listening with <code>netstat<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo netstat -tulpn\n\nActive Internet connections (only servers)\nProto Recv-Q Send-Q Local Address           Foreign Address         State       PID\/Program name\ntcp        0      0 127.0.0.54:53           0.0.0.0:*               LISTEN      7160\/systemd-resolv\ntcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      7160\/systemd-resolv\ntcp6       0      0 :::22                   :::*                    LISTEN      1\/systemd\ntcp6       0      0 :::80                   :::*                    LISTEN      20724\/apache2\nudp        0      0 127.0.0.54:53           0.0.0.0:*                           7160\/systemd-resolv\nudp        0      0 127.0.0.53:53           0.0.0.0:*                           7160\/systemd-resolv\nudp        0      0 10.0.0.251:68           0.0.0.0:*                           6346\/systemd-networ\nudp        0      0 0.0.0.0:9000            0.0.0.0:*                           27450\/perl<\/code><\/pre>\n\n\n\n<p>We see that Perl is listening on port 9000. It should be running!<\/p>\n\n\n\n<p>Now, we kept checking <code>\/opt\/AS-Stats\/rrd<\/code>. After a minute or so, it filled up with data.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"957\" height=\"305\" src=\"https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-3.png\" alt=\"\" class=\"wp-image-17\" srcset=\"https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-3.png 957w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-3-300x96.png 300w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-3-768x245.png 768w\" sizes=\"auto, (max-width: 957px) 100vw, 957px\" \/><figcaption class=\"wp-element-caption\">I kept checking every 30 seconds or so.<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading has-x-large-font-size\">Data Processing and Visualization<\/h3>\n\n\n\n<h4 class=\"wp-block-heading has-large-font-size\">Processing the RRDs<\/h4>\n\n\n\n<p>This command processes the RRD files into something that can be graphed by the GUI.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo \/opt\/AS-Stats\/bin\/rrd-extractstats.pl \/opt\/AS-Stats\/rrd \/opt\/AS-Stats\/conf\/knownlinks \/opt\/AS-Stats\/asstats_day<\/code><\/pre>\n\n\n\n<p>Running this manually gave the initial <code>asstats_day<\/code> file, which is important for the GUI later on.<\/p>\n\n\n\n<p>APNIC suggests running this every hour, however I opted for every 10 minutes. I placed the schedule on the <strong>root<\/strong> crontab.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo crontab -e\n\n\n# Then I placed the schedule every 10 minutes\n#           *\/10 * * * * &#91;command]\n\n\n*\/10 * * * * \/opt\/AS-Stats\/bin\/rrd-extractstats.pl \/opt\/AS-Stats\/rrd \/opt\/AS-Stats\/conf\/knownlinks \/opt\/AS-Stats\/asstats_day<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading has-large-font-size\">Installing the Web GUI<\/h4>\n\n\n\n<p>I kept things as barebones as possible as this is really an internal tool. Simply put, I cloned <a href=\"https:\/\/github.com\/nidebr\/as-stats-gui\">nidebr\/as-stats-gui<\/a> into Apache&#8217;s root (located in <code>\/var\/www\/html<\/code>).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\/html\/\n\n\nsudo git clone https:\/\/github.com\/nidebr\/as-stats-gui\n\n\n# To be safe\nsudo rm -rf as-stats-gui\/.git  \n\n\nsudo chown -R www-data:www-data as-stats-gui\/<\/code><\/pre>\n\n\n\n<p>I then edited <code>as-stats-gui\/config.inc<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># The important ones to edit are\n\n# $rrdpath - Per ASN graphs are generated from here (weekly, monthly, etc.), I think\n\n# $daystatsfile - Breaks the general 24 hour \"home\" page (but per-ASN view still works)\n\n# $knownlinksfile - Everything breaks without this\n\n\n$rrdpath = \"\/opt\/AS-Stats\/rrd\";\n$daystatsfile = \"\/opt\/AS-Stats\/asstats_day\";\n$knownlinksfile = \"\/opt\/AS-Stats\/conf\/knownlinks\";<\/code><\/pre>\n\n\n\n<p>And that&#8217;s it, really.<\/p>\n\n\n\n<p>Accessing the IP address, plus the <code>as-stats-gui<\/code> path, gave pretty graphs. Now it <em>took a while<\/em> to have any data since this is a 24 hour view by default.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;your-ip-here\/as-stats-gui\/<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"811\" src=\"https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-4-1024x811.png\" alt=\"\" class=\"wp-image-19\" srcset=\"https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-4-1024x811.png 1024w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-4-300x237.png 300w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-4-768x608.png 768w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-4-1536x1216.png 1536w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-4.png 1698w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Clicking on one of the graphs opens up that ASN&#8217;s other timeframes (weekly, monthly, and yearly).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"784\" src=\"https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-5-1024x784.png\" alt=\"\" class=\"wp-image-20\" srcset=\"https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-5-1024x784.png 1024w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-5-300x230.png 300w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-5-768x588.png 768w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-5-1536x1175.png 1536w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-5.png 1700w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading has-x-large-font-size\">Setting up for headless mode<\/h3>\n\n\n\n<p>Running <code>asstatd.pl<\/code> in an always-open SSH console may prove to be inconvenient. For starters, the instance will die if the console is disconnected.<\/p>\n\n\n\n<p>Therefore I set it up as a service.<\/p>\n\n\n\n<p>I created a new file <code>\/etc\/systemd\/system\/as-stats.service<\/code> and placed our command earlier as a service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Unit]\nDescription=AS-Status Collector\nAfter=network.target\nStartLimitIntervalSec=0\n&#91;Service]\nType=simple\nRestart=always\nRestartSec=1\nUser=root\nExecStart=\/usr\/bin\/perl \/opt\/AS-Stats\/bin\/asstatd.pl -P 0 -p 9000 -r \/opt\/AS-Stats\/rrd -k \/opt\/AS-Stats\/conf\/knownlinks -m \/opt\/AS-Stats\/bin\/ip.json\n\n&#91;Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<p>I then started the service<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo service as-stats start<\/code><\/pre>\n\n\n\n<p>And set it up to run on boot<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable as-stats<\/code><\/pre>\n\n\n\n<p>Then I checked that it&#8217;s actually running<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl --no-pager status as-stats\n\n\n# Expected output:\nalohaspark@as-stats-blog:~$ sudo systemctl --no-pager status as-stats\n\u25cf as-stats.service - AS-Status Collector\n     Loaded: loaded (\/etc\/systemd\/system\/as-stats.service; <strong>enabled;<\/strong> preset: enabled)\n     Active: active (running) since Sat 2025-03-15 03:07:11 UTC; 4min 18s ago\n   Main PID: 164524 (perl)\n      Tasks: 1 (limit: 4609)\n     Memory: 470.8M (peak: 701.8M)\n        CPU: 1min 11.374s\n     CGroup: \/system.slice\/as-stats.service\n             \u2514\u2500164524 \/usr\/bin\/perl \/opt\/AS-Stats\/bin\/asstatd.pl -P 0 -p 9000 -r \/opt\/AS-Stats\/rrd -k \/opt\/AS-Stats\/conf\/knownlinks -m \/opt\/AS-Stats\/bin\/ip.\u2026\n\nMar 15 03:07:11 as-stats-blog systemd&#91;1]: Started as-stats.service - AS-Status Collector.\nalohaspark@as-stats-blog:~$<\/code><\/pre>\n\n\n\n<p>The &#8220;enabled&#8221;, in bold, signifies that this will run on boot. It would say &#8220;disabled&#8221; otherwise.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"728\" height=\"272\" src=\"https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-7.png\" alt=\"\" class=\"wp-image-43\" srcset=\"https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-7.png 728w, https:\/\/archon.net.ph\/blog\/wp-content\/uploads\/2025\/03\/image-7-300x112.png 300w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><figcaption class=\"wp-element-caption\">Disabled otherwise.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Summary and Conclusion<\/h2>\n\n\n\n<p>With <code>as-stats<\/code> now providing clear insights into our traffic flows, we are well positioned to optimize our upstreams, such as selecting a provider with a better path to our heaviest destinations.<\/p>\n\n\n\n<p>Or better, we can strategically decide where and who to <em>peer<\/em> with.<\/p>\n\n\n\n<p>As datacenter and transport costs continue to fall in the Philippines, it&#8217;s now practical to establish direct peering with content providers such as Facebook (Meta) and Google, significantly reducing transit costs by lowering usage.<\/p>\n\n\n\n<p>GLHF.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of our effort to make management more efficient, we&#8217;ve been working on meaningfully monitoring what&#8217;s going on with our infrastructure. Key word: meaningful. It&#8217;s one thing to just keep logs of everything. It&#8217;s another to make actionable insights. And what&#8217;s more actionable than knowing what our clients need? As an Internet Service Provider, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":45,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[9,12,10,11,13],"class_list":["post-7","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-network-monitoring","tag-as-stats","tag-measurement","tag-netflow","tag-peering","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/archon.net.ph\/blog\/wp-json\/wp\/v2\/posts\/7","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archon.net.ph\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archon.net.ph\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archon.net.ph\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/archon.net.ph\/blog\/wp-json\/wp\/v2\/comments?post=7"}],"version-history":[{"count":26,"href":"https:\/\/archon.net.ph\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions"}],"predecessor-version":[{"id":44,"href":"https:\/\/archon.net.ph\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions\/44"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/archon.net.ph\/blog\/wp-json\/wp\/v2\/media\/45"}],"wp:attachment":[{"href":"https:\/\/archon.net.ph\/blog\/wp-json\/wp\/v2\/media?parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archon.net.ph\/blog\/wp-json\/wp\/v2\/categories?post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archon.net.ph\/blog\/wp-json\/wp\/v2\/tags?post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}