[go: up one dir, main page]

CN102025796A - MAC (media access control) address updating method and device - Google Patents

MAC (media access control) address updating method and device Download PDF

Info

Publication number
CN102025796A
CN102025796A CN2010105572526A CN201010557252A CN102025796A CN 102025796 A CN102025796 A CN 102025796A CN 2010105572526 A CN2010105572526 A CN 2010105572526A CN 201010557252 A CN201010557252 A CN 201010557252A CN 102025796 A CN102025796 A CN 102025796A
Authority
CN
China
Prior art keywords
address
list item
multicast
multicast group
port numbers
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.)
Granted
Application number
CN2010105572526A
Other languages
Chinese (zh)
Other versions
CN102025796B (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201010557252.6A priority Critical patent/CN102025796B/en
Publication of CN102025796A publication Critical patent/CN102025796A/en
Priority to PCT/CN2011/075002 priority patent/WO2012068854A1/en
Application granted granted Critical
Publication of CN102025796B publication Critical patent/CN102025796B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • H04L61/103Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5069Address allocation for group communication, multicast communication or broadcast communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Landscapes

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

Abstract

本发明公开了一种MAC地址更新的方法,用于实现对MAC地址的统一更新及维护。所述方法包括:根据收到的报文获得网际协议版本4IPv4版本的组播组IP地址或网际协议版本6IPv6版本的组播组IP地址;当获得IPv4版本的组播组IP地址时,将获得的IPv4版本的组播组IP地址映射为组播媒体接入控制MAC地址;当获得IPv6版本的组播组IP地址时,将获得的IPv6版本的组播组IP地址映射为组播MAC地址;根据获得的组播MAC地址更新公共MAC地址表。本发明还公开了用于实现所述方法的装置。

Figure 201010557252

The invention discloses a method for updating a MAC address, which is used for realizing the unified update and maintenance of the MAC address. The method includes: obtaining the multicast group IP address of the Internet Protocol version 4 IPv4 version or the multicast group IP address of the Internet Protocol version 6 IPv6 version according to the received message; when obtaining the multicast group IP address of the IPv4 version, will obtain The multicast group IP address of the IPv4 version is mapped to the multicast media access control MAC address; when the multicast group IP address of the IPv6 version is obtained, the multicast group IP address of the obtained IPv6 version is mapped to the multicast MAC address; Update the public MAC address table according to the obtained multicast MAC address. The invention also discloses a device for realizing the method.

Figure 201010557252

Description

一种MAC地址更新方法及装置 Method and device for updating MAC address

技术领域technical field

本发明涉及通信领域,特别涉及一种MAC地址更新方法及装置。The invention relates to the communication field, in particular to a method and device for updating a MAC address.

背景技术Background technique

由于目前IPv4(Internet Protocol version 4,网际协议版本4)网络存在这地址空间不足的问题,所以以IPv6(Internet Protocol version 6,网际协议版本6)为核心的下一代互联网协议已经从研究阶段走向实用。与IPv4的32位地址长度相比,IPv6的128位地址长度不仅能够满足全球用户对IP地址的需求,还能够在安全性、移动性、服务质量等各方面提供更好的支持,因此IPv6取代IPv4已成为网络发展的必然趋势。但由于目前的互联网还属于IPv6发展的初期,现有的IPv4网络具备相当的规模,为了保护现有设备和投资,网络不可能一次性更替到IPv6,而是将面临一个长期的IPv4、IPv6并存的过程。目前只有做好IPV4和IPV6网络的融合,才能实现平稳过渡。Due to the problem of insufficient address space in the current IPv4 (Internet Protocol version 4, Internet Protocol version 4) network, the next-generation Internet protocol with IPv6 (Internet Protocol version 6, Internet Protocol version 6) as the core has moved from the research stage to practical use. . Compared with the 32-bit address length of IPv4, the 128-bit address length of IPv6 can not only meet the needs of global users for IP addresses, but also provide better support in aspects such as security, mobility, and service quality. Therefore, IPv6 replaces IPv4 has become an inevitable trend of network development. However, since the current Internet is still in the initial stage of IPv6 development, and the existing IPv4 network has a considerable scale, in order to protect existing equipment and investment, the network cannot be replaced to IPv6 at one time, but will face a long-term coexistence of IPv4 and IPv6 the process of. At present, a smooth transition can only be achieved if the integration of IPV4 and IPV6 networks is done well.

组播技术的基本原理是利用IGMP(Internet Group Management Protocol,互联网组播管理协议)或者MLD(Multicast Listener Discovery,组播侦听发现)维护组播组关系。IGMP(IPv4)或MLD(IPv6中)运行于三层设备上,对于组播接收者加入或离开组播组进行动态管理,并建立三层组播转发表项。同时,二层设备上运行IGMP Snooping(Internet Group Management Protocol Snooping,互联网组播管理协议窥探)或者MLD Snooping(Multicast Listener DiscoverySnooping,组播侦听发现窥探),分别配置了IGMP协议或者MLD协议的三层设备与组播接收者之间的IGMP报文或MLD报文,根据报文在二层设备上建立和维护MAC组播地址表。以后二层设备收到的组播数据报文就根据该MAC组播地址表进行转发,实现组播数据报文的二层组播。The basic principle of multicast technology is to use IGMP (Internet Group Management Protocol, Internet Multicast Management Protocol) or MLD (Multicast Listener Discovery, Multicast Listener Discovery) to maintain multicast group relationships. IGMP (IPv4) or MLD (in IPv6) runs on Layer 3 devices, dynamically manages multicast receivers joining or leaving a multicast group, and establishes Layer 3 multicast forwarding entries. At the same time, IGMP Snooping (Internet Group Management Protocol Snooping, Internet Multicast Management Protocol Snooping) or MLD Snooping (Multicast Listener Discovery Snooping, Multicast Listener Discovery Snooping, Multicast Listener Discovery Snooping) is run on the second-layer device, and the third-layer of IGMP protocol or MLD protocol is configured respectively. According to the IGMP message or MLD message between the device and the multicast receiver, the MAC multicast address table is established and maintained on the Layer 2 device. Afterwards, the multicast data packets received by the Layer 2 device are forwarded according to the MAC multicast address table, so as to implement the Layer 2 multicast of the multicast data packets.

现有技术中,在同时支持IPv4和IPv6的双协议栈二层设备上,IPV4协议栈和IPv6协议栈可能会分别独立维护各自的MAC组播地址表,这样不仅会造成硬件资源的浪费,软件实现上也会增加复杂度,且不便于对MAC地址进行安全管理。In the prior art, on a dual protocol stack layer 2 device supporting both IPv4 and IPv6, the IPV4 protocol stack and the IPv6 protocol stack may maintain their own MAC multicast address tables independently, which will not only cause waste of hardware resources, but also cause a waste of software resources. The implementation will also increase the complexity, and it is not convenient to perform security management on the MAC address.

发明内容Contents of the invention

本发明实施例提供一种MAC地址更新方法,用于实现对MAC地址的统一更新及维护,及一种组播方法,用于实现根据统一的MAC地址对数据进行组播。The embodiment of the present invention provides a MAC address update method for realizing unified update and maintenance of MAC addresses, and a multicast method for realizing multicast of data according to a unified MAC address.

一种MAC地址更新方法,包括以下步骤:A method for updating a MAC address, comprising the steps of:

根据收到的报文获得网际协议版本4IPv4版本的组播组IP地址或网际协议版本6IPv6版本的组播组IP地址;Obtain the multicast group IP address of the Internet Protocol version 4 IPv4 version or the multicast group IP address of the Internet Protocol version 6 IPv6 version according to the received message;

当获得IPv4版本的组播组IP地址时,将获得的IPv4版本的组播组IP地址映射为组播媒体接入控制MAC地址;当获得IPv6版本的组播组IP地址时,将获得的IPv6版本的组播组IP地址映射为组播MAC地址;When the multicast group IP address of the IPv4 version is obtained, the multicast group IP address of the obtained IPv4 version is mapped to the multicast media access control MAC address; when the multicast group IP address of the IPv6 version is obtained, the obtained IPv6 Version multicast group IP addresses are mapped to multicast MAC addresses;

根据获得的组播MAC地址更新公共MAC地址表。Update the public MAC address table according to the obtained multicast MAC address.

一种组播方法,包括以下步骤:A multicast method, comprising the following steps:

根据收到的报文获得IPv4版本的组播组IP地址或IPv6版本的组播组IP地址;Obtain the multicast group IP address of the IPv4 version or the multicast group IP address of the IPv6 version according to the received message;

当获得IPv4版本的组播组IP地址时,将获得的IPv4版本的组播组IP地址映射为组播媒体接入控制MAC地址;当获得IPv6版本的组播组IP地址时,将获得的IPv6版本的组播组IP地址映射为组播MAC地址;When the multicast group IP address of the IPv4 version is obtained, the multicast group IP address of the obtained IPv4 version is mapped to the multicast media access control MAC address; when the multicast group IP address of the IPv6 version is obtained, the obtained IPv6 Version multicast group IP addresses are mapped to multicast MAC addresses;

根据所述组播MAC地址在公共MAC地址表中查询与所述组播MAC地址对应的端口号,根据所述端口号进行数据转发。Querying the port number corresponding to the multicast MAC address in a public MAC address table according to the multicast MAC address, and forwarding data according to the port number.

一种MAC地址更新装置,包括:A device for updating a MAC address, comprising:

处理模块,用于根据收到的报文获得IPv4版本的组播组IP地址或IPv6版本的组播组IP地址;The processing module is used to obtain the multicast group IP address of the IPv4 version or the multicast group IP address of the IPv6 version according to the received message;

转换模块,用于当获得IPv4版本的组播组IP地址时,将获得的IPv4版本的组播组IP地址映射为组播媒体接入控制MAC地址;当获得IPv6版本的组播组IP地址时,将获得的IPv6版本的组播组IP地址映射为组播MAC地址;Conversion module, for when obtaining the multicast group IP address of IPv4 version, the multicast group IP address of obtained IPv4 version is mapped to the multicast media access control MAC address; When obtaining the multicast group IP address of IPv6 version , mapping the obtained IPv6 version multicast group IP address to a multicast MAC address;

执行模块,用于根据获得的组播MAC地址更新公共MAC地址表。The execution module is used for updating the public MAC address table according to the obtained multicast MAC address.

一种组播装置,包括:A multicast device, comprising:

处理模块,用于根据收到的报文获得IPv4版本的组播组IP地址或IPv6版本的组播组IP地址;The processing module is used to obtain the multicast group IP address of the IPv4 version or the multicast group IP address of the IPv6 version according to the received message;

转换模块,用于当获得IPv4版本的组播组IP地址时,将获得的IPv4版本的组播组IP地址映射为组播媒体接入控制MAC地址;当获得IPv6版本的组播组IP地址时,将获得的IPv6版本的组播组IP地址映射为组播MAC地址;Conversion module, for when obtaining the multicast group IP address of IPv4 version, the multicast group IP address of obtained IPv4 version is mapped to the multicast media access control MAC address; When obtaining the multicast group IP address of IPv6 version , mapping the obtained IPv6 version multicast group IP address to a multicast MAC address;

执行模块,用于根据所述组播MAC地址在公共MAC地址表中查询与所述组播MAC地址对应的端口号,根据所述端口号进行数据转发。An execution module, configured to query a public MAC address table for a port number corresponding to the multicast MAC address according to the multicast MAC address, and perform data forwarding according to the port number.

本发明实施例根据收到的报文获得网际协议版本4IPv4版本的组播组IP地址或网际协议版本6IPv6版本的组播组IP地址;当获得IPv4版本的组播组IP地址时,将获得的IPv4版本的组播组IP地址映射为组播媒体接入控制MAC地址;当获得IPv6版本的组播组IP地址时,将获得的IPv6版本的组播组IP地址映射为组播MAC地址;根据获得的组播MAC地址更新公共MAC地址表。IPv4及IPv6使用同一公共MAC地址表,实现了对MAC地址的统一更新及维护,节省了内存资源。The embodiment of the present invention obtains the multicast group IP address of the Internet Protocol version 4 IPv4 version or the multicast group IP address of the Internet Protocol version 6 IPv6 version according to the received message; when obtaining the multicast group IP address of the IPv4 version, the obtained The multicast group IP address of the IPv4 version is mapped to the multicast media access control MAC address; when the multicast group IP address of the IPv6 version is obtained, the multicast group IP address of the obtained IPv6 version is mapped to the multicast MAC address; according to The obtained multicast MAC address updates the public MAC address table. IPv4 and IPv6 use the same public MAC address table, which realizes unified update and maintenance of MAC addresses and saves memory resources.

附图说明Description of drawings

图1为本发明实施例中MAC地址更新装置的主要结构图;FIG. 1 is a main structural diagram of a MAC address updating device in an embodiment of the present invention;

图2为本发明实施例中MAC地址更新装置的详细结构图;FIG. 2 is a detailed structural diagram of a MAC address updating device in an embodiment of the present invention;

图3A为本发明实施例中MAC地址更新装置中处理模块的详细结构图;FIG. 3A is a detailed structural diagram of a processing module in a device for updating a MAC address in an embodiment of the present invention;

图3B为本发明实施例中MAC地址更新装置中执行模块的详细结构图;FIG. 3B is a detailed structural diagram of an execution module in a device for updating a MAC address in an embodiment of the present invention;

图4为本发明实施例中MAC地址更新方法的主要流程图;Fig. 4 is the main flowchart of the MAC address updating method in the embodiment of the present invention;

图5本发明实施例中收到的加入报文为IPv4版本时,获得IGMP Snooping表项的详细流程图;When the adding message that Fig. 5 receives in the embodiment of the present invention is IPv4 version, obtain the detailed flowchart of IGMP Snooping entry;

图6为本发明实施例中收到的加入报文为IPv6版本,获得MAC地址的详细流程图;Fig. 6 is that the adding message that receives in the embodiment of the present invention is IPv6 version, obtains the detailed flowchart of MAC address;

图7为本发明实施例中收到的离开报文为IPv4版本时,对IGMP Snooping表项的处理的详细流程图;Fig. 7 is the detailed flowchart of the processing of IGMP Snooping entry when the leave message received in the embodiment of the present invention is IPv4 version;

图8为本发明实施例中当收到的离开报文为IPv6版本时,对MLDSnooping表项的处理的详细流程图。FIG. 8 is a detailed flow chart of processing the MLDSnooping entry when the received leaving message is in IPv6 version in the embodiment of the present invention.

具体实施方式Detailed ways

本发明实施例根据收到的报文获得网际协议版本4IPv4版本的组播组IP地址或网际协议版本6IPv6版本的组播组IP地址;当获得IPv4版本的组播组IP地址时,将获得的IPv4版本的组播组IP地址映射为组播媒体接入控制MAC地址;当获得IPv6版本的组播组IP地址时,将获得的IPv6版本的组播组IP地址映射为组播MAC地址;根据获得的组播MAC地址更新公共MAC地址表。IPv4及IPv6使用同一公共MAC地址表,实现了对MAC地址的统一更新及维护,节省了内存资源。The embodiment of the present invention obtains the multicast group IP address of the Internet Protocol version 4 IPv4 version or the multicast group IP address of the Internet Protocol version 6 IPv6 version according to the received message; when obtaining the multicast group IP address of the IPv4 version, the obtained The multicast group IP address of the IPv4 version is mapped to the multicast media access control MAC address; when the multicast group IP address of the IPv6 version is obtained, the multicast group IP address of the obtained IPv6 version is mapped to the multicast MAC address; according to The obtained multicast MAC address updates the public MAC address table. IPv4 and IPv6 use the same public MAC address table, which realizes unified update and maintenance of MAC addresses and saves memory resources.

参见图1,本发明实施例中MAC地址更新装置包括处理模块101、执行模块102及转换模块103。Referring to FIG. 1 , the device for updating a MAC address in the embodiment of the present invention includes a processing module 101 , an execution module 102 and a conversion module 103 .

处理模块101用于根据收到的报文获得IPv4版本的组播组IP地址或IPv6版本的组播组IP地址。组播组IP地址即组播组IP(Internet Protocol,网际协议)地址,指的是组播的组IP地址。处理模块101接收报文,其中,报文可以是加入报文或离开报文,所述报文是由IPv4组播接收方或IPv6组播接收方所发送的。发送加入报文是有IPv4组播接收方或请求加入组播组,发送离开报文是有IPv4组播接收方或IPv6组播接收方请求离开组播组。处理模块101还会接收数据报文,是由IPv4组播发送方或IPv6组播发送方所发送,用于向IPv4组播接收方或IPv6组播接收方发送数据。接收到加入报文或离开报文后处理模块101对报文进行解析,获得报文中的参数信息,其中,参数信息至少包括IPv4组播组IP地址或IPv6组播组IP地址和VLAN(Virtual Local AreaNetwork,虚拟局域网)ID(标识符),并且可以根据接收所述加入报文或离开报文的端口获得该收到所述加入报文或离开报文的端口的端口号。VLAN ID是端口号所在的VLAN的ID,二层设备上可能有多个VLAN,可以通过VLANID来进行区分。解析报文后,处理模块101根据报文中解析出的组播组IP地址在IGMP Snooping中查找第一表项集合或在MLD Snooping中查找第二表项集合,第一表项集合对应于IPv4,第二表项集合对应于IPv6。较佳的,本发明实施例中第一表项可以是IGMP Snooping表项,第二表项可以是MLD Snooping表项。每条IGMP Snooping表项包括报文中解析出的组播组IP地址、VLAN ID及收到所述报文的端口的端口号,及三者的对应关系,每条MLD Snooping表项包括报文中解析出的组播组IP地址、VLAN ID及接收所述报文的端口的端口号,及三者的对应关系。对应于一个组播组IP地址的所有第一表项组成第一表项集合,或称为IGMP Snooping表项集合,对应于一个组播组IP地址的所有第二表项组成第二表项集合,或称为MLD Snooping表项集合。一个IGMPSnooping表项集合中的各IGMP Snooping表项,或者一个MLDSnooping表项集合中的各MLD Snooping表项之间可以对应有链接关系,当根据一个组播组IP地址进行查询时,可以查询到包含该组播组IP地址的IGMP Snooping表项集合或MLDSnooping表项集合,其中包含了所有包含该组播组IP地址的IGMPSnooping表项或MLDSnooping表项。如果对应于该组播组IP地址的IGMPSnooping表项集合或MLD Snooping表项集合为空,则处理模块101根据该组播组IP地址创建一条IGMP Snooping表项或MLD Snooping表项,如果对应于该组播组IP地址的IGMP Snooping表项集合中没有接收所述报文的端口的端口号所对应的IGMP Snooping表项,则处理模块101根据该组播组IP地址及接收所述报文的端口的端口号在该IGMP Snooping表项集合中创建一条IGMPSnooping表项,如果对应于该组播组IP地址的MLD Snooping表项集合中没有接收所述报文的端口的端口号所对应的MLD Snooping表项,则处理模块101根据该组播组IP地址及接收所述报文的端口的端口号在该MLD Snooping表项集合中创建一条MLD Snooping表项。其中,处理模块101维护IGMP Snooping中的所有IGMP Snooping表项集合和MLD Snooping中的所有MLD Snooping表项集合。The processing module 101 is configured to obtain the multicast group IP address of the IPv4 version or the multicast group IP address of the IPv6 version according to the received message. The multicast group IP address is the multicast group IP (Internet Protocol, Internet Protocol) address, which refers to the multicast group IP address. The processing module 101 receives a message, where the message may be a join message or a leave message, and the message is sent by an IPv4 multicast receiver or an IPv6 multicast receiver. A join message is sent when an IPv4 multicast receiver or a request to join a multicast group is sent, and a leave message is sent when an IPv4 multicast receiver or an IPv6 multicast receiver requests to leave a multicast group. The processing module 101 also receives data packets, which are sent by the IPv4 multicast sender or the IPv6 multicast sender, and are used to send data to the IPv4 multicast receiver or the IPv6 multicast receiver. After receiving the joining message or leaving the message, the processing module 101 parses the message to obtain parameter information in the message, wherein the parameter information includes at least an IPv4 multicast group IP address or an IPv6 multicast group IP address and a VLAN (Virtual Local AreaNetwork, virtual local area network) ID (identifier), and can obtain the port number of the port that receives said joining message or leaving message according to the port that receives said joining message or leaving message. VLAN ID is the ID of the VLAN where the port number is located. There may be multiple VLANs on the Layer 2 device, which can be distinguished by VLAN ID. After the message is parsed, the processing module 101 searches for a first set of entries in IGMP Snooping or a set of second entries in MLD Snooping according to the multicast group IP address resolved in the message. The first set of entries corresponds to IPv4 , the second entry set corresponds to IPv6. Preferably, in the embodiment of the present invention, the first entry may be an IGMP Snooping entry, and the second entry may be an MLD Snooping entry. Each IGMP Snooping entry includes the multicast group IP address, VLAN ID, and port number of the port that received the message from the message, and the corresponding relationship between the three. Each MLD Snooping entry includes the message The multicast group IP address, VLAN ID and the port number of the port receiving the message, and the corresponding relationship among the three are parsed out. All the first entries corresponding to a multicast group IP address form the first entry set, or IGMP Snooping entry set, and all the second entries corresponding to a multicast group IP address form the second entry set , or MLD Snooping entry set. Each IGMP Snooping entry in an IGMPSnooping entry set, or each MLD Snooping entry in an MLDSnooping entry set can have a corresponding link relationship. When querying based on a multicast group IP address, you can query the The IGMP Snooping entry set or MLDSnooping entry set of the multicast group IP address includes all IGMPSnooping entries or MLDSnooping entries containing the multicast group IP address. If the IGMPSnooping entry set corresponding to the multicast group IP address or the MLD Snooping entry set is empty, then the processing module 101 creates an IGMP Snooping entry or MLD Snooping entry according to the multicast group IP address, if corresponding to the If there is no IGMP Snooping entry corresponding to the port number of the port receiving the message in the IGMP Snooping entry set of the multicast group IP address, then the processing module 101 will Create an IGMPSnooping table entry in the IGMP Snooping table entry set with the port number, if there is no MLD Snooping table corresponding to the port number of the port receiving the message in the MLD Snooping table entry set corresponding to the IP address of the multicast group item, then the processing module 101 creates an MLD Snooping entry in the MLD Snooping entry set according to the multicast group IP address and the port number of the port receiving the message. Wherein, the processing module 101 maintains all IGMP Snooping entry sets in IGMP Snooping and all MLD Snooping entry sets in MLD Snooping.

执行模块102用于根据获得的组播MAC地址更新公共MAC地址表。执行模块102将IGMP Snooping表项中的组播组IP地址映射得到的组播MAC地址及MLD Snooping表项中的组播组IP地址映射得到的组播MAC地址统一存储在一个公共MAC地址表中,且根据每个MAC地址在公共MAC地址表中建立MAC转发条目,每个组播MAC地址可以对应多个MAC转发条目,对应于一个组播MAC地址的所有MAC转发条目可以组成一个组播MAC转发条目集合。每个MAC转发条目中包括MAC地址及端口号。端口号是接收IPv4组播接收方发送的报文或IPv6组播接收方发送的报文的端口的端口号。所述端口号是根据IGMP Snooping表项或MLD Snooping表项中的VLAN ID及端口号添加到MAC转发条目中的,根据MAC转发条目中的组播MAC地址及端口号即可获知IPv4组播接收者或IPv6组播接收者的准确位置。此后,如果处理模块101收到数据报文,解析出数据报文中所包含的组播组IP地址,执行模块102将该组播组IP地址映射为组播MAC地址,并根据映射得到的MAC地址查询公共MAC地址表中相应的组播MAC转发条目集合,进行数据转发,所述相应的组播MAC转发条目集合是指该MAC转发条目中所包含的MAC地址与所述映射得到的的MAC地址相同。The execution module 102 is configured to update the public MAC address table according to the obtained multicast MAC address. The execution module 102 uniformly stores the multicast MAC address obtained by mapping the multicast group IP address in the IGMP Snooping entry and the multicast MAC address obtained by mapping the multicast group IP address in the MLD Snooping entry in a public MAC address table , and establish a MAC forwarding entry in the public MAC address table according to each MAC address, each multicast MAC address can correspond to multiple MAC forwarding entries, and all MAC forwarding entries corresponding to a multicast MAC address can form a multicast MAC A collection of forwarded entries. Each MAC forwarding entry includes a MAC address and a port number. The port number is the port number of the port that receives packets sent by the IPv4 multicast receiver or packets sent by the IPv6 multicast receiver. The port number is added to the MAC forwarding entry according to the VLAN ID and port number in the IGMP Snooping entry or MLD Snooping entry, and the IPv4 multicast reception can be known according to the multicast MAC address and port number in the MAC forwarding entry or the exact location of the IPv6 multicast receiver. Afterwards, if the processing module 101 receives the data message and resolves the multicast group IP address contained in the data message, the execution module 102 maps the multicast group IP address to a multicast MAC address, and according to the MAC address obtained by mapping The address queries the corresponding multicast MAC forwarding entry set in the public MAC address table to forward data. The corresponding multicast MAC forwarding entry set refers to the MAC address contained in the MAC forwarding entry and the MAC obtained by the mapping. The address is the same.

转换模块103用于当获得IPv4版本的组播组IP地址时,将获得的IPv4版本的组播组IP地址映射为组播媒体接入控制MAC地址;当获得IPv6版本的组播组IP地址时,将获得的IPv6版本的组播组IP地址映射为组播MAC地址。本发明实施例中IP地址以组播组IP地址为例。转换模块103获得处理模块101中的IGMP Snooping表项或MLD Snooping表项,该IGMP Snooping表项或MLD Snooping表项中包括了组播组IP地址、VLAN ID及端口号。转换模块103根据IPv4版本的IP地址与MAC地址之间的固定映射关系或IPv6版本的IP地址与MAC地址之间的固定映射关系,将IGMP Snooping表项中的组播组IP地址或MLD Snooping表项中的组播组IP地址映射为组播MAC地址。其中,映射关系可以是一个函数,确定了一种固定的计算方式,转换模块103将IPv4版本的IP地址代入IPv4版本的IP地址与MAC地址之间的固定映射关系中即可获得组播MAC地址,或将IPv6版本的IP地址代入IPv6版本的IP地址与MAC地址之间的固定映射关系中即可获得组播MAC地址。IGMP Snooping表项或MLD Snooping表项中包括的VLAN ID可以存储在执行模块102中,根据该VLAN ID及IGMP Snooping表项或MLD Snooping表项中包括的端口号已经可以确定接收IPv4组播接收方发送的报文或IPv6组播接收方发送的报文的端口的端口号,因此在MAC转发条目中不包括VLAN ID。例如,一条MAC转发条目为:Conversion module 103 is used for when obtaining the multicast group IP address of IPv4 version, the multicast group IP address of obtained IPv4 version is mapped to the multicast media access control MAC address; When obtaining the multicast group IP address of IPv6 version , and map the obtained IPv6 version multicast group IP address to a multicast MAC address. The IP address in the embodiment of the present invention is an example of a multicast group IP address. The conversion module 103 obtains the IGMP Snooping entry or the MLD Snooping entry in the processing module 101, and the IGMP Snooping entry or the MLD Snooping entry includes the multicast group IP address, VLAN ID and port number. Conversion module 103 converts the multicast group IP address in the IGMP Snooping entry or the MLD Snooping table The multicast group IP address in the item is mapped to the multicast MAC address. Wherein, the mapping relationship can be a function, which determines a fixed calculation method, and the conversion module 103 can obtain the multicast MAC address by substituting the IP address of the IPv4 version into the fixed mapping relationship between the IP address of the IPv4 version and the MAC address , or substitute the IPv6 version IP address into the fixed mapping relationship between the IPv6 version IP address and the MAC address to obtain the multicast MAC address. The VLAN ID included in the IGMP Snooping table item or the MLD Snooping table item can be stored in the execution module 102, and the port number included in the VLAN ID and the IGMP Snooping table item or the MLD Snooping table item can be determined to receive the IPv4 multicast receiver The port number of the port where the packet was sent or the packet was sent by the IPv6 multicast receiver, so the VLAN ID is not included in the MAC forwarding entry. For example, a MAC forwarding entry is:

(0100.5e01.0101,端口1)(0100.5e01.0101, port 1)

其中,0100.5e01.0101为将组播组IP地址224.1.1.1映射后得到的MAC地址。例如,另一条MAC转发条目为:Wherein, 0100.5e01.0101 is a MAC address obtained by mapping the multicast group IP address 224.1.1.1. For example, another MAC forwarding entry is:

(3333.0000.0001,端口2)(3333.0000.0001, port 2)

其中,3333.0000.0001为将组播组IP地址ff4e::1映射后得到的组播MAC地址。因为IPv4所对应的IP地址映射后均是以01005e开头,IPv6所对应的IP地址映射后均是以3333开头,因此IPv4所对应的IP地址及IPv6所对应的IP地址映射后得到的MAC地址不会相同,则二者在地址表单元1022中存储时不会发生冲突。Wherein, 3333.0000.0001 is the multicast MAC address obtained after mapping the multicast group IP address ff4e::1. Because the IP addresses corresponding to IPv4 all start with 01005e after mapping, and the IP addresses corresponding to IPv6 all start with 3333 after mapping, so the MAC addresses obtained after mapping the IP addresses corresponding to IPv4 and the IP addresses corresponding to IPv6 are different. will be the same, then there will be no conflict when the two are stored in the address table unit 1022.

参见图2,所述装置还包括收发模块104,所述装置还可以包括存储模块105。Referring to FIG. 2 , the device further includes a transceiver module 104 , and the device may also include a storage module 105 .

收发模块104用于接收报文,及收发IGMP Snooping表项或MLD Snooping表项。收发模块104用于接收IPv4组播接收方或IPv6组播接收方发送的加入报文或离开报文。收发模块104收到报文后,判断收到的报文的协议类型,是IPv4协议还是IPv6协议,再根据协议类型通知处理模块101中的相应单元进行解析。收发模块104用于接收IGMP Snooping表项或MLD Snooping表项。收发模块104还用于根据数据报文中的组播组IP地址映射出的组播MAC地址查询已有的MAC转发条目,查找到与该组播MAC地址对应的组播MAC转发条目集合,根据该组播MAC转发条目集合中的端口号将IPv4组播发送方发送的数据转发到IPv4组播接收方,或将IPv6组播发送方发送的数据转发到IPv6组播接收方。The transceiver module 104 is used for receiving packets, and sending and receiving IGMP Snooping entries or MLD Snooping entries. The transceiver module 104 is configured to receive a join message or a leave message sent by an IPv4 multicast receiver or an IPv6 multicast receiver. After receiving the message, the transceiver module 104 judges the protocol type of the received message, whether it is the IPv4 protocol or the IPv6 protocol, and then notifies the corresponding unit in the processing module 101 to analyze according to the protocol type. The transceiver module 104 is configured to receive an IGMP Snooping entry or an MLD Snooping entry. The transceiver module 104 is also used to query the existing MAC forwarding entries according to the multicast MAC address mapped from the multicast group IP address in the data message, and find out the set of multicast MAC forwarding entries corresponding to the multicast MAC address. The port number in the multicast MAC forwarding entry set forwards the data sent by the IPv4 multicast sender to the IPv4 multicast receiver, or forwards the data sent by the IPv6 multicast sender to the IPv6 multicast receiver.

存储模块105用于存储映射关系。存储模块105用于存储IPv4版本的IP地址与MAC地址之间的固定映射关系及IPv6版本的IP地址与MAC地址之间的固定映射关系,可以将这两种映射关系分别存储。执行模块102可以根据存储模块105中存储的IPv4版本的IP地址或IPv6版本的IP地址与MAC地址之间的固定映射关系将IGMP Snooping表项中的组播组IP地址或MLDSnooping表项中的组播组IP地址映射为组播MAC地址。The storage module 105 is used to store the mapping relationship. The storage module 105 is used for storing the fixed mapping relationship between the IPv4 version IP address and the MAC address and the fixed mapping relationship between the IPv6 version IP address and the MAC address, and these two mapping relationships can be stored separately. Execution module 102 can according to the IP address of the IPv4 version stored in the storage module 105 or the fixed mapping relationship between the IP address of IPv6 version and the MAC address, the multicast group IP address in the IGMP Snooping entry or the group in the MLDSnooping entry The multicast IP address is mapped to the multicast MAC address.

参见图3A,所述处理模块101具体包括第一解析单元1011、第二解析单元1012、第一查询单元1013、第二查询单元1014、第一创建单元1015及第二创建单元1016。其中,第一解析单元1011、第一查询单元1013、及第一创建单元1015为对应于IPv4的设备,而第二解析单元1012、第二查询单元1014及第二创建单元1016为对应于IPv6的设备。在本发明实施例中,处理模块101中对IPv4加入报文的举例均以IPv4组播接收方发出加入组播组224.1.1.1的报文为例,对IPv6加入报文的举例均以IPv4组播接收方发出加入组播组ff4e::1的报文为例。Referring to FIG. 3A , the processing module 101 specifically includes a first analysis unit 1011 , a second analysis unit 1012 , a first query unit 1013 , a second query unit 1014 , a first creation unit 1015 and a second creation unit 1016 . Among them, the first parsing unit 1011, the first query unit 1013, and the first creation unit 1015 are devices corresponding to IPv4, while the second parsing unit 1012, the second query unit 1014, and the second creation unit 1016 are devices corresponding to IPv6. equipment. In the embodiment of the present invention, in the processing module 101, all the examples of adding messages to IPv4 take the message that the IPv4 multicast receiver sends to join the multicast group 224.1.1.1 as an example; Take the broadcast receiver sending a message to join the multicast group ff4e::1 as an example.

第一解析单元1011用于对IPv4组播接收方发送的报文进行解析。收发模块104在收到报文后,判断该报文的协议类型是IPv4版本还是IPv6版本,当确定该报文的协议类型为IPv4版本时,通知第一解析单元1011进行解析。第一解析单元1011在收到IPv4组播接收方发送的报文后,判断该报文是加入报文还是离开报文,并解析出该报文中所包含的参数信息。其中,该参数信息至少包括组播组IP地址及VLAN ID,在接收所述报文时可以获得接收该报文的端口的端口号。一个组播组IP地址可以对应多个端口号,一个VLAN ID可以对应多个端口号。例如,第一解析单元1011收到报文后,确定接收该报文的端口的端口号为端口1,解析出的报文参数信息为:The first parsing unit 1011 is configured to parse the message sent by the IPv4 multicast receiver. After receiving the message, the transceiver module 104 judges whether the protocol type of the message is IPv4 version or IPv6 version, and when it is determined that the protocol type of the message is IPv4 version, it notifies the first parsing unit 1011 to analyze. After receiving the message sent by the IPv4 multicast receiver, the first parsing unit 1011 judges whether the message is a join message or a leave message, and parses out the parameter information contained in the message. Wherein, the parameter information includes at least the multicast group IP address and the VLAN ID, and the port number of the port receiving the message can be obtained when receiving the message. A multicast group IP address can correspond to multiple port numbers, and a VLAN ID can correspond to multiple port numbers. For example, after the first parsing unit 1011 receives the message, it determines that the port number of the port receiving the message is port 1, and the parsed message parameter information is:

IPv4组播组IP地址:224.1.1.1,VLAN ID:100IPv4 multicast group IP address: 224.1.1.1, VLAN ID: 100

第二解析单元1012用于对IPv6组播接收方发送的报文进行解析。收发模块104在收到报文后,判断该报文的协议类型是IPv4版本还是IPv6版本,当确定该报文的协议类型为IPv6版本时,通知第二解析单元1012进行解析。第二解析单元1012在收到IPv6组播接收方发送的报文后,判断该报文是加入报文还是离开报文解析出该报文中所包含的参数信息。其中,该参数信息至少包括组播组IP地址及VLAN ID接收该报文的端口的端口号。一个组播组IP地址可以对应多个端口号,一个VLAN ID可以对应多个端口号。例如,解析单元1022解析出的报文参数信息为:The second parsing unit 1012 is configured to parse the message sent by the IPv6 multicast receiver. After receiving the message, the transceiver module 104 judges whether the protocol type of the message is IPv4 version or IPv6 version, and when it is determined that the protocol type of the message is IPv6 version, notifies the second parsing unit 1012 to analyze. After receiving the message sent by the IPv6 multicast receiver, the second parsing unit 1012 judges whether the message is a join message or a leave message and parses out the parameter information contained in the message. Wherein, the parameter information includes at least the multicast group IP address and the port number of the port of the VLAN ID receiving the message. A multicast group IP address can correspond to multiple port numbers, and a VLAN ID can correspond to multiple port numbers. For example, the message parameter information parsed by the parsing unit 1022 is:

IPv6组播组IP地址:ff4e::1,VLAN ID:100,端口:端口2。IPv6 multicast group IP address: ff4e::1, VLAN ID: 100, port: port 2.

第一查询单元1013用于根据解析出的组播组IP地址查询IGMP Snooping表项。查询单元1013维护所有的IGMP Snooping表项,可以将所有的IGMPSnooping表项存储起来以供查询及调用。当第一解析单元1011解析出报文中所包含的参数信息后,通知第一查询单元1013进行查询。如果是加入报文,第一查询单元1013根据第一解析单元1011解析出的报文信息中所包含的组播组IP地址查询及判断存储的IGMP Snooping表项中是否有包含了该组播组IP地址的IGMP Snooping表项集合,如果判断结果为否,则通知第一创建单元1015根据该组播组IP地址及接收所述加入报文的端口的端口号创建一条IGMP Snooping表项,该IGMP Snooping表项即组成对应于该组播组IP地址的IGMP Snooping表项集合,如果判断结果为是,则判断该IGMP Snooping表项集合中是否有IGMP Snooping表项中的端口号为接收所述加入报文的端口的端口号,如果该IGMP Snooping表项集合中有IGMP Snooping表项中的端口号与接收所述加入报文的端口的端口号相同,则直接将该IGMP Snooping表项发送给执行模块102,如果该IGMP Snooping表项集合中没有IGMP Snooping表项中的端口号与接收所述加入报文的端口的端口号相同,则通知第一创建单元101根据该组播组IP地址及接收所述加入报文的端口的端口号在该IGMPSnooping表项集合中创建一条IGMP Snooping表项;如果是离开报文,第一查询单元1013根据第一解析单元1011解析出的报文信息中所包含的组播组IP地址查询及判断存储的IGMP Snooping表项中是否有包含了该组播组IP地址的IGMP Snooping表项集合,如果判断结果为否,则不进行任何操作,如果判断结果为是,则判断该IGMP Snooping表项集合中是否有IGMP Snooping表项中的端口号与接收所述离开报文的端口的端口号相同,如果该IGMP Snooping表项集合中没有IGMP Snooping表项中的端口号与接收所述离开报文的端口的端口号相同,则不进行任何操作,如果该IGMP Snooping表项集合中有IGMPSnooping表项中的端口号与接收所述加入离开的端口的端口号相同,则删除该端口号,并删除该IGMP Snooping表项。如果删除该IGMP Snooping表项后该IGMP Snooping表项集合为空,则删除该IGMP Snooping表项集合。The first query unit 1013 is configured to query the IGMP Snooping entry according to the resolved multicast group IP address. The query unit 1013 maintains all IGMP Snooping entries, and can store all IGMP Snooping entries for query and calling. After the first parsing unit 1011 parses out the parameter information contained in the message, it notifies the first query unit 1013 to perform query. If it is to add a message, the first query unit 1013 queries whether the multicast group IP address contained in the message information analyzed by the first analysis unit 1011 and judges whether the stored IGMP Snooping entry contains the multicast group The set of IGMP Snooping entries of the IP address, if the judgment result is no, then notify the first creation unit 1015 to create an IGMP Snooping entry according to the port number of the multicast group IP address and the port receiving the added message, the IGMP The Snooping table entry promptly forms the IGMP Snooping table entry set corresponding to the multicast group IP address, if the judgment result is yes, then judge whether there is a port number in the IGMP Snooping table entry in the IGMP Snooping table entry set to receive the added The port number of the port of the message, if the port number in the IGMP Snooping table entry in the IGMP Snooping table entry set is the same as the port number of the port receiving the added message, then directly send the IGMP Snooping table entry to the execution Module 102, if there is no port number in the IGMP Snooping entry set in the IGMP Snooping entry set that is identical to the port number of the port that receives the added message, then notify the first creation unit 101 to receive The port number of the port adding the message creates an IGMP Snooping entry in the IGMPSnooping entry set; if it is to leave the message, the first query unit 1013 parses out the message information according to the first analysis unit 1011. Multicast group IP address query and judge whether the stored IGMP Snooping entry contains the IGMP Snooping entry set containing the multicast group IP address. If the judgment result is No, no operation will be performed. If the judgment result is Yes , then determine whether the port number in the IGMP Snooping entry is the same as the port number of the port receiving the leaving message in the IGMP Snooping entry set, if there is no port in the IGMP Snooping entry in the IGMP Snooping entry set No. is the same as the port number of the port receiving the leaving message, then no operation is performed. If the port number in the IGMPSnooping table entry is the same as the port number receiving the port adding and leaving in the IGMP Snooping entry set, Then delete the port number and delete the IGMP Snooping entry. If the IGMP Snooping entry set is empty after deleting the IGMP Snooping entry, delete the IGMP Snooping entry set.

第二查询单元1014用于根据解析出的组播组IP地址查询MLD Snooping表项。第二查询单元1014维护所有的MLD Snooping表项,可以将所有的MLDSnooping表项存储起来以供查询及调用。当第二解析单元1012解析出报文中所包含的参数信息后,通知第二查询单元1014进行查询。如果是加入报文,第二查询单元1014根据第二解析单元1012解析出的报文信息中所包含的组播组IP地址查询及判断存储的MLD Snooping表项中是否有包含了该组播组IP地址的MLD Snooping表项集合,如果判断结果为否,则通知第二创建单元1016根据该组播组IP地址及接收所述加入报文的端口的端口号创建一条MLDSnooping表项,该MLD Snooping表项即组成对应于该组播组IP地址的MLDSnooping表项集合,如果判断结果为是,则判断该MLD Snooping表项集合中是否有MLD Snooping表项所包含的端口号与接收所述加入报文的端口的端口号相同,如果该MLD Snooping表项集合中有MLD Snooping表项所包含的端口号与接收所述加入报文的端口的端口号相同,则直接将该MLD Snooping表项发送给执行模块102,如果该MLD Snooping表项集合中没有MLD Snooping表项所包含的端口号与接收所述加入报文的端口的端口号相同,则通知第二创建单元1016根据该组播组IP地址及接收所述加入报文的端口的端口号在该MLD Snooping表项集合中创建一条MLD Snooping表项;如果是离开报文,第二查询单元1014根据第二解析单元1012解析出的报文信息中所包含的组播组IP地址查询及判断存储的MLD Snooping表项中是否有包含了该组播组IP地址的MLD Snooping表项集合,如果判断结果为否,则不进行任何操作,如果判断结果为是,则判断该MLD Snooping表项集合中是否有MLD Snooping表项所包含的端口号与接收所述离开报文的端口的端口号相同,如果该MLDSnooping表项集合中没有MLD Snooping表项所包含的端口号与接收所述离开报文的端口的端口号相同,则不进行任何操作,如果该MLD Snooping表项集合中有MLD Snooping表项所包含的端口号与接收所述离开报文的端口的端口号相同,则删除该端口号,并删除该MLD Snooping表项。如果删除该MLDSnooping表项后,该MLD Snooping表项集合为空,则删除该MLD Snooping表项集合。The second query unit 1014 is configured to query the MLD Snooping entry according to the resolved multicast group IP address. The second query unit 1014 maintains all MLD Snooping entries, and can store all MLDSnooping entries for query and call. After the second parsing unit 1012 parses out the parameter information included in the message, it notifies the second query unit 1014 to perform query. If it is to add a message, the second query unit 1014 queries the multicast group IP address contained in the message information analyzed by the second analysis unit 1012 and judges whether the stored MLD Snooping entry contains the multicast group The set of MLD Snooping entries of the IP address, if the judgment result is no, then notify the second creating unit 1016 to create an MLDSnooping entry according to the multicast group IP address and the port number of the port receiving the added message, the MLD Snooping The table item promptly forms the MLDSnooping table item set corresponding to this multicast group IP address, if the judged result is yes, then judge whether there is the port number that MLD Snooping table item contains in this MLD Snooping table item set and receive described joining report If the port number of the port in the MLD Snooping entry set is the same as the port number contained in the MLD Snooping entry in the MLD Snooping entry set, the MLD Snooping entry is directly sent to Execution module 102, if there is no port number included in the MLD Snooping entry set in the MLD Snooping entry set and the port number of the port that receives the described joining message is the same, then notify the second creation unit 1016 according to the multicast group IP address And receive the port number of the port of adding message and create an MLD Snooping entry in the MLD Snooping entry set; Query the multicast group IP address contained in and judge whether there is an MLD Snooping entry set that contains the multicast group IP address in the stored MLD Snooping entry. If the judgment result is no, no operation will be performed. If the result is yes, it is judged whether there is an MLD Snooping entry in the MLD Snooping entry set. The included port number is the same as the port number of the port receiving the leaving message, then no operation is performed, if there is a port number included in the MLD Snooping table entry in the MLD Snooping table entry set If the port number of the port is the same, delete the port number and delete the MLD snooping entry. If the MLD Snooping entry set is empty after deleting the MLDSnooping entry, delete the MLD Snooping entry set.

第一创建单元1015用于创建IGMP Snooping表项。如果第一查询单元1013判断出存储的IGMP Snooping表项中没有包含解析出的报文中所包含的组播组IP地址的IGMP Snooping表项集合,或者对应于解析出的报文中所包含的组播组IP地址的IGMP Snooping表项集合中没有包含接收所述报文的端口的端口号的IGMP Snooping表项,则第一创建单元1015根据该解析出的报文中所包含的组播组IP地址及接收所述报文的端口的端口号创建一条IGMP Snooping表项,该IGMP Snooping表项中包括解析出的报文中所包含的组播组IP地址、VLAN ID及接收所述报文的端口的端口号端口号,再将该IGMP Snooping表项发送给执行模块102。例如,该创建的IGMP Snooping表项可以如下:The first creation unit 1015 is used to create an IGMP Snooping entry. If the first query unit 1013 judges that the stored IGMP Snooping entry does not contain the IGMP Snooping entry set of the multicast group IP address contained in the parsed message, or corresponds to the If the IGMP Snooping entry set of the multicast group IP address does not contain the IGMP Snooping entry of the port number of the port receiving the message, then the first creation unit 1015 will resolve the multicast group The IP address and the port number of the port receiving the message create an IGMP Snooping table entry, which includes the multicast group IP address and VLAN ID contained in the parsed message, and the received message The port number port number of the port, and then send the IGMP Snooping entry to the execution module 102. For example, the created IGMP Snooping entry can be as follows:

IGMP Snooping表项:(224.1.1.1,100,1)IGMP Snooping entry: (224.1.1.1, 100, 1)

其中,224.1.1.1为组播组IP地址,100为VLAN ID,1为接收所述报文的端口的端口号端口号。一个组播组IP地址可以对应多个VLAN ID,也可以对应多个端口号,但一条IGMP Snooping表项中只包含一个组播组IP地址、一个VLAN ID及一个端口号。Wherein, 224.1.1.1 is the multicast group IP address, 100 is the VLAN ID, and 1 is the port number port number of the port receiving the message. A multicast group IP address can correspond to multiple VLAN IDs, and can also correspond to multiple port numbers, but an IGMP Snooping entry only contains one multicast group IP address, one VLAN ID, and one port number.

第二创建单元1016用于创建MLD Snooping表项。如果第二查询单元1014判断出存储的MLD Snooping表项中没有包含解析出的报文中所包含的组播组IP地址的MLD Snooping表项集合,或者对应于解析出的报文中所包含的组播组IP地址的MLD Snooping表项集合中没有包含接收所述报文的端口的端口号的MLD Snooping表项,则第二创建单元1016根据该解析出的报文中所包含的组播组IP地址及接收所述报文的端口的端口号创建一条MLD Snooping表项,该MLD Snooping表项中包括解析出的报文中所包含的组播组IP地址、VLANID及端口号,再将该MLD Snooping表项发送给执行模块102。例如,该创建的MLD Snooping表项可以如下:The second creating unit 1016 is used to create an MLD Snooping entry. If the second query unit 1014 determines that the stored MLD Snooping entry does not contain the MLD Snooping entry set of the multicast group IP address contained in the parsed message, or corresponds to the If the MLD Snooping entry set of the multicast group IP address does not contain the MLD Snooping entry of the port number of the port receiving the message, then the second creation unit 1016 will resolve the multicast group IP address and the port number of the port receiving the message create an MLD Snooping table entry, which includes the multicast group IP address, VLANID and port number contained in the parsed message, and then the The MLD Snooping entry is sent to the execution module 102. For example, the created MLD snooping entry can be as follows:

MLD Snooping表项:(ff4e::1,100,2)MLD Snooping entry: (ff4e::1, 100, 2)

其中,ff4e::1为组播组IP地址,100为VLAN ID,2为接收所述报文的端口的端口号端口号。一个组播组IP地址可以对应多个VLAN ID,也可以对应多个端口号,但一条MLD Snooping表项中只包含一个组播组IP地址、一个VLANID及一个端口号。Wherein, ff4e::1 is the multicast group IP address, 100 is the VLAN ID, and 2 is the port number port number of the port receiving the message. A multicast group IP address can correspond to multiple VLAN IDs, and can also correspond to multiple port numbers, but an MLD Snooping entry only contains one multicast group IP address, one VLANID, and one port number.

参见图3B,所述执行模块102中具体包括操作单元1021及地址表单元1022。其中,执行模块102可以通过函数来实现。Referring to FIG. 3B , the execution module 102 specifically includes an operation unit 1021 and an address table unit 1022 . Wherein, the execution module 102 may be realized by a function.

操作单元1021用于添加或删除MAC转发条目。一个组播MAC地址可以对应多条MAC转发条目,该多条MAC转发条目组成一个对应于该组播MAC地址的组播MAC转发条目集合,一条MAC转发条目中包含一个MAC地址及一个端口号。如果处理模块101收到的报文为加入报文,在转换模块103将报文中携带的组播组IP地址映射为组播MAC地址后,执行模块102中的操作单元1021查询并判断已有的MAC转发条目中是否有该收到的加入报文中的组播组IP地址映射后的组播MAC地址所对应的组播MAC转发条目集合,如果判断结果为否,则根据该组播MAC地址及第一表项或第二表项中携带的端口号创建一条组播MAC转发条目,该组播MAC转发条目组成一个对应于该组播MAC地址的组播MAC转发条目集合,如果判断结果为是,则判断该组播MAC转发条目集合中是否有MAC转发条目所包含的端口号与第一表项或第二表项中携带的端口号相同,第一表项或第二表项中携带的端口号即所述加入报文发送方的端口号,如果该组播MAC转发条目集合中有MAC转发条目所包含的端口号与第一表项或第二表项中携带的端口号相同,则不进行任何操作,如果该组播MAC转发条目集合中没有MAC转发条目所包含的端口号与第一表项或第二表项中携带的端口号相同,则根据该组播MAC地址及第一表项或第二表项中携带的端口号在该组播MAC转发条目集合中添加一条MAC转发条目。如果处理模块101收到的报文为离开报文,操作单元1021查询并判断已有的MAC转发条目中是否有该收到的加入报文中的组播组IP地址映射后的组播MAC地址所对应的组播MAC转发条目集合,如果判断结果为否,则不做任何操作,如果判断结果为是,则判断该组播MAC转发条目集合是否有MAC转发条目所包含的端口号与第一表项或第二表项中携带的端口号相同,第一表项或第二表项中携带的端口号即所述加入离开发送方的端口号,如果该组播MAC转发条目集合中有MAC转发条目所包含的端口号与第一表项或第二表项中携带的端口号相同,则操作单元1021删除该组播MAC转发条目中的该端口号,并删除该MAC转发条目,如果删除该MAC转发条目后该组播MAC转发条目集合为空,则删除该组播MAC转发条目集合,如果该组播MAC转发条目集合中没有MAC转发条目所包含的端口号与第一表项或第二表项中携带的端口号相同,则不做任何操作。The operation unit 1021 is used to add or delete MAC forwarding entries. A multicast MAC address may correspond to multiple MAC forwarding entries, and the multiple MAC forwarding entries form a set of multicast MAC forwarding entries corresponding to the multicast MAC address, and a MAC forwarding entry includes a MAC address and a port number. If the message received by the processing module 101 is a join message, after the conversion module 103 maps the multicast group IP address carried in the message to a multicast MAC address, the operation unit 1021 in the execution module 102 inquires and judges that the existing Whether there is a set of multicast MAC forwarding entries corresponding to the multicast MAC address mapped to the multicast group IP address in the received join message in the MAC forwarding entry of The address and the port number carried in the first entry or the second entry create a multicast MAC forwarding entry, and the multicast MAC forwarding entry forms a set of multicast MAC forwarding entries corresponding to the multicast MAC address. If the judgment result If yes, then judge whether the port number contained in the MAC forwarding entry in the multicast MAC forwarding entry set is the same as the port number carried in the first table entry or the second table entry, and whether the port number in the first table entry or the second table entry The port number carried is the port number of the sender of the join message. If there is a MAC forwarding entry in the multicast MAC forwarding entry set, the port number contained in the MAC forwarding entry is the same as the port number carried in the first entry or the second entry. , then no operation is performed. If there is no MAC forwarding entry in the multicast MAC forwarding entry set that contains the same port number as the port number carried in the first or second entry, then according to the multicast MAC address and The port number carried in the first entry or the second entry adds a MAC forwarding entry to the set of multicast MAC forwarding entries. If the message received by the processing module 101 is a leave message, the operation unit 1021 queries and judges whether there is a multicast MAC address mapped to the multicast group IP address in the received join message in the existing MAC forwarding entry The corresponding multicast MAC forwarding entry set, if the judgment result is no, then do not do any operation, if the judgment result is yes, then judge whether the multicast MAC forwarding entry set has the port number contained in the MAC forwarding entry and the first The port number carried in the table entry or the second table entry is the same, and the port number carried in the first table entry or the second table entry is the port number that joins and leaves the sender. If there is a MAC address in the multicast MAC forwarding entry set The port number contained in the forwarding entry is the same as the port number carried in the first entry or the second entry, then the operation unit 1021 deletes the port number in the multicast MAC forwarding entry, and deletes the MAC forwarding entry. After the MAC forwarding entry, the multicast MAC forwarding entry set is empty, then delete the multicast MAC forwarding entry set, if there is no port number contained in the MAC forwarding entry in the multicast MAC forwarding entry set and the first table item or the second If the port numbers carried in the two entries are the same, no operation is performed.

地址表单元1022用于统一存储MAC地址。地址表单元1022包含一个公共MAC地址表,其中存储了MAC地址,转换模块103将IGMP Snooping表项中所包括的组播组IP地址或MLD Snooping表项中所包括的组播组IP地址映射为组播MAC地址后,均存储在地址表单元1022的公共MAC地址表中。公共MAC地址表中还存储了根据MAC地址及端口号所创建的所有MAC转发条目。该MAC转发条目中不包括目的端口的VLAN ID,即IPv4组播接收方或IPv6组播接收方所对应的VLAN ID,该VLAN ID可以存储在地址表中。The address table unit 1022 is used to uniformly store MAC addresses. The address table unit 1022 includes a public MAC address table, wherein the MAC address is stored, and the conversion module 103 maps the multicast group IP address included in the IGMP Snooping table item or the multicast group IP address included in the MLD Snooping table item to After the MAC addresses are multicast, they are all stored in the public MAC address table of the address table unit 1022 . All MAC forwarding entries created according to MAC addresses and port numbers are also stored in the public MAC address table. The VLAN ID of the destination port is not included in the MAC forwarding entry, that is, the corresponding VLAN ID of the IPv4 multicast receiver or the IPv6 multicast receiver, and the VLAN ID can be stored in the address table.

下面通过流程来介绍组播方法。The following describes the multicast method through the process.

参见图4,MAC地址更新的主要方法流程如下:Referring to Figure 4, the main flow of the MAC address update method is as follows:

步骤401:根据收到的报文获得IPv4版本的组播组IP地址或IPv6版本的组播组IP地址。Step 401: Obtain the multicast group IP address of the IPv4 version or the multicast group IP address of the IPv6 version according to the received message.

步骤402:当获得IPv4版本的组播组IP地址时,将获得的IPv4版本的组播组IP地址映射为组播媒体接入控制MAC地址;当获得IPv6版本的组播组IP地址时,将获得的IPv6版本的组播组IP地址映射为组播MAC地址。Step 402: when obtaining the multicast group IP address of the IPv4 version, map the multicast group IP address of the obtained IPv4 version to a multicast media access control MAC address; when obtaining the multicast group IP address of the IPv6 version, map The obtained IPv6 multicast group IP address is mapped to a multicast MAC address.

步骤403:根据获得的组播MAC地址更新公共MAC地址表。Step 403: Update the public MAC address table according to the obtained multicast MAC address.

参见图5,本发明实施例以收到加入报文为例。加入报文为IPv4版本时,获得IGMP Snooping表项的详细方法流程如下:Referring to FIG. 5 , the embodiment of the present invention takes receiving a joining message as an example. When the added message is IPv4 version, the detailed method of obtaining IGMP Snooping entries is as follows:

步骤501:接收加入报文,获得接收所述加入报文的端口的端口号。其中,该加入报文是IPv4组播接收方所发送。Step 501: Receive a joining message, and obtain the port number of the port receiving the joining message. Wherein, the joining message is sent by the IPv4 multicast receiver.

步骤502:解析该加入报文,获得组播组IP地址、VLAN ID。判断该加入报文的协议类型,确定是IPv4还是IPv6。Step 502: Analyze the joining message to obtain the multicast group IP address and VLAN ID. Judge the protocol type of the adding message, and determine whether it is IPv4 or IPv6.

步骤503:根据该组播组IP地址,判断是否已存在对应的IGMP Snooping表项集合。当判断结果为是时,执行步骤504,否则执行步骤505。如果步骤501中接收到的加入报文是IPv6组播接收方所发送,则本步骤为判断是否已存在对应的MLD Snooping表项。Step 503: According to the IP address of the multicast group, it is judged whether there is a corresponding IGMP Snooping entry set. When the judgment result is yes, go to step 504, otherwise go to step 505. If the joining message received in step 501 is sent by the IPv6 multicast receiver, then this step is to judge whether there is a corresponding MLD Snooping entry.

步骤504:判断该IGMP Snooping表项集合中是否有IGMP Snooping表项所包含的端口号与接收所述加入报文的端口的端口号相同。当判断结果为否时,继续步骤505,否则继续步骤506。Step 504: Determine whether the port number contained in the IGMP Snooping entry in the IGMP Snooping entry set is the same as the port number of the port receiving the join message. When the judgment result is no, go to step 505 , otherwise go to step 506 .

步骤505:根据该组播组IP地址、VLAN ID及端口号创建IGMP Snooping表项。例如,一条IGMP Snooping表项可以为:(224.1.1.1,100,1)。执行步骤507。如果步骤501中接收到的加入报文是IPv6组播接收方所发送,则本步骤为根据该组播组IP地址、VLAN ID及端口号创建MLD Snooping表项。Step 505: Create an IGMP Snooping entry according to the multicast group IP address, VLAN ID and port number. For example, an IGMP Snooping entry can be: (224.1.1.1, 100, 1). Execute step 507. If the joining message received in step 501 is sent by the IPv6 multicast receiver, then this step is to create an MLD Snooping entry according to the multicast group IP address, VLAN ID and port number.

步骤506:将该IGMP Snooping表项发送给执行模块102。在具体实现时可以是调用执行模块102的接口函数。如果步骤501中接收到的加入报文是IPv6组播接收方所发送,则本步骤为将该MLD Snooping表项发送给执行模块102。Step 506: Send the IGMP Snooping entry to the execution module 102. In specific implementation, the interface function of the execution module 102 may be called. If the join message received in step 501 is sent by the IPv6 multicast receiver, then this step is to send the MLD Snooping entry to the execution module 102.

参见图6,本发明实施例以收到加入报文为例,当收到的加入报文为IPv6版本,获得MAC地址的详细方法流程如下:Referring to Fig. 6, the embodiment of the present invention takes receiving the join message as an example, when the received join message is an IPv6 version, the detailed method flow for obtaining the MAC address is as follows:

步骤601:接收MLD Snooping表项。如果收到的加入报文为IPv4版本,则本步骤中接收的是IGMP Snooping表项。Step 601: Receive an MLD Snooping entry. If the received Join message is of IPv4 version, the IGMP Snooping entry is received in this step.

步骤602:确定该MLD Snooping表项的IP地址版本为IPv6。如果步骤601中接收的是IGMP Snooping表项,则本步骤为确定该IGMP Snooping表项的IP地址版本为IPv4。Step 602: Determine that the IP address version of the MLD Snooping entry is IPv6. If what received in the step 601 is the IGMP Snooping entry, then this step is to determine that the IP address version of the IGMP Snooping entry is IPv4.

步骤603:将MLD Snooping表项中包括的组播组IP地址映射得到组播MAC地址。其中,IPv6版本的组播组IP地址为128位,映射得到的MAC地址为48位。例如,将ff4e::1的组播组IP地址映射后得到的组播MAC地址为3333.0000.0001。如果步骤602中确定IGMP Snooping表项的IP地址版本为IPv4,则本步骤为将IGMP Snooping表项中包括的组播组IP地址映射得到组播MAC地址。Step 603: Map the multicast group IP address included in the MLD Snooping entry to obtain a multicast MAC address. Wherein, the multicast group IP address of the IPv6 version is 128 bits, and the mapped MAC address is 48 bits. For example, the multicast MAC address obtained after mapping the multicast group IP address of ff4e::1 is 3333.0000.0001. If it is determined in step 602 that the IP address version of the IGMP Snooping entry is IPv4, then this step is to map the multicast group IP address included in the IGMP Snooping entry to obtain the multicast MAC address.

步骤604:判断在已存在的MAC转发条目中是否有与该组播MAC地址相应的组播MAC转发条目集合。其中,相应指的是已有的MAC转发条目中,有组播MAC转发条目集合中所对应的组播MAC地址与该组播MAC地址相同。当判断结果为是时,执行步骤605,否则执行步骤606。Step 604: Determine whether there is a set of multicast MAC forwarding entries corresponding to the multicast MAC address among the existing MAC forwarding entries. Wherein, the corresponding means that among the existing MAC forwarding entries, there is a multicast MAC address corresponding to the set of multicast MAC forwarding entries that is the same as the multicast MAC address. When the judgment result is yes, go to step 605, otherwise go to step 606.

步骤605:判断该组播MAC转发条目集合中是否有MAC转发条目所包含的端口号与第二表项中携带的端口号相同。当判断结果为否时,继续步骤606,否则继续步骤607。如果步骤601中接收的是IGMP Snooping表项,则本步骤为判断该MAC转发条目集合中是否组播有MAC转发条目所包含的端口号与第一表项中携带的端口号相同。。Step 605: Determine whether the port number included in the MAC forwarding entry in the multicast MAC forwarding entry set is the same as the port number carried in the second entry. When the judgment result is no, go to step 606 , otherwise go to step 607 . If what received in the step 601 is the IGMP Snooping entry, then this step is to judge whether the port number contained in the MAC forwarding entry is identical to the port number carried in the first table entry for judging whether the MAC forwarding entry set is multicast. .

步骤606:根据该组播MAC地址及所述第二表项中携带的端口号添加一条MAC转发条目。Step 606: Add a MAC forwarding entry according to the multicast MAC address and the port number carried in the second entry.

步骤607:将该MLD Snooping表项发送给执行模块102。Step 607: Send the MLD Snooping entry to the execution module 102.

参见图7,本发明实施例中以收到离开报文为例,当离开报文为IPv4版本时,对IGMP Snooping表项的处理的详细方法流程如下:Referring to Fig. 7, in the embodiment of the present invention, taking the receipt of the leaving message as an example, when the leaving message is an IPv4 version, the detailed method flow for processing the IGMP Snooping entry is as follows:

步骤701:接收离开报文,获得接收所述离开报文的端口的端口号。其中,该离开报文是IPv4组播接收方所发送。Step 701: Receive the leaving message, and obtain the port number of the port receiving the leaving message. Wherein, the leave message is sent by the IPv4 multicast receiver.

步骤702:确定该离开报文为IPv4版本。或者该离开报文也可以为IPv6版本。Step 702: Determine that the outgoing message is of IPv4 version. Alternatively, the leave message may also be in IPv6 version.

步骤703:解析该离开报文,获得组播组IP地址及VLAN ID。Step 703: Analyze the leave message to obtain the multicast group IP address and VLAN ID.

步骤704:根据该组播组IP地址,判断是否已存在对应的IGMP Snooping表项集合。当判断结果为是时,执行步骤704,否则结束流程。如果步骤702中确定该离开报文为IPv6版本,则本步骤为根据该组播组IP地址,判断是否已存在对应的MLD Snooping表项。Step 704: According to the IP address of the multicast group, it is judged whether there is a corresponding IGMP Snooping entry set. When the judgment result is yes, execute step 704, otherwise end the process. If it is determined in step 702 that the leaving message is an IPv6 version, then this step is to judge whether there is a corresponding MLD Snooping entry according to the multicast group IP address.

步骤705:判断该IGMP Snooping表项集合中是否有IGMP Snooping表项所包含的端口号与接收所述离开报文的端口的端口号相同。当判断结果为是时,执行步骤706,否则结束流程。Step 705: Determine whether the port number contained in the IGMP Snooping entry in the IGMP Snooping entry set is the same as the port number of the port receiving the leaving message. When the judgment result is yes, execute step 706, otherwise end the process.

步骤706:删除该IGMP Snooping表项中的该端口号,并删除该IGMPSnooping表项。Step 706: Delete the port number in the IGMP Snooping entry, and delete the IGMPSnooping entry.

步骤707:判断该IGMP Snooping表项集合是否为空。当判断结果为是时,继续步骤708,否则结束流程。Step 707: Determine whether the IGMP Snooping entry set is empty. When the judgment result is yes, continue to step 708, otherwise end the process.

步骤708:删除该IGMP Snooping表项集合。Step 708: Delete the IGMP Snooping entry set.

参见图8,本发明实施例中以收到离开报文为例,当离开报文为IPv6版本时,对MLD Snooping表项的处理的详细方法流程如下:Referring to Fig. 8, in the embodiment of the present invention, taking the leaving message as an example, when the leaving message is an IPv6 version, the detailed method flow for processing the MLD Snooping entry is as follows:

步骤801:获得MLD Snooping表项中的组播组IP地址。如果离开报文为IPv4版本,则本步骤为获得IGMP Snooping表项中的组播组IP地址。Step 801: Obtain the multicast group IP address in the MLD Snooping entry. If the leaving message is an IPv4 version, then this step is to obtain the multicast group IP address in the IGMP Snooping entry.

步骤802:确定该MLD Snooping表项的IP地址版本为IPv6。如果步骤801为获得IGMP Snooping表项中的组播组IP地址,则本步骤为确定该IGMPSnooping表项的IP地址版本为IPv4。Step 802: Determine that the IP address version of the MLD Snooping entry is IPv6. If step 801 is to obtain the multicast group IP address in the IGMP Snooping table entry, then this step is to determine that the IP address version of the IGMP Snooping table entry is IPv4.

步骤803:将MLD Snooping表项中包括的组播组IP地址映射得到组播MAC地址。其中,IPv6版本的组播组IP地址为128位,映射得到的组播MAC地址为48位。例如,将ff4e::1的组播组IP地址映射后得到的组播MAC地址为3333.0000.0001。如果步骤602中确定IGMP Snooping表项的IP地址版本为IPv4,则本步骤为将IGMP Snooping表项中包括的组播组IP地址映射得到组播MAC地址。Step 803: Map the multicast group IP address included in the MLD Snooping entry to obtain a multicast MAC address. Wherein, the multicast group IP address of the IPv6 version is 128 bits, and the multicast MAC address obtained by mapping is 48 bits. For example, the multicast MAC address obtained after mapping the multicast group IP address of ff4e::1 is 3333.0000.0001. If it is determined in step 602 that the IP address version of the IGMP Snooping entry is IPv4, then this step is to map the multicast group IP address included in the IGMP Snooping entry to obtain the multicast MAC address.

步骤804:判断在已存在的MAC转发条目中是否有与该组播组IP地址相应的组播MAC转发条目集合。其中,相应指的是已有的MAC转发条目中,有MAC转发条目中包括的MAC地址与该组播MAC地址相同。当判断结果为是时,执行步骤805,否则结束流程。Step 804: Determine whether there is a set of multicast MAC forwarding entries corresponding to the multicast group IP address among the existing MAC forwarding entries. Wherein, the corresponding means that among the existing MAC forwarding entries, the MAC address included in the MAC forwarding entry is the same as the multicast MAC address. When the judgment result is yes, execute step 805, otherwise end the process.

步骤805:判断该MAC转发条目集合中是否有组播MAC转发条目所包含的端口号与第二表项中携带的端口号相同。当判断结果为是时,执行步骤806,否则结束流程。Step 805: Determine whether the port number included in the multicast MAC forwarding entry in the set of MAC forwarding entries is the same as the port number carried in the second entry. When the judgment result is yes, execute step 806, otherwise end the process.

步骤806:删除该组播MAC转发条目中的该端口号,并删除该MAC转发条目。Step 806: Delete the port number in the multicast MAC forwarding entry, and delete the MAC forwarding entry.

步骤807:判断该组播MAC转发条目集合是否为空。当判断结果为是时,执行步骤808,否则结束流程。Step 807: Determine whether the set of multicast MAC forwarding entries is empty. When the judgment result is yes, execute step 808, otherwise end the process.

步骤808:删除组播该MAC转发条目集合。Step 808: Delete the set of multicast MAC forwarding entries.

本发明实施例根据收到的报文获得网际协议版本4IPv4版本的组播组IP地址或网际协议版本6IPv6版本的组播组IP地址;当获得IPv4版本的组播组IP地址时,将获得的IPv4版本的组播组IP地址映射为组播媒体接入控制MAC地址;当获得IPv6版本的组播组IP地址时,将获得的IPv6版本的组播组IP地址映射为组播MAC地址;根据获得的组播MAC地址更新公共MAC地址表。将IPv4和IPv6的MAC地址进行统一存储,IPv4和IPv6协议栈不再需要分别维护各自的公共MAC地址表,节省了内存资源。且IPv4和IPv6双协议栈使用同一个执行模块102来进行管理,降低了软件实现的复杂度,而且,在针对组播MAC地址实施安全管理时,可以避免与具体协议版本耦合,增强了MAC移植性,也实现了对MAC地址的统一存储及维护,在处理离开报文时,如果删除对应IGMP Snooping表项或MLD Snooping表项后IGMP Snooping表项集合或MLD Snooping表项集合为空,则删除该IGMP Snooping表项集合或MLD Snooping表项集合,如果删除对应MAC转发条目后组播MAC转发条目集合为空,则删除该MAC转发条目集合,从而有效节省了内存空间,使公共MAC地址表中存储的信息更加合理,便于利用。The embodiment of the present invention obtains the multicast group IP address of the Internet Protocol version 4 IPv4 version or the multicast group IP address of the Internet Protocol version 6 IPv6 version according to the received message; when obtaining the multicast group IP address of the IPv4 version, the obtained The multicast group IP address of the IPv4 version is mapped to the multicast media access control MAC address; when the multicast group IP address of the IPv6 version is obtained, the multicast group IP address of the obtained IPv6 version is mapped to the multicast MAC address; according to The obtained multicast MAC address updates the public MAC address table. The MAC addresses of IPv4 and IPv6 are stored uniformly, and the IPv4 and IPv6 protocol stacks no longer need to maintain their respective public MAC address tables, saving memory resources. In addition, IPv4 and IPv6 dual protocol stacks are managed by the same execution module 102, which reduces the complexity of software implementation. Moreover, when implementing security management for multicast MAC addresses, coupling with specific protocol versions can be avoided, and MAC transplantation is enhanced. It also realizes unified storage and maintenance of MAC addresses. When processing leave packets, if the IGMP Snooping entry set or MLD Snooping entry set is empty after deleting the corresponding IGMP Snooping entry or MLD Snooping entry, delete The IGMP Snooping entry set or the MLD Snooping entry set, if the multicast MAC forwarding entry set is empty after deleting the corresponding MAC forwarding entry, then delete the MAC forwarding entry set, thereby effectively saving memory space and making the public MAC address table The stored information is more reasonable and easy to use.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, systems, or computer program products. Accordingly, the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) having computer-usable program code embodied therein.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.

