yasukata / iip

iip: an integratable TCP/IP stack
Apache License 2.0
57 stars 4 forks source link

Hot code ! #1

Open osevan opened 8 months ago

osevan commented 8 months ago

Great piece of software.

Thumbs up.

I have a question: First question: Can iip hijack go and rust compiled apps sockets or how i should run go and rust apps with it?

Second question :

Did you plan ever a solution to work with whole Linux networking system - especially ssh - and without disturbing current apps on nicks?

Thanks and

Best regards

yasukata commented 8 months ago

Thank you very much for your kind words.

Can iip hijack go and rust compiled apps sockets or how i should run go and rust apps with it?

The plan, currently I have, is to integrate the implementation of this repository through system call hook mechanisms such as https://github.com/yasukata/zpoline .

System call hook mechanisms can redirect the socket-relevant system calls invoked by a compiled application program to arbitrary code; I think we can use this mechanism to transparently apply our TCP/IP stack implementation to an existing application.

Did you plan ever a solution to work with whole Linux networking system - especially ssh - and without disturbing current apps on nicks?

I thought your question was "Can we co-locate this TCP/IP stack implementation with the whole Linux networking system (including ssh) on the same OS environment?" (please correct me if my understanding is wrong)

Even though the implementation in this repository assumes to fully occupy a NIC interface, I think that virtualized NIC interfaces allow us to co-locate it with the Linux networking system.

For instance, the SR-IOV feature of a physical NIC can create virtualized NICs (virtual functions), and it allows us to dedicate a virtual NIC (virtualized by SR-IOV) to the TCP/IP stack implementation of this repository while preserving the primary (non-virtualized) NIC interface for the default Linux networking system.

If a physical NIC does not support SR-IOV, we can still use a software-based virtual NIC, and we could find a study about the concept to co-locate multiple TCP/IP stacks using software-based virtual NIC interfaces in this paper https://dl.acm.org/doi/10.1145/2602204.2602212 .

On the other hand, one restriction of the approach based on virtual NICs would be that we cannot use the same IP address for the Linux networking system and the TCP/IP stack of this repository; I will explore another solution when needed.

Thank you very much for your interest.