Hello all and @Sukchan Lee acetcom@gmail.com,
I was thinking about one way to generate traffic accounting from the LTE users of the Open5GS.
I'm rearching something using the iptables (in Linux), in this link we can check a way to generate some traffic account in the linux: https://catonmat.net/traffic-accounting-with-iptables
I'm thinking about writing a code, where the PGW adds a new line in iptables with the IP/IPv6 address (TRAFFIC_ACCT_IN and TRAFFIC_ACCT_OUT) when a new session is added and remove the same line when the session is ended, with this the counter will restart, being able to use an external program to get this information about the traffic sent and received by a given user.
The bad from this idea is that this code only will work correctly in a Linux box.
Does anyone have any other suggestions?
Thanks
Romeu Medeiros
Freediameter should be able to provide accounting so long as the ENB supports it.
David Peterson Senior Engineer 855-947-7776 ext. 9214 c 419-706-7355 d 979-314-1305 https://www.ispsupplies.com/ https://www.ispsupplies.com https://facebook.com/ispsupplies https://twitter.com/ispsupplies https://www.linkedin.com/company/isp-supplies/
From: nextepc nextepc-bounces@lists.osmocom.org On Behalf Of Romeu Medeiros Sent: Tuesday, March 10, 2020 7:15 PM To: nextepc@lists.osmocom.org Subject: Fwd: Open5GS Traffic Accounting
Hello all and @Sukchan Lee mailto:acetcom@gmail.com ,
I was thinking about one way to generate traffic accounting from the LTE users of the Open5GS.
I'm rearching something using the iptables (in Linux), in this link we can check a way to generate some traffic account in the linux: https://catonmat.net/traffic-accounting-with-iptables https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fcatonmat.net%2ftraffic-accounting-with-iptables&c=E,1,ZKxJjlnvr8VrquW5xsLsd-4VFJTXkRqUpJMEXfM2Scd6cIgGCuhBauaqsmY5YZMdj99b315zy-6g83E2G2y8uCV6ixKelMseXuH94Vnai_vaevVOCijMbuor&typo=1
I'm thinking about writing a code, where the PGW adds a new line in iptables with the IP/IPv6 address (TRAFFIC_ACCT_IN and TRAFFIC_ACCT_OUT) when a new session is added and remove the same line when the session is ended, with this the counter will restart, being able to use an external program to get this information about the traffic sent and received by a given user.
The bad from this idea is that this code only will work correctly in a Linux box.
Does anyone have any other suggestions?
Thanks
Romeu Medeiros
Hi David,
On Tue, Mar 10, 2020 at 07:56:06PM -0400, david@ispsupplies.com wrote:
Freediameter should be able to provide accounting so long as the ENB supports it.
in which way is the eNB involved in traffic accounting in LTE?
Normally, AFAICT, accounting is implemented within the P-GW, potentially interacting via Radios/Diameter or some other protocol with some external entity that decides whether or not there is credit/budget remaining or not. If not, the PGW would stop firwarding packets of the related session/subscriber.
Sorry yeah I meant the EPC. I am not sure if the Open5GS software supports it but Freediameter would be the Accounting portion in AAA from what I can tell.
David Peterson Senior Engineer 855-947-7776 ext. 9214 c 419-706-7355 d 979-314-1305 https://www.ispsupplies.com
-----Original Message----- From: Harald Welte laforge@osmocom.org Sent: Wednesday, March 11, 2020 11:53 AM To: david@ispsupplies.com Cc: 'Romeu Medeiros' medeiros@medeiros.eng.br; nextepc@lists.osmocom.org Subject: Re: Open5GS Traffic Accounting
Hi David,
On Tue, Mar 10, 2020 at 07:56:06PM -0400, david@ispsupplies.com wrote:
Freediameter should be able to provide accounting so long as the ENB
supports it.
in which way is the eNB involved in traffic accounting in LTE?
Normally, AFAICT, accounting is implemented within the P-GW, potentially interacting via Radios/Diameter or some other protocol with some external entity that decides whether or not there is credit/budget remaining or not. If not, the PGW would stop firwarding packets of the related session/subscriber.
+1 to Harald. Doing traffic accounting at the PGW and then reporting these statistics over Diameter is probably the most architecturally correct way to do this. I'm definitely a fan of using IPTables for this kind of stuff, since it’s all just packets anyways.
For our networks, we wrote a completely separate tool called haulage (https://github.com/uw-ictd/haulage) that uses IPTables and does something very similar. Basically logs packets that are forwarded from the virtual interface, draws them down against a user’s prepaid quota, and cuts them off when they hit zero. We wrote this as a separate app (in go) mainly to keep things simpler and let us move faster.
Spencer
On Mar 11, 2020, at 09:26, david@ispsupplies.com david@ispsupplies.com wrote:
Sorry yeah I meant the EPC. I am not sure if the Open5GS software supports it but Freediameter would be the Accounting portion in AAA from what I can tell.
David Peterson Senior Engineer 855-947-7776 ext. 9214 c 419-706-7355 d 979-314-1305 https://www.ispsupplies.com
-----Original Message----- From: Harald Welte laforge@osmocom.org Sent: Wednesday, March 11, 2020 11:53 AM To: david@ispsupplies.com Cc: 'Romeu Medeiros' medeiros@medeiros.eng.br; nextepc@lists.osmocom.org Subject: Re: Open5GS Traffic Accounting
Hi David,
On Tue, Mar 10, 2020 at 07:56:06PM -0400, david@ispsupplies.com wrote:
Freediameter should be able to provide accounting so long as the ENB
supports it.
in which way is the eNB involved in traffic accounting in LTE?
Normally, AFAICT, accounting is implemented within the P-GW, potentially interacting via Radios/Diameter or some other protocol with some external entity that decides whether or not there is credit/budget remaining or not. If not, the PGW would stop firwarding packets of the related session/subscriber.
--
- Harald Welte laforge@osmocom.org
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2flaforge.gnumonks.org%2f&a... =E,1,yb6SFWcoxXKtp0qClHpv4V936cQS_cFUx9dFgqORnwJ6yRCOhax7GulxJjjPLVsGkCe2ioB ew6hlBJnFYR1mBgD0-WojRnKxjbM4dQK9xQ,,&typo=1 ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)
Hello Spencer, Harald and all.
I really appreciated all infos, this saves me a lot of time!
Spencer, I'm seeing your tool, I think that is exactly like I need. My environment is small (10 endbs).
I will try to use your tool here, In our github page you inform that the code is migrating to open5gs. It's working with the open5gs?
Thanks
Romeu Medeiros
On Wed, Mar 11, 2020 at 1:39 PM Spencer Sevilla sevilla@cs.washington.edu wrote:
+1 to Harald. Doing traffic accounting at the PGW and then reporting these statistics over Diameter is probably the most architecturally correct way to do this. I'm definitely a fan of using IPTables for this kind of stuff, since it’s all just packets anyways.
For our networks, we wrote a completely separate tool called haulage ( https://github.com/uw-ictd/haulage) that uses IPTables and does something very similar. Basically logs packets that are forwarded from the virtual interface, draws them down against a user’s prepaid quota, and cuts them off when they hit zero. We wrote this as a separate app (in go) mainly to keep things simpler and let us move faster.
Spencer
On Mar 11, 2020, at 09:26, david@ispsupplies.com <
david@ispsupplies.com> wrote:
Sorry yeah I meant the EPC. I am not sure if the Open5GS software
supports
it but Freediameter would be the Accounting portion in AAA from what I
can
tell.
David Peterson Senior Engineer 855-947-7776 ext. 9214 c 419-706-7355 d 979-314-1305 https://www.ispsupplies.com
-----Original Message----- From: Harald Welte laforge@osmocom.org Sent: Wednesday, March 11, 2020 11:53 AM To: david@ispsupplies.com Cc: 'Romeu Medeiros' medeiros@medeiros.eng.br;
nextepc@lists.osmocom.org
Subject: Re: Open5GS Traffic Accounting
Hi David,
On Tue, Mar 10, 2020 at 07:56:06PM -0400, david@ispsupplies.com wrote:
Freediameter should be able to provide accounting so long as the ENB
supports it.
in which way is the eNB involved in traffic accounting in LTE?
Normally, AFAICT, accounting is implemented within the P-GW, potentially interacting via Radios/Diameter or some other protocol with some external entity that decides whether or not there is credit/budget remaining or
not.
If not, the PGW would stop firwarding packets of the related session/subscriber.
--
- Harald Welte laforge@osmocom.org
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2flaforge.gnumonks.org%2f&a...
=E,1,yb6SFWcoxXKtp0qClHpv4V936cQS_cFUx9dFgqORnwJ6yRCOhax7GulxJjjPLVsGkCe2ioB
ew6hlBJnFYR1mBgD0-WojRnKxjbM4dQK9xQ,,&typo=1
============================================================================
"Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch.
A6)
Our migration is *almost* done. We had to rewrite a lot of database code because we used to integrate with OAI, but now have moved our systems over to open5gs. I’ll respond back to this thread once we’ve finally migrated everything (should be by the end of the week).
On Mar 11, 2020, at 10:05, Romeu Medeiros medeiros@medeiros.eng.br wrote:
Hello Spencer, Harald and all.
I really appreciated all infos, this saves me a lot of time!
Spencer, I'm seeing your tool, I think that is exactly like I need. My environment is small (10 endbs).
I will try to use your tool here, In our github page you inform that the code is migrating to open5gs. It's working with the open5gs?
Thanks
Romeu Medeiros
On Wed, Mar 11, 2020 at 1:39 PM Spencer Sevilla <sevilla@cs.washington.edu mailto:sevilla@cs.washington.edu> wrote: +1 to Harald. Doing traffic accounting at the PGW and then reporting these statistics over Diameter is probably the most architecturally correct way to do this. I'm definitely a fan of using IPTables for this kind of stuff, since it’s all just packets anyways.
For our networks, we wrote a completely separate tool called haulage (https://github.com/uw-ictd/haulage https://github.com/uw-ictd/haulage) that uses IPTables and does something very similar. Basically logs packets that are forwarded from the virtual interface, draws them down against a user’s prepaid quota, and cuts them off when they hit zero. We wrote this as a separate app (in go) mainly to keep things simpler and let us move faster.
Spencer
On Mar 11, 2020, at 09:26, <david@ispsupplies.com mailto:david@ispsupplies.com> <david@ispsupplies.com mailto:david@ispsupplies.com> wrote:
Sorry yeah I meant the EPC. I am not sure if the Open5GS software supports it but Freediameter would be the Accounting portion in AAA from what I can tell.
David Peterson Senior Engineer 855-947-7776 ext. 9214 c 419-706-7355 d 979-314-1305 https://www.ispsupplies.com https://www.ispsupplies.com/
-----Original Message----- From: Harald Welte <laforge@osmocom.org mailto:laforge@osmocom.org> Sent: Wednesday, March 11, 2020 11:53 AM To: david@ispsupplies.com mailto:david@ispsupplies.com Cc: 'Romeu Medeiros' <medeiros@medeiros.eng.br mailto:medeiros@medeiros.eng.br>; nextepc@lists.osmocom.org mailto:nextepc@lists.osmocom.org Subject: Re: Open5GS Traffic Accounting
Hi David,
On Tue, Mar 10, 2020 at 07:56:06PM -0400, david@ispsupplies.com mailto:david@ispsupplies.com wrote:
Freediameter should be able to provide accounting so long as the ENB
supports it.
in which way is the eNB involved in traffic accounting in LTE?
Normally, AFAICT, accounting is implemented within the P-GW, potentially interacting via Radios/Diameter or some other protocol with some external entity that decides whether or not there is credit/budget remaining or not. If not, the PGW would stop firwarding packets of the related session/subscriber.
--
- Harald Welte <laforge@osmocom.org mailto:laforge@osmocom.org>
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2flaforge.gnumonks.org%2f&a... https://linkprotect.cudasvc.com/url?a=http%3a%2f%2flaforge.gnumonks.org%2f&c =E,1,yb6SFWcoxXKtp0qClHpv4V936cQS_cFUx9dFgqORnwJ6yRCOhax7GulxJjjPLVsGkCe2ioB ew6hlBJnFYR1mBgD0-WojRnKxjbM4dQK9xQ,,&typo=1 ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)
Dear Romeo,
On Tue, Mar 10, 2020 at 08:15:01PM -0300, Romeu Medeiros wrote:
I was thinking about one way to generate traffic accounting from the LTE users of the Open5GS.
great!
I'm rearching something using the iptables (in Linux),
Please don't. iptables is mroe than 20 years old by now, and for any new development you should consider using nftables. It is much more powerful, efficient nad also (contrary to iptables) has nice library API by which rules can be installed from programs without fork+exec of an "iptables" binary with command line arguments.
In Debian 10 (and presumably other distributions) nftables is alredy the default. Based on the fact that there's an iptables compatibility layer on top, you may not even know that.
The fundamental question is whether or not you want to do this in the external packet filter of the OS or inside the PGW itself. I would argue for the latter, because:
The bad from this idea is that this code only will work correctly in a Linux box.
that, and also because the open5gs PGW already contains a (stripped down) BSD firewall code base if you want to do filtering or the like.
In general, the question is what kind of throughput in terms of bandwidth and pps you are looking for. Implementing GTP-U encap/decap, accounting, filtering etc. inside a userspace process behind RAW sockets and a tun device is not going to scale very far. For a single-eNB lab setup: Fine. But do you need accounting there?
For anything bigger, I would consider looking at other P-GW implementations out there, such as ergw or the OMEC implementation.
They both do CUPS (control / user plane split) and have DPDK and/or VPP accelerated user plane implementations. Given they talk standard GTP, you should be able to inter-operate them with open5gs.
Regards, Harald