Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

break tx into smaller tasks #19

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

Hasan6979
Copy link

@Hasan6979 Hasan6979 commented Jan 10, 2025

This PR attempts to optimize sending encrypting packets out of the tunnel.

It achieves this by leveraging multi-core CPU architecture and breaking sending the encrypted packets into 3 parts, each with its own separate thread.

Thread 1 - iface_reader -> Reads data from the interface, checks the peer, gets the current valid session keys and hands over the keys and the data to encryption worker thread.

Thread 2 - encryption_worker -> Receives the data and the encryptions keys and encrypts the packet with it. Forwards the encrypted packet to the network worker.

Thread 3 - Network_worker -> Receives the encrypted data and the endpoint and sends the data towards the endpoint on the network.

The idea is that because each thread is much smaller, so much less context switching would be expected.

Timers are updated on every single packet call, but their
accuracy is limited to 250ms where currentTime is updated.
So just mark timers to update, and update them only once in
update_timers.
@Hasan6979 Hasan6979 changed the base branch from LLT-5805_update_timers_periodically to main January 10, 2025 11:50
@Hasan6979 Hasan6979 force-pushed the LLT-5850_break_tx_into_tasks branch from 6c8d671 to 139cc26 Compare January 17, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant