Transmission method in integrated NR base station communication system with sunk core network

Through dynamic library overloading the socket API, replacing the UDP socket API of NGC and NR, the shared memory ring queue and timer optimization is implemented, solving the problems of tight resources and insufficient transmission performance of NR base station system, and an efficient and portable transmission solution is realized.

CN119521260APending Publication Date: 2025-02-25深圳市佳贤通信科技股份有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411624385.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In an integrated NR base station system, the data plane traffic of NGC and NR is large, resulting in tight system resources. Existing transmission solutions such as socket communication and DPDK data plane acceleration technology have problems such as insufficient performance or high code intrusion.

Method used

The dynamic library is overloaded with socket API, and the dynamic library is loaded through the LD_PRELOAD environment variable, and the UDP socket API is replaced to achieve accelerated transmission. Specific measures include initializing the shared memory ring queue and lock, overloading the socket, bind, sendto, recvfrom interfaces, and optimizing data transmission using caching mechanisms and timers.

Benefits of technology

It realizes a transmission solution with less resource occupancy, high performance and low code intrusion, improves the transmission performance of NR base stations, and does not require changes in the code and is highly adaptable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119521260A_ABST
    Figure CN119521260A_ABST
Patent Text Reader

Abstract

The invention discloses a transmission method in an integrated NR base station communication system with a sunk core network, which comprises the following steps of: newly adding a dynamic library to reload a socket API (Application Program Interface) which comprises a socket interface, a bind interface, a sendto interface, a recvfrom interface and a close interface, loading the library through an LDPRELOAD environment variable, starting an NGC (Network Gateway Converter) and an NR process, and replacing all UDP (User Datagram Protocol) socket API. The method comprises the following steps of: constructing a stockkokinit function, realizing interface reloading through a dlsym function, and initializing a shared memory annular queue, a lock and the like. Socket, bind, sendto and recvfrom interfaces are realized, socket descriptors of GTPU communication are specially processed, and accelerated data transmission is realized by using FIFO, a shared memory annular queue and a timer. According to the embodiment, by configuring the LDPRELOAD environment variables, NGC and NR codes do not need to be changed, and automatic replacement is achieved. On integrated equipment with resource shortage, an NGC (Next Generation Core Network) and an NR (New Radio Communication Technology) base station realize data plane transmission through a GTPU protocol and UDP (User Datagram Protocol) communication, and the problems of high bandwidth demand and resource occupation are faced. The problems of performance, resource occupation and code invasiveness existing in an existing transmission scheme are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of wireless communication technology, and in particular to a transmission method in an integrated NR base station communication system with a core network sinking. Background Art

[0002] The data plane of NGC and NR is completed through the GTPU protocol, using UDP communication. On the integrated device, because NGC and NR are deployed at the same time, the resources are very tight. The data plane traffic of NGC and NR is very large, and a single cell can reach 750Mbps. If there are two cells, the bandwidth doubles, and the requirements for CPU and memory are very high. This further leads to resource constraints in the system.

[0003] The existing transmission solutions usually include:

[0004] (1) Using ordinary socket communication, because the kernel TCP / IP protocol stack has a long path and many system calls, it takes up a lot of CPU resources. Even if a lot of resources are occupied, the performance cannot meet the requirements.

[0005] (2) Using dpdk's data plane acceleration technology and dpdk's memif and other solutions can greatly improve performance. However, dpdk uses a polling method, and NGC and NR each need to occupy a CPU and need to be adapted to DPDK. The workload of modifying both NGC and NR is very large.

[0006] (3) Customizing new communication methods, such as shared memory implementation, which has high performance and consumes few resources. However, the code is highly invasive and not universal. Once the deployment is not integrated, the interface must be changed and several sets of code must be maintained internally. Summary of the invention

[0007] In view of the technical problems raised by the background technology, the present invention proposes a method for improving the transmission performance of an integrated NR base station with a core network sinking. A transmission scheme with relatively less resource occupancy, relatively high performance, low code intrusion, and strong portability is proposed.

[0008] The technical solution adopted by the present invention is:

[0009] A transmission method in an integrated NR base station communication system with a core network sinking, the method comprising:

[0010] Added a dynamic library to overload the socket API, including socket, bind, sendto, recvfrom, and close interfaces;

[0011] The dynamic library is loaded by setting the LD_PRELOAD environment variable, and the NGC and NR processes are started to replace the APIs of all UDP sockets;

