Forwarding more packets then sending #1070
Unanswered
Enneking666
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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
Beta Was this translation helpful? Give feedback.
All reactions