message communication method and device between network elements

文档序号:1711821 发布日期:2019-12-13 浏览:15次 中文

阅读说明:本技术 一种网元间消息通信方法及装置 (message communication method and device between network elements ) 是由 贾国栋 陈剑 于 2018-06-06 设计创作,主要内容包括:本发明提供了一种网元间消息通信方法及装置。所述方法包括:接收源SFU发送目标消息;其中,所述目标消息的消息头中包含中转字段,所述中转字段用于指示处理所述目标消息的目的SFU;判断所述源SFU和所述目的SFU是否处于同一网元内部;若否,则依据所述中转字段选择预置传输协议将所述目标消息发送至目标网元。本发明通过增加消息头中一个中转字段将源SFU的目标消息发送至不同网元的目的SFU进行处理,从而实现了网元间通信。(The invention provides a method and a device for message communication between network elements. The method comprises the following steps: receiving a target message sent by a source SFU; the target message comprises a transfer field in a message header, wherein the transfer field is used for indicating a target SFU for processing the target message; judging whether the source SFU and the destination SFU are in the same network element; if not, a preset transmission protocol is selected according to the transfer field to send the target message to a target network element. The invention sends the target message of the source SFU to the target SFU of different network elements for processing by adding a transfer field in the message header, thereby realizing the communication between the network elements.)

1. A method for communicating messages between network elements, comprising:

Receiving a target message sent by a source SFU; the target message comprises a transfer field in a message header, wherein the transfer field is used for indicating a target SFU for processing the target message;

Judging whether the source SFU and the destination SFU are in the same network element;

if not, a preset transmission protocol is selected according to the transfer field to send the target message to a target network element.

2. the method of claim 1, wherein the predetermined transport protocol comprises a user datagram protocol, and wherein the step of selecting the predetermined transport protocol according to the transfer field to send the target message to the target network element comprises:

Acquiring a link identifier from a source driving module to a source network processor, and adding the link identifier into the message header;

Calling a registration function corresponding to the source driving module to send the target message to the source network processor;

And the source network processor acquires the destination address of the machine frame where the destination SFU is positioned according to the message header and sends the target message to the target network element according to the destination address.

3. The method of claim 1, wherein the preset transport protocol comprises a stream control transport protocol, and wherein the step of selecting the preset transport protocol according to the transfer field to send the target message to the target network element comprises:

Calculating the proxy SFU address according to the transfer field;

And forwarding the target message to the proxy SFU according to the proxy SFU address, and calling a corresponding sending function by the proxy SFU to send the target message to a target network element.

4. The method of claim 1, wherein after the step of selecting the corresponding transport protocol according to the transfer field and sending the target message to the target network element, the method further comprises:

The target network processor receives the target message and sends the target message to a target driving module; wherein, the target message also contains a target SFUID;

And the target driving module calls an operating system platform sending function according to the target SFUID to send the target message to a message queue of the process of the target SFU.

5. the method of claim 1, wherein after the step of determining whether the source SFU and the destination SFU are located within the same network element, further comprising:

And when the source SFU and the target SFU are determined to be positioned in the same network element, sending the target message according to an intra-process communication mode or an inter-board communication mode.

6. An inter-network element message communication apparatus, comprising:

The receiving module is used for receiving a target message sent by a source SFU; the target message comprises a transfer field in a message header, wherein the transfer field is used for indicating a target SFU for processing the target message;

The judging module is used for judging whether the source SFU and the destination SFU are positioned in the same network element;

and the sending module is used for selecting a preset transmission protocol according to the transfer field and sending the target message to the target network element when the source SFU and the target SFU are not in the same network element.

7. The apparatus of claim 6, wherein the preset transport protocol comprises a user datagram protocol, and wherein the sending module comprises:

The link identification acquisition submodule is used for acquiring the link identification from the source drive module to the source network processor and adding the link identification into the message header;

The first sending submodule is used for calling a registration function corresponding to the source driving module to send the target message to the source network processor;

and the second sending submodule is used for the source network processor to obtain the destination address of the machine frame where the destination SFU is located according to the message header and send the destination message to the destination network element according to the destination address.

