[vpp-dev] DNS Resolution over VCL

2022-10-26 Thread Anthony Fee
Hi all,

I have a question regarding DNS lookup from an application using VCL. I'm 
working with an application that resolves hostnames to IP addresses using the 
gethostbyname() function. The applications interfaces to the Linux network 
stack using the epoll API and so seemed like a good candidate for using VCL 
with LD_PRELOAD. I'm well aware that this may not work but it's worth trying 
before looking at modifying the interface within the application.

The problem I have is that, when using the gethostbyname() function to resolve 
hostnames, there is no network traffic seen in the VPP network interface.  Just 
to simplify the issue away from the application, the wget tool uses the same 
function to resolve hostnames. I can confirm that using wget with VCL does work 
when using an IP address in the URL. However, when passing the hostname in the 
URL an error occurs failing to resolve the hostname. Again, no packets are seen 
in VPP when this occurs.

I have seen in [1] that the "Caching DNS name resolver" plugin has the ability 
to "override gethostbyname() in an LD_PRELOAD library" but I don't see any 
reference on how to override this. Is this the step that I am missing?

Just to note, I do have DNS enabled in VPP and have a nameserver configured as 
8.8.8.8. I can also cache DNS entries if I add them manually, but this has no 
impact on the application as there are no packets seen in VPP.

Please let me know if any further information would be useful.

Thanks,
Anthony

[1] https://s3-docs.fd.io/vpp/22.06/aboutvpp/featurelist.html

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#22073): https://lists.fd.io/g/vpp-dev/message/22073
Mute This Topic: https://lists.fd.io/mt/94581374/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [vpp-dev] DNS Resolution over VCL

2022-10-28 Thread Anthony Fee
Hi all,

I still haven't had any luck getting this working. Any ideas?

Thanks in advance!
Anthony

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#22089): https://lists.fd.io/g/vpp-dev/message/22089
Mute This Topic: https://lists.fd.io/mt/94581374/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [vpp-dev] DNS Resolution over VCL

2022-10-28 Thread Florin Coras
Hi Anthony, 

LDP doesn’t currently intercept gethostbyname as integration with vpp's 
internal dns resolver is not yet done for vcl. Should you or anybody else be 
interested in implementing that, I’d be happy to offer support. 

Regards,
Florin

> On Oct 28, 2022, at 2:29 AM, Anthony Fee  wrote:
> 
> Hi all,
> 
> I still haven't had any luck getting this working. Any ideas? 
> 
> Thanks in advance!
> Anthony 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#22093): https://lists.fd.io/g/vpp-dev/message/22093
Mute This Topic: https://lists.fd.io/mt/94581374/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [vpp-dev] DNS Resolution over VCL

2022-10-31 Thread Anthony Fee
Hi Florin,

Thank you for the reply, much appreciated. I assume that gethostbyname() uses 
something under the hood that LDP does intercept, otherwise it would continue 
to use the Linux implementation to resolve hostnames. From what I can see, 
right now LDP renders gethostbyname() unusable in the application. Are you 
aware of this behaviour? If so, is there any workaround when using VCL or is it 
better to just use another mechanism to interface with VPP?

I don't have the scope to look at this now, but I will likely need this 
functionality in the future so would be interested in implementing it when the 
time comes. I know that you are mainly focused on server side at the moment so 
this probably isn't much of an issue. I'm getting asked more on the client side 
these days so it is of interest to me.

Thanks again,
Anthony

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#22101): https://lists.fd.io/g/vpp-dev/message/22101
Mute This Topic: https://lists.fd.io/mt/94581374/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [vpp-dev] DNS Resolution over VCL

2022-10-31 Thread Florin Coras
Hi Anthony, 

Assuming the host os has network connectivity beyond vpp for dns resolution, 
this is surprising. Would be good to understand if anything actually makes its 
way into ldp during a gethostbyname() call. 

Native integration with vcl, as opposed to ldp, should solve the problem but 
that obviously means more work and it might not be possible in some cases. If 
your use case relies on more of vpp’s features, beyond host stack, tap/memif 
interfaces are also a good option. 

Regards, 
Florin

> On Oct 31, 2022, at 6:24 AM, Anthony Fee  wrote:
> 
> Hi Florin,
> 
> Thank you for the reply, much appreciated. I assume that gethostbyname() uses 
> something under the hood that LDP does intercept, otherwise it would continue 
> to use the Linux implementation to resolve hostnames. From what I can see, 
> right now LDP renders gethostbyname() unusable in the application. Are you 
> aware of this behaviour? If so, is there any workaround when using VCL or is 
> it better to just use another mechanism to interface with VPP?
> 
> I don't have the scope to look at this now, but I will likely need this 
> functionality in the future so would be interested in implementing it when 
> the time comes. I know that you are mainly focused on server side at the 
> moment so this probably isn't much of an issue. I'm getting asked more on the 
> client side these days so it is of interest to me.
> 
> Thanks again,
> Anthony 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#22107): https://lists.fd.io/g/vpp-dev/message/22107
Mute This Topic: https://lists.fd.io/mt/94581374/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [vpp-dev] DNS Resolution over VCL

2022-11-03 Thread Anthony Fee
Hi Florin,

Thanks for the feedback. I built a very basic application to trigger a TCP 
request, with gethostbyname() to resolve the hostname, using the VCL library 
directly. This worked as expected. Just to verify, I ran this also with 
LD_PRELOAD and I did see the gethostbyname() function stopped working. So it 
does look like that LD_PRELOAD is having an impact.

Anyway, the good news is that VCL is very easy to work.

Thanks again for your input.
Anthony

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#22116): https://lists.fd.io/g/vpp-dev/message/22116
Mute This Topic: https://lists.fd.io/mt/94581374/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [vpp-dev] DNS Resolution over VCL

2022-11-03 Thread Florin Coras
Hi Anthony, 

Great! Will add the gethostbyname issue to my never shrinking todo list but, 
should you look into it, let me know if you manage to figure out how ldp 
interacts with gethostbyname.

Regards, 
Florin

> On Nov 3, 2022, at 4:54 AM, Anthony Fee  wrote:
> 
> Hi Florin,
> 
> Thanks for the feedback. I built a very basic application to trigger a TCP 
> request, with gethostbyname() to resolve the hostname, using the VCL library 
> directly. This worked as expected. Just to verify, I ran this also with 
> LD_PRELOAD and I did see the gethostbyname() function stopped working. So it 
> does look like that LD_PRELOAD is having an impact.
> 
> Anyway, the good news is that VCL is very easy to work. 
> 
> Thanks again for your input.
> Anthony 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#22118): https://lists.fd.io/g/vpp-dev/message/22118
Mute This Topic: https://lists.fd.io/mt/94581374/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-