CN102025796A - MAC (media access control) address updating method and device - Google Patents
MAC (media access control) address updating method and device Download PDFInfo
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/10—Mapping addresses of different types
- H04L61/103—Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5069—Address allocation for group communication, multicast communication or broadcast communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/618—Details of network addresses
- H04L2101/622—Layer-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地址表。本发明还公开了用于实现所述方法的装置。
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.
Description
技术领域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
处理模块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
执行模块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
转换模块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转发条目为:
(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
参见图2,所述装置还包括收发模块104,所述装置还可以包括存储模块105。Referring to FIG. 2 , the device further includes a
收发模块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
存储模块105用于存储映射关系。存储模块105用于存储IPv4版本的IP地址与MAC地址之间的固定映射关系及IPv6版本的IP地址与MAC地址之间的固定映射关系,可以将这两种映射关系分别存储。执行模块102可以根据存储模块105中存储的IPv4版本的IP地址或IPv6版本的IP地址与MAC地址之间的固定映射关系将IGMP Snooping表项中的组播组IP地址或MLDSnooping表项中的组播组IP地址映射为组播MAC地址。The
参见图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
第一解析单元1011用于对IPv4组播接收方发送的报文进行解析。收发模块104在收到报文后,判断该报文的协议类型是IPv4版本还是IPv6版本,当确定该报文的协议类型为IPv4版本时,通知第一解析单元1011进行解析。第一解析单元1011在收到IPv4组播接收方发送的报文后,判断该报文是加入报文还是离开报文,并解析出该报文中所包含的参数信息。其中,该参数信息至少包括组播组IP地址及VLAN ID,在接收所述报文时可以获得接收该报文的端口的端口号。一个组播组IP地址可以对应多个端口号,一个VLAN ID可以对应多个端口号。例如,第一解析单元1011收到报文后,确定接收该报文的端口的端口号为端口1,解析出的报文参数信息为:The
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
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
第二查询单元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
第一创建单元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
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
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
操作单元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
地址表单元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
下面通过流程来介绍组播方法。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
参见图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
步骤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
步骤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
步骤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
参见图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
步骤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
步骤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
步骤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
步骤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
步骤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
步骤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
步骤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
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。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)
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)
| 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)
| 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)
| 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)
| 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 |
-
2010
- 2010-11-23 CN CN201010557252.6A patent/CN102025796B/en active Active
-
2011
- 2011-05-31 WO PCT/CN2011/075002 patent/WO2012068854A1/en not_active Ceased
Patent Citations (4)
| 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)
| 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 |