[0012] Implement a constructor socket_hook_init to implement interface overloading through the dlsym function and initialize the shared memory ring queue, lock, etc.;

[0013] Implement the socket interface to record sockets using the UDP protocol;

[0014] Implement the bind interface to filter the socket of port 2152 and create a real communication channel, using the famous Linux pipe FIFO implementation;

[0015] Implement the sendto interface to determine whether sockfd is the fd of GTPU. If so, use the accelerated interface to send data, otherwise use the native interface to send data;

[0016] Implement the recvfrom interface to determine whether sockfd is the GTPU fd. If so, use the accelerated interface to receive data, otherwise use the native interface to receive data.

[0017] Use the cache mechanism to cache 32 buffs at a time and then send them all at once. If 32 buffs are not reached, a 1ms timer is used to trigger data sending.

[0018] Preferably, the dynamic library is loaded by setting the LD_PRELOAD environment variable, and automatic replacement can be achieved without changing the codes of NGC and NR.

[0019] Preferably, the overloaded socket API includes but is not limited to socket, bind, sendto, recvfrom, and close interfaces.

[0020] Preferably, the method uses FIFO and shared memory ring queue to realize accelerated data transmission.

[0021] Preferably, the method triggers data sending via a timer, and the timeout period of the timer is 1 ms.

[0022] Preferably, the method uses an atomic operation in a sendto interface to obtain a current write pointer, copies user-state data to the buff pointed to by the obtained circular queue write pointer, and updates the offset of the write pointer.

[0023] Preferably, the method obtains whether there is currently data cache through an atomic variable in the recvfrom interface, and if so, directly copies the data of the pointer corresponding to the ring buff to the user state buff.

[0024] In a second aspect, the present application also provides a computer program product for implementing the method described in the first aspect of the rights, wherein the computer program product includes a dynamic library, the dynamic library is used to overload the socket API, and the dynamic library is configured to be loaded by setting the LD_PRELOAD environment variable.

[0025] In a third aspect, the present application further provides a computer system, the computer system comprising a processor and a memory, the memory storing a computer program, the computer program comprising the method described in the first aspect.

[0026] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program includes the method described in the first aspect.

[0027] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0028] 1. The use of cache mechanism greatly reduces the number of system calls;

[0029] 2. It does not pass through the kernel-state TCP / IP protocol stack, which improves performance;

[0030] 3. No changes are required to nr and ngc codes, and the replacement is very friendly;

[0031] 4. The same solution can be used when nr is connected to other ngcs or ngc is connected to other nr, which has high portability. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0033] Figure 1 It is a communication flow chart provided by this application;

[0034] Figure 2 It is the flow chart of Sendto and recvfrom provided by this application. DETAILED DESCRIPTION

[0035] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0036] Because NGC and NR are deployed on the same system, even if UDP communication is used, it is ultimately local communication, that is, the lo loopback address is used. The communication process is as follows Figure 1 shown.

[0037] As mentioned earlier, the disadvantage of using sockets is that the entire TCP / IP protocol stack must be used, and system calls are required every time, resulting in a large waste of performance. Because of local UDP communication, all actions performed by the TCP / IP protocol stack are completely unnecessary. In addition, we need to minimize the number of system calls. At the same time, neither the base station nor the core network wants to make major code changes.

[0038] Example 1

[0039] like Figures 1 to 2 As shown, this embodiment provides a transmission method in an integrated NR base station communication system with a core network sinking. Specifically, a dynamic library is added, and the socket APIs are overloaded in the dynamic library, including socket, bind, sendto, recvfrom, and close interfaces. The LD_PRELOAD environment variable is used to load the library and start the NGC and NR processes, so that all udp socket APIs used in the process are replaced by the APIs in the newly added dynamic library.

[0040] Api implementation: First, you need to implement a constructor socket_hook_init, which does not completely replace the socket interface. It only takes over the udp communication with the destination port 2152 and the local address. Other socket communications still need to use the system's native interface, which needs to be implemented through the dlsym function.

[0041] At the same time, the constructor also needs to do some initialization, such as allocating a shared memory circular queue and initializing the lock. The pseudo code is as follows:

[0042] typedef int(*real_socket)(int domain,int type,int protocol);

[0043] typedef int(*real_bind)(int sockfd,const struct sockaddr*addr,

[0044] socklen_t addrlen);

[0045] / ****Other socket interfaces*** /