Claims (16)

1. a MAC Address update method is characterized in that, may further comprise the steps:
Obtain the multicast group IP address of Internet Protocol Version 4 IPv4 version or the multicast group IP address of IPv6 IPv6 version according to the message of receiving;
When obtaining the multicast group IP address of IPv4 version, be multicast media access control MAC address with the multicast group IP map addresses of the IPv4 version that obtains; When obtaining the multicast group IP address of IPv6 version, be multicast mac address with the multicast group IP map addresses of the IPv6 version that obtains;
Upgrade public mac address table according to the multicast mac address that obtains.
2. the method for claim 1 is characterized in that, the described message of receiving is for joining message, and when obtaining the multicast group IP address of IPv4 version, is multicast media access control MAC address with the multicast group IP map addresses of the IPv4 version that obtains; When obtaining the multicast group IP address of IPv6 version, be also to comprise step before the multicast mac address with the multicast group IP map addresses of the IPv6 version that obtains:
When the multicast group IP address that obtains the IPv4 version according to the message of receiving, judge first list item set whether Internet group management protocol of the multicast group is spied upon has among the IGMP Snooping corresponding to the multicast group IP address of described IPv4 version, when judged result for not the time, comprise first list item of the port numbers of receiving the described port that joins message according to the multicast group IP address creation of IPv4 version;
When the multicast group IP address that obtains the IPv6 version according to the message of receiving, judge second list item set whether multicast listener discovery is spied upon has among the MLD Snooping corresponding to the multicast group IP address of described IPv6 version, when judged result for not the time, comprise second list item of the port numbers of receiving the described port that joins message according to the multicast group IP address creation of IPv6 version.
3. method as claimed in claim 2 is characterized in that,
When judgement defines first list item set corresponding to the multicast group IP address of described IPv4 version, judge that the port numbers that whether has first list item to be comprised in described first list item set is identical with the port numbers of receiving the described port that joins message, when the port numbers that does not have first list item to be comprised in described first list item set is identical with the port numbers of receiving the described port that joins message, comprise first list item of the port numbers of receiving the described port that joins message according to the multicast group IP address creation of described IPv4 version; Perhaps
When judgement defines second list item set corresponding to the multicast group IP address of described IPv6 version, judge that the port numbers that whether has second list item to be comprised in described second list item set set is identical with the port numbers of receiving the described port that joins message, when the port numbers that does not have first list item to be comprised in described second list item set is identical with the port numbers of receiving the described port that joins message, comprise second list item of the port numbers of receiving the described port that joins message according to the multicast group IP address creation of described IPv6 version.
4. as claim 2 or 3 described methods, it is characterized in that, the described message of receiving is for joining message, the step of upgrading public mac address table according to the multicast mac address that obtains comprises: judge the multicast MAC forwarding entry set that whether has in the public mac address table corresponding to the multicast mac address of described acquisition, when judged result for not the time, create the MAC forwarding entry that comprises the port numbers of carrying in described first list item or second list item according to the multicast mac address that obtains, when judged result when being, judge that whether the port numbers of carrying in port numbers that the MAC forwarding entry comprised and described first list item or second list item is arranged in the set of described multicast MAC forwarding entry is identical, when the port numbers of carrying in the port numbers that does not have the MAC forwarding entry to be comprised in the set of described multicast MAC forwarding entry and described first list item or second list item was identical, interpolation in described multicast MAC forwarding entry set comprised the MAC forwarding entry of the port numbers of carrying in described first list item or second list item according to described multicast mac address.
5. the method for claim 1 is characterized in that, the described message of receiving is a leave message, when obtaining the multicast group IP address of IPv4 version, is multicast media access control MAC address with the multicast group IP map addresses of the IPv4 version that obtains; When obtaining the multicast group IP address of IPv6 version, be also to comprise step before the multicast mac address with the multicast group IP map addresses of the IPv6 version that obtains:
Judge first list item set that whether has among the IGMP Snooping corresponding to the multicast group IP address of described IPv4 version, when judged result when being, judge that the port numbers that whether has first list item to be comprised in described first list item set is identical with the port numbers of the port of receiving described leave message, when the port numbers that first list item port numbers that is comprised and the port of receiving described leave message are arranged in described first list item set is identical, this port numbers of deletion in described first list item, and delete described first list item; Perhaps
Judge second list item set that whether has among the MLD Snooping corresponding to the multicast group IP address of described IPv6 version, when judged result when being, judge that the port numbers that whether has second list item to be comprised in described second list item set is identical with the port numbers of the port of receiving described leave message, when the port numbers that second list item port numbers that is comprised and the port of receiving described leave message are arranged in described second list item set is identical, in this port numbers of middle deletion of described second list item, and delete described second list item.
6. method as claimed in claim 5 is characterized in that, also comprises step:
Judge whether the set of described first list item is empty, when judged result when being, delete described first list item and gather; Perhaps
Judge whether the set of described second list item is empty, when judged result when being, delete described second list item and gather.
7. as claim 5 or 6 described methods, it is characterized in that, the described message of receiving is a leave message, the step of upgrading public mac address table according to the multicast mac address that obtains comprises: judge whether the multicast MAC forwarding entry set corresponding to the multicast mac address of described acquisition, when judged result when being, judge that whether the port numbers of carrying in port numbers that the MAC forwarding entry comprised and described first list item or second list item is arranged in the set of described multicast MAC forwarding entry is identical, when the port numbers of carrying in the port numbers that has the MAC forwarding entry to be comprised in the set of described multicast MAC forwarding entry and described first list item or second list item is identical, this port numbers of deletion in described MAC forwarding entry, and delete described MAC forwarding entry; Continuation judges whether described multicast MAC forwarding entry set is empty, when described multicast MAC forwarding entry set is sky, deletes described multicast MAC forwarding entry set.
8. a method of multicasting is characterized in that, may further comprise the steps:
Obtain the multicast group IP address of IPv4 version or the multicast group IP address of IPv6 version according to the message of receiving;
When obtaining the multicast group IP address of IPv4 version, be multicast media access control MAC address with the multicast group IP map addresses of the IPv4 version that obtains; When obtaining the multicast group IP address of IPv6 version, be multicast mac address with the multicast group IP map addresses of the IPv6 version that obtains;
In public mac address table, inquire about and described multicast mac address corresponding port number according to described multicast mac address, carry out data forwarding according to described port numbers.
9. a MAC Address updating device is characterized in that, comprising:
Processing module is used for obtaining the multicast group IP address of IPv4 version or the multicast group IP address of IPv6 version according to the message of receiving;
Modular converter is used for when obtaining the multicast group IP address of IPv4 version, is multicast media access control MAC address with the multicast group IP map addresses of the IPv4 version that obtains; When obtaining the multicast group IP address of IPv6 version, be multicast mac address with the multicast group IP map addresses of the IPv6 version that obtains;
Executive Module is used for upgrading public mac address table according to the multicast mac address that obtains.
10. device as claimed in claim 9, it is characterized in that, the described message of receiving is for joining message, described processing module also is used for when the multicast group IP address that obtains the IPv4 version according to the message of receiving, judge first list item set whether Internet group management protocol of the multicast group is spied upon has among the IGMP Snooping corresponding to the multicast group IP address of described IPv4 version, when judged result for not the time, comprise first list item of the port numbers of receiving the described port that joins message according to the multicast group IP address creation of IPv4 version; When the multicast group IP address that obtains the IPv6 version according to the message of receiving, judge second list item set whether multicast listener discovery is spied upon has among the MLD Snooping corresponding to the multicast group IP address of described IPv6 version, when judged result for not the time, comprise second list item of the port numbers of receiving the described port that joins message according to the multicast group IP address creation of IPv6 version.
11. device as claimed in claim 10, it is characterized in that, described processing module also is used for when judging first list item set define corresponding to the multicast group IP address of described IPv4 version, judge that the port numbers that whether has first list item to be comprised in described first list item set is identical with the port numbers of receiving the described port that joins message, when the port numbers that does not have first list item to be comprised in described first list item set is identical with the port numbers of receiving the described port that joins message, comprise first list item of the port numbers of receiving the described port that joins message according to the multicast group IP address creation of described IPv4 version; Perhaps when judging second list item set define corresponding to the multicast group IP address of described IPv6 version, judge that the port numbers that whether has second list item to be comprised in described second list item set is identical with the port numbers of receiving the described port that joins message, when the port numbers that does not have first list item to be comprised in described second list item set is identical with the port numbers of receiving the described port that joins message, comprise second list item of the port numbers of receiving the described port that joins message according to the multicast group IP address creation of described IPv6 version.
12. as claim 10 or 11 described devices, it is characterized in that, the described message of receiving is for joining message, described Executive Module is used for judging whether public mac address table has the multicast MAC forwarding entry set corresponding to the multicast mac address of described acquisition, when judged result for not the time, create the MAC forwarding entry that comprises the port numbers of carrying in described first list item or second list item according to the multicast mac address that obtains, when judged result when being, judge that whether the port numbers of carrying in port numbers that the MAC forwarding entry comprised and described first list item or second list item is arranged in the set of described multicast MAC forwarding entry is identical, when the port numbers of carrying in the port numbers that does not have the MAC forwarding entry to be comprised in the set of described multicast MAC forwarding entry and described first list item or second list item was identical, interpolation in described multicast MAC forwarding entry set comprised the MAC forwarding entry of the port numbers of carrying in described first list item or second list item according to described multicast mac address.
13. device as claimed in claim 9, it is characterized in that, the described message of receiving is a leave message, described processing module is used for also judging whether IGMP Snooping has first list item set corresponding to the multicast group IP address of described IPv4 version, when judged result when being, judge that the port numbers that whether has first list item to be comprised in described first list item set is identical with the port numbers of the port of receiving described leave message, when the port numbers that first list item port numbers that is comprised and the port of receiving described leave message are arranged in described first list item set is identical, this port numbers of deletion in described first list item, and delete described first list item; Perhaps judge second list item set that whether has among the MLD Snooping corresponding to the multicast group IP address of described IPv6 version, when judged result when being, judge that the port numbers that whether has second list item to be comprised in described second list item set is identical with the port numbers of the port of receiving described leave message, when the port numbers that second list item port numbers that is comprised and the port of receiving described leave message are arranged in described second list item set is identical, this port numbers of deletion in described second list item, and delete described second list item.
14. device as claimed in claim 13 is characterized in that, described processing module is used to also judge whether the set of described first list item is empty, when judged result when being, delete described first list item and gather; Judge perhaps whether the set of described second list item is empty, when judged result when being, delete described second list item and gather.
15. as claim 13 or 14 described devices, it is characterized in that, the described message of receiving is a leave message, described Executive Module is used to judge whether the multicast MAC forwarding entry set corresponding to the multicast mac address of described acquisition, when judged result when being, judge that whether the port numbers of carrying in port numbers that the MAC forwarding entry comprised and described first list item or second list item is arranged in the set of described multicast MAC forwarding entry is identical, the port numbers of carrying in the port numbers that has the MAC forwarding entry to be comprised in the set of described multicast MAC forwarding entry and described first list item or second list item is identical, this port numbers of deletion in described multicast MAC forwarding entry, and delete described MAC forwarding entry; Continuation judges whether described multicast MAC forwarding entry set is empty, when described multicast MAC forwarding entry set is sky, deletes described multicast MAC forwarding entry set.
16. a multicast apparatus is characterized in that, comprising:
Processing module is used for obtaining the multicast group IP address of IPv4 version or the multicast group IP address of IPv6 version according to the message of receiving;
Modular converter is used for when obtaining the multicast group IP address of IPv4 version, is multicast media access control MAC address with the multicast group IP map addresses of the IPv4 version that obtains; When obtaining the multicast group IP address of IPv6 version, be multicast mac address with the multicast group IP map addresses of the IPv6 version that obtains;
Executive Module is used for according to described multicast mac address carrying out data forwarding in the inquiry of public mac address table and described multicast mac address corresponding port number according to described port numbers.
CN201010557252.6A 2010-11-23 2010-11-23 MAC (media access control) address updating method and device Active CN102025796B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201010557252.6A CN102025796B (en) 2010-11-23 2010-11-23 MAC (media access control) address updating method and device
PCT/CN2011/075002 WO2012068854A1 (en) 2010-11-23 2011-05-31 Method and apparatus for updating media access control (mac) address

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010557252.6A CN102025796B (en) 2010-11-23 2010-11-23 MAC (media access control) address updating method and device