8. the apparatus of claim 6, wherein the preset transmission protocol comprises a stream control transmission protocol, and wherein the sending module comprises:

The calculation submodule is used for calculating the proxy SFU address according to the transfer field;

and the third sending submodule is used for forwarding the target message to the proxy SFU according to the proxy SFU address, and calling a corresponding sending function by the proxy SFU to send the target message to a target network element.

9. the apparatus of claim 6, further comprising:

The target message receiving and sending module is used for receiving the target message by the target network processor and sending the target message to the target driving module; wherein, the target message also contains a target SFUID;

and the target sending module is used for calling an operating system platform sending function by the target driving module according to the target SFUID to send the target message to a message queue of the process where the target SFU is located.

10. The apparatus of claim 6, further comprising:

And each communication mode sending module is used for sending the target message according to an intra-process communication mode or an inter-board communication mode when the source SFU and the target SFU are determined to be positioned in the same network element.

Technical Field

The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for communicating messages between network elements.

Background

At present, message communication mechanisms used in a base station are all self-defined communication mechanisms inside network elements, and TCP (Transmission Control Protocol) and UDP (User Data Protocol) links for communication inside a board card and between the board cards are all head links with self-defined OSP (Operating system platform) message headers.

The current base station communication mechanisms are mainly divided into the following three types:

1. In-process communication: in an SMP (symmetric multi-Processing) Linux System, an API (application programming Interface) function provided by a posix (Portable Operating System Interface) is used for intra-process communication, and a thread in a process realizes message communication through a message queue;

2. Inter-process communication: in an SMP Linux system, interprocess communication is also realized through an API function provided by posix, and because all sent addresses are message memory addresses, interprocess message content copying needs to be carried out through an interprocess shared memory pool, and then message addresses are sent for communication;

3. Communication between boards: and the inter-board communication calls a bottom-layer network card driver to directly send the message, and the message is exchanged to a target board card through Ethernet to realize message communication.

In the current base station communication system, because the message source and the message destination are both in the same network element, a customized OSP (Operating system platform) message header is added in front of the message content, and a user determines the processing task of the message by filling in a source sfu (software Function unit) and a destination sfu in the OSP message header.

the specific data structure is as follows:

And calling a platform registered message sending function Osp _ Send _ Msg () interface to Send the message after the user fills in the OSP message header. The Osp _ Send _ Msg () function decides whether to Send a message through a posix interface or Send a message through a network card driver according to the transmission source and destination input by the user. If the target sfu task is an in-process or inter-process message, finding a corresponding message queue ID directly according to a target task ID filled by a user, calling a posix layer message sending function, and directly hanging the message queue of the target sfu; if the target sfu task is on another board card, the sending function can calculate the IP and MAC address of the target board card according to the ID of the target board card, and then the sending function of the driver is called to send the user data to the target board card through the internal network.

And the user side receives the message through an Osp _ Msg _ Receive () interface, and the message received by the posix interface is encapsulated inside the function. When no message exists in the communication between the processes, the task is in a blocking state, and when the message is hung in the message queue, the kernel directly awakens the receiving task to start processing the message content. The received message is driven by the network card, and because the data received by the network card contains an OSP message header filled by a user, the network card receiving task finally calls a posix sending function to Send the message to the receiving task of the local card by calling the Osp _ Send _ Msg (), and the Osp message header is internally analyzed.

As can be seen from the above, in the prior art, in the message sent through the driver link, the driver calculates the IP address of the opposite end according to the purpose filled by the user, and there is a possibility that the IPs between the network element units may conflict, so that the message communication between the network elements cannot be performed.

Disclosure of Invention

the invention provides a method and a device for message communication between network elements, which aim to solve the problem that the message communication between the network elements cannot be realized in the prior art.

In order to solve the above problem, the present invention discloses a method for message communication between network elements, comprising: receiving a target message sent by a source SFU; the target message comprises a transfer field in a message header, wherein the transfer field is used for indicating a target SFU for processing the target message; judging whether the source SFU and the destination SFU are in the same network element; if not, a preset transmission protocol is selected according to the transfer field to send the target message to a target network element.

