LD_PRELOAD not working on packetdrill

67 views
Skip to first unread message

Ibtisam Tariq

unread,
Nov 26, 2021, 3:08:04 AM11/26/21
to packetdrill
Hi

I am using packetdrill wire_server and wire_client options on remote machines, the commands are 
server side
sudo ./packetdrill --wire_server --wire_server_dev=enp1s0f0

client side:
sudo ./packetdrill  --local_ip=172.16.0.1 --gateway_ip=172.16.0.2 --netmask_ip=255.255.255.0 --remote_ip=172.16.1.1/24 --wire_client --wire_client_dev="eno8" --wire_server_ip="13.0.0.21"  ../tcp/ioctl/ioctl-siocinq-fin.pkt

It is working fine on kernel mode. 

I am trying to run packetdrill on f-stack written over DPDK. In DPDK we unbind the interfaces from kernel and bind to DPDK. I have tried my TCP/IP stack shared library with the help of --so-filename on the client-side, but this is not working as my interface is not bind to kernel, and packetdrill will be unable to find the interface in the kernel. As packetdrill establish a connection with remote server first and then load the shared library. 

sudo ./packetdrill  --local_ip=172.16.0.1 --gateway_ip=172.16.0.2 --netmask_ip=255.255.255.0 --remote_ip=172.16.1.1/24 --wire_client --wire_client_dev="eno8" --wire_server_ip="13.0.0.21" --so_filename=<path to shared_lib> ../tcp/ioctl/ioctl-siocinq-fin.pkt
>> ioctl SIOCGIFINDEX: No such device

Main problem
===========

Due to this, I want to use LD_PRELOAD with packetdrill object file. I have tried to LD_PRELOAD it in various ways and searched out google to resolve it but failed. 

I have created a sample object file opening a socket and close it. By LD_PRELOAD shared library on the object file, it responded as:
sudo LD_PRELOAD=<path to shared lib> ./a.out
>> In library socket

On running LD_PRELOAD with packetdrill.  
sudo LD_PRELOAD=<path to shared lib> ./packetdrill  --local_ip=172.16.0.1 --gateway_ip=172.16.0.2 --netmask_ip=255.255.255.0 --remote_ip=172.16.1.1/24 --wire_client --wire_client_dev="eno8" --wire_server_ip="13.0.0.21" ../tcp/ioctl/ioctl-siocinq-fin.pkt
>> ioctl SIOCGIFINDEX: No such device

On packetdrill, LD_PRELOAD is not working, as none of my stack functions are preloaded.

Can you please let me know how can I run the packet drill with my shared library as LD_PRELOAD?

Kind regards,
Ibtisam

Neal Cardwell

unread,
Nov 29, 2021, 9:34:31 AM11/29/21
to Ibtisam Tariq, packetdrill
Hi,

Thanks for the report! An interesting use case.

Can you please let us know why you are referring to the ethernet device with the name "eno8"?

Are you sure the LD_PRELOAD is not working for packetdrill? From the symptoms, it sounds like one possibility is that LD_PRELOAD is working for packetdrill but either:

(1) ioctl SIOCGIFINDEX is not supported by f-stack

(2) f-stack does not refer to the ethernet interface by the name eno8

Have you tried adding debug printf statements to the f-stack code to check these theories?

best regards,
neal


--
You received this message because you are subscribed to the Google Groups "packetdrill" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packetdrill...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packetdrill/2fb9dc27-45be-47ec-9287-7f890c852981n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages