You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
i have a problem with my forwarding in kernel space using aya ebpf and tokio and thought maybe someone here knows why this happens.
for the ebpf program i use a simple stream_verdict to forward to another hashmap entry
i can show more of the connecting and accepting code to create the streams but that is very basic so for brevity only on request.
then for writing i use a simple write_all call on a Vec
for reading i use the TcpStream read function with a [u8; 65535] buffer.
this is just a testing program and all addresses are on local host with different ports for the client, server and the proxy.
This works completely fine and as expected.
But for big data. (>~ 50mb) i read more then the send bytes to the server stream.
eg when sending 50 mb i will receive 50 mb in the kernel program but on the listener on the egress i will receive usually some thousand bytes more than that so eg 50,001,245 byte.
As already described the kernel receives the correct amount so it must happen somewhere from the hashmap redirect_skb to the TcpStream read();
if you need i can certainly provide more of the code
The text was updated successfully, but these errors were encountered:
Enneking666
changed the title
Forwarding more packets then receiving
Forwarding more packets then sending
Oct 25, 2024
Hello,
i have a problem with my forwarding in kernel space using aya ebpf and tokio and thought maybe someone here knows why this happens.
for the ebpf program i use a simple stream_verdict to forward to another hashmap entry
i then create the entries like this
i can show more of the connecting and accepting code to create the streams but that is very basic so for brevity only on request.
then for writing i use a simple write_all call on a Vec
for reading i use the TcpStream read function with a [u8; 65535] buffer.
this is just a testing program and all addresses are on local host with different ports for the client, server and the proxy.
This works completely fine and as expected.
But for big data. (>~ 50mb) i read more then the send bytes to the server stream.
eg when sending 50 mb i will receive 50 mb in the kernel program but on the listener on the egress i will receive usually some thousand bytes more than that so eg 50,001,245 byte.
As already described the kernel receives the correct amount so it must happen somewhere from the hashmap redirect_skb to the TcpStream read();
if you need i can certainly provide more of the code
The text was updated successfully, but these errors were encountered: