CN113490162B - Optimization method for multicast data stream forwarding - Google Patents

Optimization method for multicast data stream forwarding Download PDF

Info

Publication number
CN113490162B
CN113490162B CN202110754049.6A CN202110754049A CN113490162B CN 113490162 B CN113490162 B CN 113490162B CN 202110754049 A CN202110754049 A CN 202110754049A CN 113490162 B CN113490162 B CN 113490162B
Authority
CN
China
Prior art keywords
multicast
data stream
interface
linux kernel
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110754049.6A
Other languages
Chinese (zh)
Other versions
CN113490162A (en
Inventor
武斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xinhe Semiconductor Technology Wuxi Co Ltd
Original Assignee
Xinhe Semiconductor Technology Wuxi Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xinhe Semiconductor Technology Wuxi Co Ltd filed Critical Xinhe Semiconductor Technology Wuxi Co Ltd
Priority to CN202110754049.6A priority Critical patent/CN113490162B/en
Publication of CN113490162A publication Critical patent/CN113490162A/en
Application granted granted Critical
Publication of CN113490162B publication Critical patent/CN113490162B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • H04W4/08User group management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/02Communication route or path selection, e.g. power-based or shortest path routing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses an optimization method for forwarding multicast data stream under linux, which comprises the following steps: registering a function handle _ multicast _ frame _ hook for processing the multicast data stream in a handling function __, a broadcast _ receive _ skb _ core, for receiving the data packet by the linux kernel; when the igmp proxy adds a multicast routing forwarding item to the linux kernel, the igmp proxy sends a corresponding binding relationship between a multicast group and an outgoing interface to the linux kernel through a proc file, a handle _ multicast _ frame _ hook function searches the outgoing interface of the corresponding multicast group according to a received multicast data stream, and then directly calls a sending function ndo _ start _ xmit of the outgoing interface to send the multicast data stream out of the outgoing interface.

Description

Optimization method for multicast data stream forwarding
Technical Field
The invention relates to the technical field of multicast data stream, in particular to an optimization method for forwarding multicast data stream.
Background
Currently, the operation of the igmp proxy under Linux depends on an mroute module in Linux kernel, and the flow of the igmp proxy is as follows:
the igmp proxy user process firstly creates an igmp raw socket (igmp original socket) for receiving an igmp packet, and simultaneously activates an mroute function in a Linux kernel through MRT _ INIT.
And 2, the igmp proxy user process creates a VIF virtual network device in the linux kernel through MRT _ ADD _ VIF, and then continuously monitors the igmp raw socket.
3. When receiving a join group message sent by a host on a downlink interface from an igmp raw socket, if the host is the first host in the network, the igmp proxy creates a new multicast routing table to record the multicast group, and simultaneously starts an uplink interface to send the join group message upwards.
4. When the upstream interface receives the data stream of the group, the igmp proxy adds the multicast routing forwarding item of the group, and the Linux kernel forwards the multicast data stream according to the multicast routing forwarding item.
5. When receiving a leave group message sent by a host on a downlink interface from an igmp raw socket, if the host is the last host in the network, the igmp proxy deletes the multicast routing table, deletes a multicast routing forwarding item in a linux kernel, and starts an uplink interface to send the leave group message upwards.
6. When receiving general group query and specific group query messages sent by an uplink interface from an igmp raw socket, the igmp proxy searches a multicast routing table to see whether a multicast group exists, and responds to the multicast query of a server if the multicast group exists.
Forwarding of the multicast data stream of igmp proxy under normal linux is to determine an interface from which the multicast data stream should be sent out by searching a corresponding multicast route forwarding item on an ip layer. Therefore, forwarding must be processed by filtering of each hook function of the netfilter, routing of the ip layer and the like, and forwarding efficiency is affected.
The method of the invention uses a processing function handle _ multicast _ frame _ hook for registering the multicast data stream in a processing function __ nertif _ receive _ skb _ core for receiving the data packet by linux kernel, and finds the outgoing interface of the multicast data stream according to the corresponding binding relationship between the multicast group and the outgoing interface in the function, thereby directly forwarding the multicast data stream from the corresponding outgoing interface at the inlet. Therefore, the processing flow of the multicast data stream can be simplified, and the forwarding efficiency of the multicast data stream is improved.
Disclosure of Invention
The invention aims to provide an optimization method for multicast data stream forwarding, which can reduce the processing of multicast data streams in linux kernel when a large number of multicast data streams needing to be forwarded exist in linux kernel, thereby improving the forwarding efficiency of the multicast data streams under linux kernel and solving the problems provided in the background art.
In order to achieve the purpose, the invention provides the following technical scheme:
an optimization method for multicast data stream forwarding specifically comprises the following steps:
(1) firstly, creating and registering a linux kernel module gcmulticast, wherein the module is used for maintaining the corresponding binding relationship between a multicast group and an outgoing interface and providing a processing function handle _ multicast _ frame _ hook for a registered multicast data stream.
The module provides a corresponding interface for reading and writing the binding relation corresponding to the multicast group and the output interface, and the interface is opened to a user space through a proc file system and is provided for a user space process igmp proxy to use.
(2) Under linux, when a multicast data stream arrives, linux kernel sends a message to igmp proxy, and igmp proxy ADDs a multicast routing forwarding item to linux kernel through MRT _ ADD _ MFC when receiving the multicast data stream arrival message.
And adding the multicast routing forwarding item, and adding the binding relationship between the multicast group and the corresponding output interface into the kernel through a proc interface provided by the kernel module gcmulticast.
When the igmp proxy receives a leave group message sent by a host on a downlink interface, if the host is the last host in the networking, the igmp proxy deletes the multicast routing table, and meanwhile, deletes a multicast routing forwarding item in the linux kernel through the MRT _ DEL _ MFC. And deleting the binding relation between the multicast group and the corresponding output interface from the kernel through a proc interface provided by the kernel module gcmulticast while deleting the multicast routing forwarding item.
(3) The function handle _ multicast _ frame _ hook for processing the multicast data stream is registered in the processing function __, new _ receive _ skb _ core, which receives the packet in the linux kernel. The handle _ multicast _ frame _ hook is implemented in a linux kernel module gcmulticast, the function filters the multicast data packet according to the destination address of the data packet, and if the multicast data packet is not the multicast data packet, the function returns directly.
Then searching the binding relation between the multicast group and the corresponding output interface according to the destination address of the multicast data packet, if the corresponding output interface is found, directly sending the data packet out from the output interface, and simultaneously not executing the subsequent receiving process; if the outgoing interface is not found, the function directly returns to continue executing the subsequent receiving process.
Compared with the prior art, the invention has the advantages that:
1. the method provided by the invention can improve the forwarding efficiency of the multicast data stream in the linux kernel.
2. Under the condition that no special hardware is used for realizing hardware forwarding of the multicast data stream, the forwarding of the multicast data stream is optimized on a software level, and the processing flow of the multicast data stream in linux kernel is simplified.
Drawings
FIG. 1 is a flowchart of maintaining a binding relationship between a multicast group and an egress interface in a kernel module gcmulticast according to the present invention.
Fig. 2 is a flowchart illustrating the processing of the function handle _ multicast _ frame _ hook for processing multicast data stream according to the present invention.
Detailed Description
The technical solution of the present patent will be described in further detail with reference to the following embodiments.
Currently, multicast forwarding realized through the igmp proxy under linux is to maintain a multicast routing table in the igmp proxy, and when a multicast data stream arrives, a multicast routing forwarding table entry is added to linux kernel through the igmp proxy, so that the multicast data stream is forwarded through a multicast routing forwarding item in linux kernel.
An optimization method for multicast data stream forwarding specifically comprises the following steps:
step 1: as shown in FIG. 1, a kernel module gcmulticast is created first; gcmulticast is used for maintaining the binding relationship between the multicast group and the output interface under linux kernel, and the data structure for binding is as follows:
#define MAX_OUT_IF 4
#define IFNAMSIZ 16
typedef struct gcGroupBindInterface_s
{
unsigned int group;
char if_name[MAX_OUT_IF][IFNAMSIZ];
struct list_head list;
}gcGroupBindInterface_t;
group: representing a multicast group; IF _ name represents an egress interface, and the maximum number of egress interfaces that the same group can support is defined by the macro MAX _ OUT _ IF.
Step 2: the gcmulticast kernel module firstly initializes a multicast group and output interface binding relation list g _ group, and then initializes a corresponding proc interface for reading and writing the multicast group and output interface binding relation. When a multicast data stream arrives, the igmp proxy calls a corresponding proc interface to add a binding relationship between a multicast group and an output interface to gcmulticast while adding a multicast route forwarding item. And dynamically allocating a gcGroupBindInterface _ t structure in the gcmulticast to store the binding relationship, and simultaneously inserting the dynamically allocated gcGroupBindInterface _ t structure into a g _ group list.
And step 3: when the igmp proxy receives a leave group message sent by a host on a downlink interface, if the host is the last host in the networking, the igmp proxy calls a corresponding proc interface to delete the binding relationship between the multicast group and the exit interface in gcmulticast while deleting the multicast routing forwarding item in linux kernel. And searching a corresponding gcGroupBindInterface _ t structure according to the corresponding multicast group in the gcmulticast, deleting the structure from the g _ group list, and releasing a corresponding memory.
And 4, step 4: the gcmulticast kernel module provides a function handle _ multicast _ frame _ hook for processing multicast data streams, which is registered in __ nertif _ receive _ skb _ core. The flow of processing for multicast data streams is shown in fig. 2. The function firstly judges whether the destination address of the received data packet is a multicast address, and if not, the function directly returns to 0; if the multicast address is the reserved multicast address, then judging whether the multicast address is the reserved multicast address, and if so, directly returning to 0; and if not, inquiring a corresponding outgoing interface from the g _ group list according to the destination address of the data packet, if the corresponding outgoing interface is found, sending the data packet out from the corresponding outgoing interface and returning the function to 1, and if the corresponding outgoing interface cannot be found, directly returning to 0. __ the return value of handle _ multicast _ frame _ hook is determined to determine whether the packet continues to be received.
And 5: when the gcmulticast kernel module is logout, the corresponding proc interface is deleted firstly, then the g _ group list is traversed, the binding relationship between all multicast groups and the output interface is deleted, and the corresponding memory is released at the same time.
Although the preferred embodiments of the present invention have been described in detail, the present invention is not limited to the above embodiments, and various changes can be made without departing from the spirit of the present invention within the knowledge of those skilled in the art.

Claims (4)

1. An optimization method for forwarding multicast data streams is characterized by comprising the following steps:
(1) firstly, registering a function handle _ multicast _ frame _ hook for processing a multicast data stream in a processing function __ (recent _ receive _ skb _ core) for receiving a data packet by a linux kernel;
(2) when a multicast data stream is received for the first time, the igmp proxy adds a multicast routing forwarding item to the Linux kernel, and simultaneously the igmp proxy sends the corresponding binding relationship between a multicast group and an output interface to the Linux kernel through a proc interface;
(3) firstly, detecting whether a destination address of a data packet is a multicast address or not in handle _ multicast _ frame _ hook, and excluding a reserved multicast address; then, according to the destination ip address of the data packet, searching the corresponding binding relationship between the multicast group issued by the igmp proxy and the output interface; if the corresponding output interface can not be found, the function returns to 0, and the data packet continues to go down according to the receiving path; if the corresponding outgoing interface is found, the data packet is directly sent out from the outgoing interface according to the found outgoing interface, and meanwhile, the function returns to 1, __, the function returns to _ receive _ skb _ core directly.
2. The method of claim 1, wherein the function handle _ multicast _ frame _ hook is used to parse and process the multicast data stream.
3. The method of claim 1, wherein the handle _ multicast _ frame _ hook is implemented in linux kernel module gcmulticast.
4. The method of claim 3, wherein the gcmulticast module is configured to maintain a corresponding binding relationship between a multicast group and an egress interface.
CN202110754049.6A 2021-07-04 2021-07-04 Optimization method for multicast data stream forwarding Active CN113490162B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110754049.6A CN113490162B (en) 2021-07-04 2021-07-04 Optimization method for multicast data stream forwarding

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110754049.6A CN113490162B (en) 2021-07-04 2021-07-04 Optimization method for multicast data stream forwarding

Publications (2)

Publication Number Publication Date
CN113490162A CN113490162A (en) 2021-10-08
CN113490162B true CN113490162B (en) 2022-05-17

Family

ID=77939847

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110754049.6A Active CN113490162B (en) 2021-07-04 2021-07-04 Optimization method for multicast data stream forwarding

Country Status (1)

Country Link
CN (1) CN113490162B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1474563A (en) * 2002-08-06 2004-02-11 ��Ϊ�������޹�˾ Repeating method for multi-broadcast message in network communication
CN101702672A (en) * 2009-11-04 2010-05-05 华为技术有限公司 Forwarding method and forwarding device for multicast data message
CN102316083A (en) * 2010-07-06 2012-01-11 杭州华三通信技术有限公司 Method and device for realizing multicast service in Internet protocol (IP) network
CN102694734A (en) * 2012-06-11 2012-09-26 烽火通信科技股份有限公司 Multicasting method of double-layer switching equipment based on Linux kernel bridge
CN102820977A (en) * 2012-08-07 2012-12-12 福建星网锐捷网络有限公司 Multicast method, multicast device and network device
CN104796340A (en) * 2014-01-22 2015-07-22 杭州华三通信技术有限公司 Multicast data transmission method and device
CN106470171A (en) * 2016-09-18 2017-03-01 杭州迪普科技股份有限公司 The delivery method of multicast forwarding list item and device
WO2018121584A1 (en) * 2016-12-30 2018-07-05 中兴通讯股份有限公司 Data stream transmission method, apparatus, related devices and storage medium
CN109495406A (en) * 2017-09-13 2019-03-19 中兴通讯股份有限公司 The retransmission method and forwarding device of multicasting virtual private network network VPN flow

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1474563A (en) * 2002-08-06 2004-02-11 ��Ϊ�������޹�˾ Repeating method for multi-broadcast message in network communication
CN101702672A (en) * 2009-11-04 2010-05-05 华为技术有限公司 Forwarding method and forwarding device for multicast data message
CN102316083A (en) * 2010-07-06 2012-01-11 杭州华三通信技术有限公司 Method and device for realizing multicast service in Internet protocol (IP) network
CN102694734A (en) * 2012-06-11 2012-09-26 烽火通信科技股份有限公司 Multicasting method of double-layer switching equipment based on Linux kernel bridge
CN102820977A (en) * 2012-08-07 2012-12-12 福建星网锐捷网络有限公司 Multicast method, multicast device and network device
CN104796340A (en) * 2014-01-22 2015-07-22 杭州华三通信技术有限公司 Multicast data transmission method and device
CN106470171A (en) * 2016-09-18 2017-03-01 杭州迪普科技股份有限公司 The delivery method of multicast forwarding list item and device
WO2018121584A1 (en) * 2016-12-30 2018-07-05 中兴通讯股份有限公司 Data stream transmission method, apparatus, related devices and storage medium
CN109495406A (en) * 2017-09-13 2019-03-19 中兴通讯股份有限公司 The retransmission method and forwarding device of multicasting virtual private network network VPN flow

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于IGMP的IPTV应用系统设计;许广达;《硕士学位论文 专辑:信息科技 专题:电信技术》;20140715;第3-4节 *
嵌入式Linux上的IGMPProxy研究与实现;刘杰等;《武汉理工大学学报·信息与管理工程版》;20080630;第30卷(第3期);全文 *

Also Published As

Publication number Publication date
CN113490162A (en) 2021-10-08

Similar Documents

Publication Publication Date Title
US10097689B2 (en) System and methods for integrating short message service messaging with contact center applications
CN101409685B (en) Forwarding method based on virtual LAN mapping and access equipment
US6178453B1 (en) Virtual circuit switching architecture
US7031338B2 (en) System and method for the consolidation of data packets
CN100566282C (en) The Apparatus and method for of control transmitting multicast data
US20070011350A1 (en) Method and apparatus for multicast management of user interface in a network access device
RU2007134860A (en) METHOD AND SYSTEM OF INTELLECTUAL ROUTING
WO2013075436A1 (en) Radio resource optimization method, device and system
CN101360054A (en) Data transmission system and method
CN106685827B (en) Downlink message forwarding method and AP (access point) equipment
US8819135B2 (en) Method of performing data mediation, and an associated computer program product, data mediation device and information system
CN109587082A (en) A kind of asynchronous repeater system of message based on (SuSE) Linux OS and method
US20060209774A1 (en) Wireless base station, wireless mobile device, and wireless access network
CN100359891C (en) Method for improving multimedia message central service processing property by buffer storage
CN101132374A (en) Method and device for transmitting message
CN101009669B (en) A method and system and route device for transmitting the multicast message
EP1917580B1 (en) Peer-to-peer communication system
CN113490162B (en) Optimization method for multicast data stream forwarding
CN107483628A (en) Unidirectional proxy method and system based on DPDK
CN109787903B (en) Non-collision multicast data feedback method in centralized network
CN101227306A (en) Method and apparatus for copying message for multi-broadcast treatment
US9596577B1 (en) Relaying mobile communications
CN100455049C (en) Method for processing message in multimedia message service system
WO2009103196A1 (en) System and method for sending multimedia message storage address
CN110061922B (en) Message forwarding method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant