GTP-U packets are passed to the socket and not handled
in the kernel:
* any GTP-U version != 1
* any GTP message types != GTP_TPDU
* any GTP messages for which the kernel doesn't know the TID
* any GTP messages whose inner IPv4 destination address doesn't match the
TID
Humm, this answer seems very interesting for me.
While trying to make my ggsn work using some Linux helper as I said
previously, on the other hand, I want to try netlink now after your very
clear explanation.
I found that tetrapak is just a building tool, so I can use gen_netlink
because I understand the concept now.
I will ask them on the mailing list, but "in a more general way" (not
erlang only point of view), I have read on wikipedia and it's similar to
Unix Socket, this I am familiar with, I can manage them in userspace.
I understood that netlink is a bit similar, not using filename but PID
instead (IPC: Inter Process Communication), and *sounds even more great
because thanks to netlink, I would be able to discuss to the kernel level
from user space!!!!*
Even though the source code of libgtpnl is open, I have 0 knowledge in C, I
just know the printf() function.
*So if anyone can give a hint on the Concept by managing the GTP linux
module using netlink, just the Concept, not how to do it by code, would be
really appreciated.*
Best Regards,
Le ven. 21 août 2020 à 16:57, Papa Tana <papa.tana101(a)gmail.com> a écrit :
At least
earlier versions of ergw had support for the kernel GTP-U
plane, why > not
simply use that code?
My experience with erlang is very limited so far, that's why I was
attracted with libgtpnl, because I was able to create a GTP tunnel by
invoking only 2 lines
# ./gtp-link add
# ./gtp-tunnel add
from > erlang,
including gtpnl support.
Yes, I saw it. but even trying to build it from tetrapak, I have made some
search but I'm struggling:
# tetrapak build check (don't even know what is tetrapak :-) )
The creators of these libraries already answer some questions from me in
the public erlang mailing list, but about general erlang related questions.
I didn't find any public mailing list to these libraries, so I gave up.
You cannot do that, sorry.
This will obviously not work.
You need to manage the socket from your program.
You are asking for the impossible.
I totally agree with you but I've got some idea this afternoon as a
workaround.
I think I can forward the echo-request that I received on my network
interface (owned by gtpnl at GTP-U) to my Erlang program by using some
Linux helper like
# tcpdump
# replay the traffic by tcpreplay to another interface owned by my Erlang
program
# or I can Write them to a Linux named pipe fifo, and get it from Erlang
By this way, I would be able to craft an echo-response for GTP-U I think.
Those steps are not related to libgtpnl anymore, so would be off-topic.
But Clarifications regarding libgtpnl is very clear for me now.
Thank you,
P.S: I will update here if this echo-response at GTP-U side from my erlang
works for me. Have a nice day.
Le ven. 21 août 2020 à 15:40, Harald Welte <laforge(a)gnumonks.org> a
écrit :
On Fri, Aug 21, 2020 at 09:53:34AM +0300, Papa
Tana wrote:
But for GTP-U, I was trying to listen in port
2152 several times, and it
yields an error that I cannot listen on it, port 2152 is already used.
You cannot do that, sorry.
> You manage all your UDP sockets.
> your application is responsible for receiving and responding to any
GTP-U
packets there.
As I said, I am using Erlang as a userspace program.
And when I create a tunnel, I "just" send a basic command exec to the
Linux
by open_port like this:
This will obviously not work. You need to manage the socket from your
program.
IF it's erlang, you either have to speak netlink directly from within
Erlang,
or you need to add some native functions for calling libgtpnl.
So I don't have any idea on how to listen to
2152 as my Erlang program
is
forbidden to listen on it when libgtpnl is
invoked.
You are asking for the impossible. You need to open the socket from
within your
program. You cannot crate a second socket for what you are trying to do.
At least earlier versions of ergw had support for the kernel GTP-U plane,
why not simply use that code?
They created
https://github.com/travelping/gen_netlink
to talk netlink from erlang, including gtpnl support.
--
- Harald Welte <laforge(a)gnumonks.org>
http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch.
A6)