Publications (2)

Publication Number Publication Date
CN102025796A true CN102025796A (en) 2011-04-20
CN102025796B CN102025796B (en) 2014-06-11

Family

ID=43866638

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010557252.6A Active CN102025796B (en) 2010-11-23 2010-11-23 MAC (media access control) address updating method and device

Country Status (2)

Country Link
CN (1) CN102025796B (en)
WO (1) WO2012068854A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012068854A1 (en) * 2010-11-23 2012-05-31 中兴通讯股份有限公司 Method and apparatus for updating media access control (mac) address
WO2014089746A1 (en) * 2012-12-10 2014-06-19 华为技术有限公司 Message forwarding method and device
US9397943B2 (en) 2012-08-31 2016-07-19 Hangzhou H3C Technologies Co., Ltd. Configuring virtual media access control addresses for virtual machines
CN107888713A (en) * 2016-09-30 2018-04-06 中兴通讯股份有限公司 A kind of method, apparatus and access device of dynamically distributes MAC Address
CN110830378B (en) * 2018-08-07 2022-05-17 迈普通信技术股份有限公司 Address table item updating method and switching equipment
CN115967699A (en) * 2022-12-28 2023-04-14 深圳市鸿升光通讯设备有限公司 Multicast table data management method

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11991144B2 (en) 2022-04-28 2024-05-21 Cisco Technology, Inc. Seamless MAC address rotation in multi-link device using multiple IP stacks
CN114979090B (en) * 2022-05-27 2024-07-05 深圳市领创星通科技有限公司 IPv6 data packet processing method, device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070097971A1 (en) * 2005-11-03 2007-05-03 Samsung Electronics Co., Ltd. Method of generating and managing connection identifiers for supporting multicast for each group in IPv6-based wireless network and network interface using the method
CN1968273A (en) * 2006-10-26 2007-05-23 杭州华为三康技术有限公司 IPv6 service supporting method and its switching device
CN1980246A (en) * 2006-12-07 2007-06-13 杭州华为三康技术有限公司 One-layer multi-casting flow retransmission method and two-layer multi-casting apparatus
CN101291240A (en) * 2008-06-19 2008-10-22 杭州华三通信技术有限公司 Multicast flow transmission method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025796B (en) * 2010-11-23 2014-06-11 中兴通讯股份有限公司 MAC (media access control) address updating method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070097971A1 (en) * 2005-11-03 2007-05-03 Samsung Electronics Co., Ltd. Method of generating and managing connection identifiers for supporting multicast for each group in IPv6-based wireless network and network interface using the method
CN1968273A (en) * 2006-10-26 2007-05-23 杭州华为三康技术有限公司 IPv6 service supporting method and its switching device
CN1980246A (en) * 2006-12-07 2007-06-13 杭州华为三康技术有限公司 One-layer multi-casting flow retransmission method and two-layer multi-casting apparatus
CN101291240A (en) * 2008-06-19 2008-10-22 杭州华三通信技术有限公司 Multicast flow transmission method and system

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012068854A1 (en) * 2010-11-23 2012-05-31 中兴通讯股份有限公司 Method and apparatus for updating media access control (mac) address
US9397943B2 (en) 2012-08-31 2016-07-19 Hangzhou H3C Technologies Co., Ltd. Configuring virtual media access control addresses for virtual machines
US9397942B2 (en) 2012-08-31 2016-07-19 Hangzhou H3C Technologies Co., Ltd. Packet forwarding
US9667541B2 (en) 2012-08-31 2017-05-30 Hewlett Packard Enterprise Development Lp Virtual MAC address, mask-based, packet forwarding
WO2014089746A1 (en) * 2012-12-10 2014-06-19 华为技术有限公司 Message forwarding method and device
CN104040986A (en) * 2012-12-10 2014-09-10 华为技术有限公司 Message forwarding method and device
CN107888713A (en) * 2016-09-30 2018-04-06 中兴通讯股份有限公司 A kind of method, apparatus and access device of dynamically distributes MAC Address
CN110830378B (en) * 2018-08-07 2022-05-17 迈普通信技术股份有限公司 Address table item updating method and switching equipment
CN115967699A (en) * 2022-12-28 2023-04-14 深圳市鸿升光通讯设备有限公司 Multicast table data management method

