The invention discloses a data zero-copy
processing method and
system based on an eBPF zero-trust gateway, and belongs to the technical field of
computer network security. According to the method, an XDP program is loaded on a network card driving layer, and an AFXDP technology is combined to construct a kernel mode and user mode
shared memory pool UMEM; when an original message arrives, an eBPF unit mounted by an XDP program intercepts the message in real time, a tunnel packaging space is reserved in situ in an original memory, and if the head space is insufficient, a new memory page is logically mapped from a UMEM standby buffer
pool to achieve extension. Identity fingerprints are generated by extracting message feature vectors, load in-situ
encryption is completed in cooperation with a kernel kTLS module, and data are prevented from being returned to a user mode for
processing. According to the method, multiple
copying and context switching of a kernel-user mode of a traditional SSL VPN are eliminated, the
throughput is improved by 2-3 times, the
delay is reduced to the
microsecond level, the CPU
utilization rate is reduced by 40% or above,
application layer DDoS attacks are effectively defended, and the method is suitable for 5G
edge computing and cloud native zero-trust gateway scenes.