preferably, the preset transport protocol includes a user datagram protocol, and the step of selecting the preset transport protocol according to the transfer field and sending the target message to the target network element includes: acquiring a link identifier from a source driving module to a source network processor, and adding the link identifier into the message header; calling a registration function corresponding to the source driving module to send the target message to the source network processor; and the source network processor acquires the destination address of the machine frame where the destination SFU is positioned according to the message header and sends the target message to the target network element according to the destination address.

Preferably, the preset transmission protocol includes a stream control transmission protocol, and the step of selecting the preset transmission protocol according to the transfer field to send the target message to the target network element includes: calculating the proxy SFU address according to the transfer field; and forwarding the target message to the proxy SFU according to the proxy SFU address, and calling a corresponding sending function by the proxy SFU to send the target message to a target network element.

Preferably, after the step of selecting the corresponding transmission protocol according to the transfer field and sending the target message to the target network element, the method further includes: the target network processor receives the target message and sends the target message to a target driving module; wherein, the target message also contains a target SFUID; and the target driving module calls an operating system platform sending function according to the target SFUID to send the target message to a message queue of the process of the target SFU.

Preferably, after the step of determining whether the source SFU and the destination SFU are located inside the same network element, the method further includes: and when the source SFU and the target SFU are determined to be positioned in the same network element, sending the target message according to an intra-process communication mode or an inter-board communication mode.

in order to solve the above problem, the present invention also discloses an inter-network-element message communication apparatus, including: the receiving module is used for receiving a target message sent by a source SFU; the target message comprises a transfer field in a message header, wherein the transfer field is used for indicating a target SFU for processing the target message; the judging module is used for judging whether the source SFU and the destination SFU are positioned in the same network element; and the sending module is used for selecting a preset transmission protocol according to the transfer field and sending the target message to the target network element when the source SFU and the target SFU are not in the same network element.

preferably, the preset transmission protocol includes a user datagram protocol, and the sending module includes: the link identification acquisition submodule is used for acquiring the link identification from the source drive module to the source network processor and adding the link identification into the message header; the first sending submodule is used for calling a registration function corresponding to the source driving module to send the target message to the source network processor; and the second sending submodule is used for the source network processor to obtain the destination address of the machine frame where the destination SFU is located according to the message header and send the destination message to the destination network element according to the destination address.

preferably, the preset transmission protocol includes a stream control transmission protocol, and the sending module includes: the calculation submodule is used for calculating the proxy SFU address according to the transfer field; and the third sending submodule is used for forwarding the target message to the proxy SFU according to the proxy SFU address, and calling a corresponding sending function by the proxy SFU to send the target message to a target network element.

Preferably, the method further comprises the following steps: the target message receiving and sending module is used for receiving the target message by the target network processor and sending the target message to the target driving module; wherein, the target message also contains a target SFUID; and the target sending module is used for calling an operating system platform sending function by the target driving module according to the target SFUID to send the target message to a message queue of the process where the target SFU is located.

Preferably, the method further comprises the following steps: and each communication mode sending module is used for sending the target message according to an intra-process communication mode or an inter-board communication mode when the source SFU and the target SFU are determined to be positioned in the same network element.

compared with the prior art, the invention has the following advantages:

the embodiment of the invention provides a method and a device for message communication between network elements, which are used for sending a target message by receiving a source SFU, wherein the message header of the target message comprises a transfer field and a target SFU, judging whether the source SFU and the target SFU are positioned in the same network element, if not, selecting a preset transmission protocol according to the transfer field to send the target message to the target network element. The embodiment of the invention is based on the existing communication mechanism in the network element and sends the target message of the source SFU to the target SFU of different network elements for processing by adding a transfer field in the message header, thereby realizing the communication between the network elements.

Drawings

Fig. 1 is a flowchart illustrating steps of a method for communicating messages between network elements according to an embodiment of the present invention;

Fig. 2 is a flowchart illustrating steps of a method for communicating messages between network elements according to an embodiment of the present invention;

fig. 3 is a schematic structural diagram illustrating an inter-network element message communication apparatus according to an embodiment of the present invention.

Detailed Description

in order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种桌面静置报警方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类