Also Published As

Publication number Publication date
WO2012068854A1 (en) 2012-05-31
CN102025796B (en) 2014-06-11

Similar Documents

Publication Publication Date Title
CN102025796B (en) MAC (media access control) address updating method and device
CN102946354B (en) Method, device and the network equipment that a kind of message forwards
CN102217253B (en) Message forwarding method, equipment and network device
CN103841023B (en) The method and apparatus of data forwarding
EP1942617B1 (en) Method, device and system for Ethernet-supported Source Specific Multicast forwarding
CN102577257B (en) Virtual local area network identity transformation method and apparatus
CN104954265B (en) Send the method and interchanger of multicast message
CN103684966B (en) A kind of dynamic host configuration protocol message processing method and processing device
CN102857428B (en) A kind of message forwarding method based on Access Control List (ACL) and equipment
CN101222414A (en) Device, system and method for realizing multicast communication
CN101478490B (en) Method and apparatus for TIPC supporting multi-cluster network communication
WO2015014187A1 (en) Data forwarding method and apparatus that support multiple tenants
CN101286990A (en) Layer 2 multicast forwarding method and device
CN104980355A (en) Source controllable multicast data transmission method and system thereof under SDN Environment
CN107547342B (en) Message broadcasting method and device based on VXLAN tunnel
CN101534209A (en) A method and device for sending multicast messages
WO2022121466A1 (en) Data processing method and device for ethernet virtual private network, and storage medium
US20120185487A1 (en) Method, device and system for publication and acquisition of content
CN101222425B (en) Multicast forwarding method and multicast router
CN106899641A (en) The acquisition methods of data resource, server, control device and communication system
CN103401788B (en) A kind of SPT method for building up and equipment
WO2007054006A1 (en) A base station of wideband wireless access system and a method for realizing group-broadcast service
CN100456684C (en) Method and network device for realizing multicast service
EP3503484B1 (en) Message transmission methods and devices
CN102694734A (en) Multicasting method of double-layer switching equipment based on Linux kernel bridge

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant