Improve the support for the Linux kernel GTP-U plane using netlink socket in my Erlang app

Papa Tana papa.tana101@REDACTED
Sun Aug 23 17:01:19 CEST 2020


Hi All,

In order to debug my need, I used nlmon:

# modprobe nlmon
# ip link add mymonitor type nlmon
# ip link set mymonitor up

So, reproducing all the GTP-U scenarios when adding or removing tunnels is
monitorable.

It's pretty fast to debug thanks to the below amazing stuff:

https://github.com/msantos/procket
https://github.com/travelping/gen_netlink

But I wonder if netlink is natively available without using libraries in
OTP/23 (Linux).

I have made a lot of search in the documentation, but didn't make it work:

> family => netlink
> type =>dgram
> protocol=>0

{ok, Sock} = socket:open(netlink, ...,...)

>> ** exception error: {invalid,{domain,netlink}}

Sure, I saw {local | inet | inet6} are only available but it was worth a
try....

Can someone confirm netlink natively in OTP-23 please?


*P.S: I found these libraries very breathtaking, but when first learning,
I'm used to starting from scratch, that's why I'm asking this question, but
after making things work with native function, I'm switching to the library
for a serious project.*
Best Regards,


Le ven. 21 août 2020 à 21:07, Papa Tana <papa.tana101@REDACTED> a écrit :

> Hello Erlang Community,
>
> I have an Erlang application communicating with another node using GTP
> protocol.
> At GTP-C part, everything is ok, no change is needed.
> But at GTP-U part, I want to improve my support for the kernel GTP-U plane.
>
>  - I have used Vector Packet Processing as a first prototype, it's a very
> amazing platform, but a very big solution for my very small need, I needed
> to deploy large resources.
>  - I have replaced it with some Linux helper, it's working fine but too
> slow, the latency is not acceptable for me.
>  - I switched to libgtpnl from Osmo Net Gprs project, it's working great
> as well, but I cannot exploit all functionality of my GTP-U; the creator of
> the library confirms that I need to manage the socket from my erlang
> program to go over these limitations.
>
> Then I have two choices now:
>  - Option 1: add native functions for calling this libgtpnl written in C
> from Erlang
>  - Option 2: speak netlink directly from within Erlang
>
> *As I am a big fan of pure Erlang, I kept the Option 2.*
>
> The below links were my starting point:
>
>  - https://github.com/travelping/gen_netlink
>  - https://github.com/Feuerlabs/netlink
>  - maybe there is another one that I missed out.....
>
> I understood how to open a raw socket using netlink now, and how to send
> some requests to the kernel.
> I have tested ip route and it's ok but for GTP-U part, I'm lost around.
>
> Indeed, they do have support for gtpnl, so if anyone has used those
> libraries for any GTP-U usage, would be really appreciated to share some
> hints please.
>
> Best Regards,
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20200823/ec110c2a/attachment.htm>


More information about the erlang-questions mailing list