[0046] real_socket glibc_socket=NULL;

[0047] real_bind glibc_bind=NULL;

[0048] / ****Other socket interfaces*** /

[0049] __attribute__((constructor))void socket_hook_init()

[0050] {

[0051] glibc_socket=dlsym(RTLD_NEXT,"socket");

[0052] glibc_bind=dlsym(RTLD_NEXT,"bind");

[0053] / ******Other socket interfaces*** /

[0054] init_share_ringbuff();

[0055] init_lock();

[0056] / *Other initialization* /

[0057] }

[0058] Socket interface: This interface needs to record the socket using the UDP protocol. The rest is still the original process. The pseudo code is as follows:

[0059] int socket(int domain,int type,int protocol)

[0060] {

[0061] int fd = 0;

[0062] fd = glibc_socket (domain, type, protocol); / / create a socket using native API

[0063] return fd;

[0064] }

[0065] Bind interface: This interface will bind the port number, so you can filter the socket of port 2152 on this interface, then the fd is the socket descriptor for NGC and NR gtpu communication. Save the fd in two processes respectively. The fd will only be used as a matching index, not as a real channel for transmitting data, so you need to create a real communication channel on the bind interface, using the famous Linux pipe FIFO implementation, and you need to use a timer, and you need to create a posix timer. The pseudo code is as follows:

[0066] int bind(int sockfd,const struct sockaddr*addr,

[0067] socklen_t addrlen)

[0068] {

[0069] struct sockaddr_in*server_addr=(struct sockaddr_in*)addr;

[0070] if(server_addr.sin_port=2152)

[0071] {

[0072] Save(sockfd); / / Save the fd of gtpu communication;

[0073] mkfifo("gtpu"); / / Create a real communication channel;

[0074] timer_create(1ms) / / Create a 1ms timer

[0075] }

[0076] else

[0077] return glibc_bind(sockfd, addr, addrlen); / / Other non-gtpu sockets continue to follow the normal process

[0078] }

[0079] Sendto interface: In the sending interface, you first need to determine whether sockfd is the fd of gtpu. If so, you need to use the acceleration interface to send data, otherwise use the native interface to send. The acceleration process is implemented using fifo, shared memory circular queue, and timer. The circular queue is initialized and created in the constructor, because the maximum length of the gtpu message will not exceed 1600, the buff length is positioned at 2048, each buff has an index, and a total of 10240 are allocated. Because NGC and NR both send and receive data, two environment queues are used. At the same time, the circular queue uses read and write pointers to indicate the offset in the environment. The updated read and write pointers use atomic variables, and the read and write performance is the highest. In order to improve performance, a cache mechanism is used to cache 32 buffs at a time and then send them uniformly. At the same time, if 32 buffs are not reached, the data transmission is triggered by a 1ms timer. The accelerated data flow is as follows:

[0080] (1) Use atomic operations to obtain the current write pointer, copy the user-state data to the buff pointed to by the obtained ring queue write pointer, and update the offset of the write pointer

[0081] (2) Determine the number of buffs in the cache. If it is less than 32, return success directly. If it is equal to 32, use FIFO to notify the other party to receive. If it is greater than 32, return directly because the other party has already been notified and may not be able to handle it. (3) When the timer times out, determine whether the cache is less than 32. If it is less than 32, use FIFO to notify the other party to receive.

[0082] The pseudo code is as follows:

[0083] int sendto(int sockfd,const void*buf,size_t len,int flags,

[0084] const struct sockaddr*dest_addr,socklen_t addrlen);{

[0085] if(sockfd=gtpu_fd) / / Is it the fd for gtpu communication?

[0086] {

[0087] ring_buff = get_ring_buff(); / / Atomic operation to get ring buff

[0088] Copy_buff(ring_buff,buf,len); / / copy data

[0089] if (cache(ring) == 32)

[0090] {

[0091] fifo_write("gtpu"); / / Notify the other party to read

[0092] }

[0093] Return len;

[0094] }

[0095] else

[0096] return glibc_sendto(sockfd, buf, len, flags, dest_addr, addrlen); / / Other non-gtpu sockets continue to follow the normal process;

[0097] }

[0098] Void timer_handle(void)

[0099] {

[0100] if(cache(ring)<32)

[0101] {

[0102] fifo_write("gtpu"); / / Notify the other party to read

[0103] }

[0104] }

