Python TCP stack implementation

前端 未结 5 884
日久生厌
日久生厌 2021-02-03 12:50

Is there a python library which implements a standalone TCP stack?

I can\'t use the usual python socket library because I\'m receiving a stream of packets over a socket

5条回答
  •  渐次进展
    2021-02-03 13:46

    You don't say which platform you are working on, but if you are working on linux, I'd open a tun/tap interface and get the IP packets back into the kernel as a real network interface so the kernel can do all that tricky TCP stuff.

    This is how (for example) OpenVPN works - it receives the raw IP packets over UDP or TCP and tunnels them back into the kernel over a tun/tap interface.

    I think that there is a tun/tap interface for windows too now which was developed for the OpenVPN port to windows.

提交回复
热议问题