Hi Ole, thanks for your advice, I have done something about option 3, So that other applications can not sense the changes of the socket.
saint_...@aliyun.com From: Ole Troan Date: 2018-11-13 15:47 To: saint_sun CC: vpp-dev Subject: Re: [vpp-dev] inet raw socket Hi again, > yes, we have a control plane, and the protocols I mentioned below run in the > control plane. > when these protocols want to send packets, they organize their own protocol > data then call inet raw socket to set the IP header and link header. when > received a packet from the interface, first we will stripe the link header > and ip header then hand over to the corresponding modules through inet raw > socket. Now can you know what I want to do? There are a number of ways a control plane can (or could) integrate with VPP. Which one is most suitable for you depends. 1) Mirror interfaces. As described in https://wiki.fd.io/view/VPP_Sandbox/router Each VPP interface is mirrored as a Linux TAP interface. Any traffic destined to an interface address in VPP is forwarded to the TAP interface. Any packet received on the TAP interface is shipped out the physical interface. All Linux tools and applications work unchanged. Including use of raw sockets. A all or nothing approach. And might not be suitable for cases with lots of (virtual) interfaces. 2) Separate punt interface. Transport using memif and/or Unix domain socket. Control plane registeres with VPP which protoocols it wants. E.g. a DHCP server registeres for UDP port 69, an IPv6 ND daemon registres for a set of ICMPv6 types. Raw packets sent over transport with meta data. Likewise when CP sends packet, it includes meta-data to specify outgoing interface and/or VPP processing graph node. See https://git.fd.io/vpp/tree/src/vnet/ip/punt.h#n44 This is currently only used by https://pypi.org/project/dhcpkit-vpp/ Gaps: - Missing selectors (only UDP supported) - Missing transports (only UDS) - Missing throttling and QoS 3) Integrate with VPP host stack. For TCP VPP exposes an API that control plane applications can use. I plan to put a Python wrapper on top of VCL and integrate with exaBGP. This approach is of course limited to whatever VCL supports. But in theory VCL could give a full socket-like API. 4) Integrated in VPP Write the control plane functions as VPP plugins. This is how ND, ARP, DHCP and a few others are done. Any others? Personally I would like to do more work on 2. What’s your view? Best regards, Ole
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#11343): https://lists.fd.io/g/vpp-dev/message/11343 Mute This Topic: https://lists.fd.io/mt/27857220/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-