[0105] recvfrom interface: In the receiving interface, first you need to determine whether sockfd is the gtpu fd. If it is, you need to use the accelerated interface to receive data, otherwise use the native interface to receive. The process is as follows:

[0106] (1) Use atomic variables to determine whether the data is currently cached. If so, directly copy the data of the pointer corresponding to the ring buff to the user state buff and then return.

[0107] (2) If there is no cached data, use the fifo read interface to wait for data.

[0108] (3) After receiving the fifo notification, repeat step 1.

[0109] The pseudo code is as follows:

[0110] int recvfrom(int sockfd,void*buf,size_t len,int flags,

[0111] struct sockaddr*src_addr,socklen_t*addrlen);

[0112] {

[0113] if(sockfd=gtpu_fd) / / Is it the fd for gtpu communication?

[0114] {

[0115] NEXT:

[0116] if(cache(ring)>0)

[0117] {

[0118] Copy_buff(buff,ring_buf,len);

[0119] }

[0120] Else

[0121] {

[0122] fifo_read("gtpu");

[0123] goto NEXT;

[0124] }

[0125] Return len;

[0126] }

[0127] else

[0128] return glibc_recvfrom(sockfd,buf,len,flags,src_addr,addrlen) / / Other non-gtpu sockets continue to follow the normal process

[0129] }

[0130] The process of Sendto and recvfrom is as follows Figure 2 shown.

[0131] close interface:

[0132] Mainly perform some resource release actions for fd whose sockfd is gtpu.

[0133] Implementation

[0134] After the dynamic library is implemented, you only need to configure the LD_PRELOAD environment variable when starting NGC and NR, similar to the following operations:

[0135] LD_PRELOAD=. / hook_socket.so. / ngc_process

[0136] LD_PRELOAD=. / hook_socket.so. / nr_process

[0137] After this operation, the replacement is completed automatically, and no code changes are required in the ngc and nr processes.

[0138] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0139] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A transmission method in an integrated NR base station communication system with a core network sinking, characterized in that: The method comprises: adding a dynamic library for overloading the socket API, including socket, bind, sendto, recvfrom, and close interfaces; The dynamic library is loaded by setting the LD_PRELOAD environment variable, and the NGC and NR processes are started to replace the APIs of all UDP sockets; Implement a constructor socket_hook_init to implement interface overloading through the dlsym function and initialize the shared memory ring queue, lock, etc.; Implement the socket interface to record sockets using the UDP protocol; Implement the bind interface to filter the socket of port 2152 and create a real communication channel, using the famous Linux pipe FIFO implementation; Implement the sendto interface to determine whether sockfd is the fd of GTPU. If so, use the accelerated interface to send data, otherwise use the native interface to send data; Implement the recvfrom interface to determine whether sockfd is the GTPU fd. If so, use the accelerated interface to receive data, otherwise use the native interface to receive data. Use the cache mechanism to cache 32 buffs at a time and then send them all at once. If 32 buffs are not reached, a 1ms timer is used to trigger data sending.

2. The method according to claim 1, characterized in that The dynamic library is loaded by setting the LD_PRELOAD environment variable, and automatic replacement can be achieved without changing the code of NGC and NR.

3. The method according to claim 1, characterized in that The overloaded socket API includes but is not limited to socket, bind, sendto, recvfrom, and close interfaces.

4. The method according to claim 1, characterized in that: The method uses FIFO and a shared memory circular queue to realize accelerated data transmission.

5. The method according to claim 1, characterized in that The method triggers data transmission through a timer, and the timeout period of the timer is 1ms.

6. The method according to claim 1, characterized in that The method uses an atomic operation in a sendto interface to obtain a current write pointer, copies user-state data to the buff pointed to by the obtained circular queue write pointer, and updates the offset of the write pointer.

7. The method according to claim 1, characterized in that The method obtains whether there is data cache currently through an atomic variable in the recvfrom interface, and if so, directly copies the data of the pointer corresponding to the ring buff to the user state buff.

8. A computer program product for implementing the method according to any one of claims 1 to 7, characterized in that: The computer program product includes a dynamic library, the dynamic library is used to reload the socket API, and the dynamic library is configured to be loaded by setting the LD_PRELOAD environment variable.

9. A computer system, characterized in that: The computer system comprises a processor and a memory, wherein a computer program is stored in the memory, and the computer program comprises the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program includes the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Linux pipeline communication performance optimization method

    CN120892229A