CN1937568B - A method and device for implementing message priority mapping - Google Patents
A method and device for implementing message priority mapping Download PDFInfo
- Publication number
- CN1937568B CN1937568B CN2006101122533A CN200610112253A CN1937568B CN 1937568 B CN1937568 B CN 1937568B CN 2006101122533 A CN2006101122533 A CN 2006101122533A CN 200610112253 A CN200610112253 A CN 200610112253A CN 1937568 B CN1937568 B CN 1937568B
- Authority
- CN
- China
- Prior art keywords
- dmac address
- mapping
- cos value
- priority
- message
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Small-Scale Networks (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明公开了一种实现报文优先级映射的方法,设置DMAC地址至COS值映射表;获取当前收到的以太网报文的DMAC地址;在DMAC地址至COS值映射表中进行匹配,判断是否存在匹配的DMAC地址至COS值映射表项,如果存在,则根据匹配成功的表项,获得表项中记录的COS值,用获得的COS值代替当前收到的以太网报文中携带的COS值,并根据COS值匹配,映射得到当前以太网报文封装至的RPR数据报文的优先级。本发明还提供了一种实现报文优先级映射的装置。由于本发明所提供的方法及装置,能够将以太网报文灵活的映射至合适优先级的RPR数据报文,适应了RPR环网承载业务的需要,保证了用户的服务质量,提高了服务稳定性。
The invention discloses a method for realizing message priority mapping, which includes setting a DMAC address-to-COS value mapping table; obtaining the DMAC address of the currently received Ethernet message; matching in the DMAC address-to-COS value mapping table, and judging Whether there is a matching DMAC address-to-COS value mapping entry. If so, obtain the COS value recorded in the entry according to the successfully matched entry, and use the obtained COS value to replace the currently received Ethernet message. The COS value is matched according to the COS value, and the priority of the RPR data packet to which the current Ethernet packet is encapsulated is obtained through mapping. The invention also provides a device for realizing message priority mapping. The method and device provided by the present invention can flexibly map Ethernet packets to RPR data packets with appropriate priority, adapt to the needs of RPR ring network bearing services, ensure the service quality of users, and improve service stability sex.
Description
技术领域technical field
本发明涉及数据通信技术,尤指一种实现报文优先级映射的方法及装置。The invention relates to data communication technology, in particular to a method and device for realizing message priority mapping.
背景技术Background technique
弹性分组环(RPR)是IEEE802.17工作组定义的一种媒体接入控制(MAC)协议。在现有技术的弹性分组环(RPR)解决方案中,RPR设备通常将收到的以太网报文作为数据载荷封装至RPR帧格式的数据报文中。这里,所述RPR帧格式包括基本帧格式和扩展帧格式。Resilient Packet Ring (RPR) is a Media Access Control (MAC) protocol defined by the IEEE802.17 working group. In a resilient packet ring (RPR) solution in the prior art, the RPR device usually encapsulates the received Ethernet message as a data payload into a data message in the RPR frame format. Here, the RPR frame format includes a basic frame format and an extended frame format.
在现有技术中,通常根据服务等级(COS,Class of Service)值映射方法得到以太网报文的优先级。RPR设备通过以太网报文中携带的COS值,实现以太网报文优先级至RPR数据报文优先级的映射;对于不携带COS值的以太网报文,RPR设备则按照固定映射方式将该以太网报文映射至固定的优先级。通常情况下,为了防止不确定的报文占用高优先级的带宽,一般将不携带COS值的以太网报文映射至低优先级。In the prior art, the priority of the Ethernet message is usually obtained according to a Class of Service (COS, Class of Service) value mapping method. The RPR device implements the mapping from the priority of the Ethernet packet to the priority of the RPR data packet through the COS value carried in the Ethernet packet; for the Ethernet packet that does not carry the COS value, the RPR device Ethernet packets are mapped to fixed priorities. Usually, to prevent uncertain packets from occupying high-priority bandwidth, Ethernet packets without COS values are generally mapped to low-priority packets.
RPR数据报文的优先级携带在报文的基础控制(BaseControl)字段的服务级别(Service Class,SC)中。RPR数据报文的优先级共分为四类,包括A0、A1、B和C,其中A0类的优先级最高。不同优先级的报文具有不同的占用带宽以及优先权。当RPR环网发生拥塞时,C类优先级报文由于受到公平算法的调节将被RPR设备丢弃。The priority of the RPR data message is carried in the service class (Service Class, SC) of the base control (BaseControl) field of the message. The priorities of RPR data packets are divided into four categories, including A0, A1, B, and C, among which the priority of A0 is the highest. Packets with different priorities have different occupied bandwidths and priorities. When the RPR ring network is congested, the Class C priority packets will be discarded by the RPR device due to the adjustment of the fairness algorithm.
因此,在实际应用中通过COS值映射得到优先级的方式,通常会将某些重要的以太网报文映射至C类优先级的RPR数据报文,例如OSPF、DHCP、VRRP等组播协议报文。这样就造成在RPR环网发生拥塞时,RPR设备丢弃OSPF、DHCP、VRRP等这类重要的组播协议报文映射成的RPR数据报文,从而导致RPR环网无法正常承载业务,严重影响了用户的服务质量,以及服务的稳定性。Therefore, in practical applications, some important Ethernet packets are usually mapped to RPR data packets with Class C priority, such as multicast protocol packets such as OSPF, DHCP, and VRRP, in practical applications. arts. As a result, when the RPR ring network is congested, the RPR device discards the RPR data packets mapped to important multicast protocol packets such as OSPF, DHCP, and VRRP, which makes the RPR ring network unable to carry services normally and seriously affects the The quality of service for users and the stability of service.
由此可见,在RPR设备处仅按照以太网报文中携带的COS值映射得到RPR数据报文的优先级,已经不能满足RPR环网的应用要求。在RPR环网需要一种更为灵活的优先级映射方法,使以太网报文能够根据网络实际运行环境的需要映射至合适优先级的RPR数据报文。It can be seen that, at the RPR device, the priorities of the RPR data packets are only mapped according to the COS value carried in the Ethernet packets, which cannot meet the application requirements of the RPR ring network. In the RPR ring network, a more flexible priority mapping method is needed, so that Ethernet packets can be mapped to RPR data packets with appropriate priorities according to the requirements of the actual operating environment of the network.
发明内容Contents of the invention
有鉴于此,本发明的主要目的在于提供一种实现报文优先级映射的方法及装置,应用该方法及装置能够将以太网报文灵活的映射至合适优先级的RPR数据报文。In view of this, the main purpose of the present invention is to provide a method and device for implementing packet priority mapping, which can flexibly map Ethernet packets to RPR data packets with appropriate priorities.
为达到上述目的,本发明的技术方案是这样实现的:In order to achieve the above object, technical solution of the present invention is achieved in that way:
一种实现报文优先级映射的方法,应用于RPR网络设备,设置DMAC地址至COS值的映射表;执行以下步骤:A method for implementing message priority mapping, applied to RPR network equipment, setting a mapping table from a DMAC address to a COS value; perform the following steps:
步骤601:当RPR网络设备收到以太网报文,需要对该以太网报文进行RPR扩展帧格式的数据报文封装之前,获取当前收到报文的DMAC地址;Step 601: When the RPR network device receives an Ethernet message, it needs to obtain the DMAC address of the currently received message before encapsulating the Ethernet message into a data message in the RPR extended frame format;
步骤602:根据步骤601中获取的DMAC地址,在DMAC地址至COS值映射表中进行匹配,判断是否存在匹配的DMAC地址至COS值映射表项,如果存在,则执行步骤603;否则,执行步骤604;Step 602: According to the DMAC address obtained in step 601, perform a match in the DMAC address to COS value mapping table, and judge whether there is a matching DMAC address to COS value mapping entry, and if so, perform step 603; otherwise, perform step 603 604;
步骤603:根据匹配成功的表项,获得表项中记录的COS值,用获得的COS值代替当前收到的以太网报文中携带的COS值,执行步骤604;Step 603: Obtain the COS value recorded in the entry according to the successfully matched entry, replace the COS value carried in the currently received Ethernet message with the obtained COS value, and execute step 604;
步骤604:根据COS值匹配,映射得到当前以太网报文封装至的RPR数据报文的优先级;Step 604: According to the COS value matching, the priority of the RPR data packet to which the current Ethernet packet is encapsulated is obtained through mapping;
步骤605:将当前映射得到的优先级添加至封装了当前收到以太网报文的RPR数据报文的基本控制字段中服务级别(SC)内,将封装了所述以太网报文的RPR数据报文映射至当前映射得到的优先级。Step 605: Add the priority obtained by the current mapping to the service level (SC) in the basic control field of the RPR data message that encapsulates the currently received Ethernet message, and encapsulate the RPR data of the Ethernet message The packet is mapped to the priority obtained by the current mapping.
一种实现报文优先级映射的装置,该装置包括包括DMAC地址获取单元21、优先级映射单元72和封装RPR数据报文单元33;其中优先级映射单元72包括:DMAC地址匹配单元721和COS值匹配单元722;A device for implementing message priority mapping, which includes a DMAC
其中,DMAC地址获取单元21用于获取以太网报文中的DMAC地址。Wherein, the DMAC
DMAC地址匹配单元721,用于根据DMAC地址获取单元21获取的DMAC地址匹配记录了的DMAC地址与COS值之间映射关系的DMAC地址映射表,当成功匹配时,则用映射获得的COS值替换以太网报文中的COS值,将替换COS值后的以太网报文发送至COS值匹配单元;当没有成功匹配时,则直接将以太网报文发送至COS值匹配单元;The DMAC address matching unit 721 is used to match the DMAC address mapping table of the mapping relationship between the recorded DMAC address and the COS value according to the DMAC address obtained by the DMAC
COS值匹配单元722,用于根据从DMAC地址匹配单元721收到的以太网报文中携带的COS值映射得到所述RPR数据报文的优先级;The COS value matching unit 722 is configured to map the priority of the RPR data message according to the COS value carried in the Ethernet message received from the DMAC address matching unit 721;
封装RPR数据报文单元33,用于通过与COS值匹配单元722的交互,将COS值匹配单元722映射得到的所述RPR数据报文的优先级,添加至封装了所述以太网报文的RPR数据报文的基本控制字段的服务级别中。The encapsulation RPR
本发明所提供的一种实现报文优先级映射的方法,通过根据需要调整映射关系的以太网报文的DMAC地址设置DMAC地址映射表,在进行以太网报文至RPR数据报文优先级的映射过程中,根据自身的DMAC地址匹配DMAC地址映射表,当匹配成功时,则说明当前以太网报文与RPR数据报文之间的映射关系需要调整,此时则DMAC地址映射表,得到以太网对应的RPR数据报文的优先级。本发明还提供了一种实现报文优先级映射的装置。由于本发明所提供的方法及装置,通过匹配设置的DMAC地址映射表,因此能够将以太网报文灵活的映射至合适优先级的RPR数据报文,适应了RPR环网承载业务的需要,保证了用户的服务质量,提高了服务稳定性。A method for implementing message priority mapping provided by the present invention, by setting the DMAC address mapping table according to the DMAC address of the Ethernet message that needs to adjust the mapping relationship, when performing the priority mapping from the Ethernet message to the RPR data message During the mapping process, the DMAC address mapping table is matched according to its own DMAC address. When the matching is successful, it indicates that the mapping relationship between the current Ethernet message and the RPR data message needs to be adjusted. At this time, the DMAC address mapping table obtains the Ethernet The priority of the RPR data packet corresponding to the network. The invention also provides a device for realizing message priority mapping. Due to the method and device provided by the present invention, by matching the set DMAC address mapping table, the Ethernet message can be flexibly mapped to the RPR data message of appropriate priority, which adapts to the needs of the RPR ring network to carry services and ensures Improve the quality of service for users and improve service stability.
附图说明Description of drawings
图1为本发明方法一实施例的流程图;Fig. 1 is the flowchart of an embodiment of the method of the present invention;
图2为本发明装置一实施例的结构图;Fig. 2 is a structural diagram of an embodiment of the device of the present invention;
图3为本发明装置又一实施例的流程图;Fig. 3 is the flowchart of another embodiment of the device of the present invention;
图4为本发明方法又一实施例的流程图;Fig. 4 is the flowchart of another embodiment of the method of the present invention;
图5为本发明装置再一实施例的流程图;Fig. 5 is the flowchart of another embodiment of the device of the present invention;
图6为本发明方法再一实施例的流程图;Fig. 6 is the flowchart of another embodiment of the method of the present invention;
图7为本发明装置另一实施例的流程图。Fig. 7 is a flowchart of another embodiment of the device of the present invention.
具体实施方式Detailed ways
在本发明中,设置DMAC地址映射表,网络侧将需要调整的以太网报文与RPR数据报文优先级映射关系的以太网报文的DMAC地址,记录在DMAC地址映射表中。这里,所指的调整以太网报文与RPR数据报文优先级映射关系,是相对于现有技术中的映射关系来说。当现有技术中的映射关系不能再满足RPR环网的需要,此时则需要调整以太网报文与自身封装至的RPR数据报文的优先级映射关系,以满足RPR环网的应用要求。In the present invention, the DMAC address mapping table is set, and the network side records the DMAC address of the Ethernet message in the priority mapping relationship between the Ethernet message and the RPR data message to be adjusted in the DMAC address mapping table. Here, the adjustment of the priority mapping relationship between the Ethernet message and the RPR data message referred to is relative to the mapping relationship in the prior art. When the mapping relationship in the prior art can no longer meet the needs of the RPR ring network, then it is necessary to adjust the priority mapping relationship between the Ethernet message and the RPR data message encapsulated by itself, so as to meet the application requirements of the RPR ring network.
当有以太网报文封装至RPR数据报文时,根据以太网报文的DMAC地址匹配DMAC地址映射表,当成功匹配时,则当前以太网报文至RPR数据报文的优先级映射关系需要调整,此时则根据DMAC映射表映射得到该RPR数据报文的优先级;当没有成功匹配时,则当前以太网报文至RPR数据报文的优先级映射关系不需要调整,此时根据以太网报文自身携带的COS值映射得到对应的优先级;然后,将封装了所述以太网报文的RPR数据报文映射至得到的优先级。When an Ethernet packet is encapsulated into an RPR data packet, the DMAC address mapping table is matched according to the DMAC address of the Ethernet packet. When the match is successful, the priority mapping relationship between the current Ethernet packet and the RPR data packet needs to be At this time, the priority of the RPR data message is obtained according to the DMAC mapping table mapping; when there is no successful match, the priority mapping relationship between the current Ethernet message and the RPR data The COS value carried by the network packet itself is mapped to obtain the corresponding priority; then, the RPR data packet encapsulating the Ethernet packet is mapped to the obtained priority.
本发明方法的具体流程如图1所示,当将以太网报文封装至RPR数据报文时,执行以下步骤:The concrete process of the inventive method is as shown in Figure 1, when Ethernet message is encapsulated to RPR data message, carry out the following steps:
步骤101:获取以太网报文的DMAC地址,根据获取的DMAC地址匹配DMAC地址映射表,判断是否成功匹配,如果是,则执行步骤102;否则,执行步骤103。Step 101: Obtain the DMAC address of the Ethernet packet, match the obtained DMAC address with the DMAC address mapping table, and judge whether the match is successful, if yes, execute step 102; otherwise, execute step 103.
步骤102:根据获取的DMAC地址匹配DMAC地址映射表,得到以太网报文封装至的RPR数据报文的优先级。结束当前处理流程。Step 102: Match the DMAC address mapping table according to the obtained DMAC address to obtain the priority of the RPR data packet encapsulated into the Ethernet packet. End the current processing flow.
步骤103:根据以太网报文携带的COS值映射得到所述RPR数据报文的优先级。Step 103: Obtain the priority of the RPR data packet according to the COS value carried in the Ethernet packet.
这里,在步骤103中,还可以根据现有技术中的其他以太网报文与RPR数据报文之间的映射关系,映射得到以太网报文封装至的RPR数据报文的优先级。Here, in step 103, the priority of the RPR data packet to which the Ethernet packet is encapsulated can also be obtained through mapping according to the mapping relationship between other Ethernet packets and RPR data packets in the prior art.
在得到了所述RPR数据报文的优先级之后,则可以进一步将得到的优先级写入封装了所述以太网报文的RPR数据报文的基本控制字段的服务级别中。After the priority of the RPR data packet is obtained, the obtained priority may be further written into the service level of the basic control field of the RPR data packet encapsulating the Ethernet packet.
在本发明中,设置的DMAC地址映射表可以是DMAC地址与优先级之间的映射关系,也可以是DMAC地址与COS值之间的映射关系。In the present invention, the set DMAC address mapping table may be a mapping relationship between DMAC addresses and priorities, or a mapping relationship between DMAC addresses and COS values.
当设置的是DMAC地址与优先级之间映射关系的DMAC地址映射表时,在根据DMAC地址成功匹配DMAC地址映射表时,即执行步骤102时,则根据所述以太网报文的DMAC地址匹配DMAC地址映射表,映射得到与所述DMAC地址对应的优先级,当前得到的优先级即为以太网报文封装至的RPR数据报文的优先级。这里,将设置的DMAC地址与优先级之间映射关系的DMAC地址映射表称为:DMAC地址至优先级映射表。When the DMAC address mapping table of the mapping relationship between the DMAC address and the priority is set, when the DMAC address mapping table is successfully matched according to the DMAC address, that is, when step 102 is performed, then the DMAC address of the Ethernet message is matched The DMAC address mapping table is mapped to obtain the priority corresponding to the DMAC address, and the currently obtained priority is the priority of the RPR data message encapsulated into the Ethernet message. Here, the DMAC address mapping table of the set mapping relationship between the DMAC address and the priority is referred to as: DMAC address to priority mapping table.
当设置的是DMAC地址与COS值之间映射关系的DMAC地址映射表时,在根据DMAC地址成功匹配DMAC地址映射表时,即执行步骤102时,则根据所述以太网报文的DMAC地址匹配DMAC地址映射表,获取与所述DMAC地址对应的COS值,用获取的COS值替换所述以太网报文中的COS值,根据替换后的COS值映射得到对应的优先级,则当前得到的优先级即为以太网报文封装至的RPR数据报文的优先级。这里,将设置的DMAC地址与COS值之间映射关系的DMAC地址映射表称为:DMAC地址至COS值映射表。When the DMAC address mapping table of the mapping relationship between the DMAC address and the COS value is set, when the DMAC address mapping table is successfully matched according to the DMAC address, that is, when step 102 is performed, then the DMAC address of the Ethernet message is matched The DMAC address mapping table obtains the COS value corresponding to the DMAC address, replaces the COS value in the Ethernet message with the obtained COS value, and obtains the corresponding priority according to the replaced COS value mapping, then the currently obtained The priority is the priority of the RPR data packet to which the Ethernet packet is encapsulated. Here, the DMAC address mapping table for the mapping relationship between the set DMAC address and the COS value is called: DMAC address to COS value mapping table.
在使用DMAC地址至COS值映射表的情况下,对于不携带COS值的以太网报文可以采用固定映射方式映射得到对应的优先级,也可以采用添加COS值的方式。添加COS值的方式是指,根据以太网报文的DMAC地址匹配DMAC地址至COS值映射表的结果,将匹配得到COS值添加到以太网报文中,进而根据以太网报文中添加的COS值得到对应的优先级。In the case of using a DMAC address-to-COS value mapping table, for Ethernet packets that do not carry a COS value, a fixed mapping method can be used to map to obtain a corresponding priority, or a method of adding a COS value can also be used. The way to add the COS value is to match the result of the DMAC address to COS value mapping table according to the DMAC address of the Ethernet message, add the matched COS value to the Ethernet message, and then add the COS value according to the added COS value in the Ethernet message. The value gets the corresponding priority.
如图2为本发明方法对应的实现报文优先级映射装置的结构示意。如图2所示,本发明装置包括:DMAC地址获取单元21和优先级映射单元22。FIG. 2 is a schematic structural diagram of a device for realizing packet priority mapping corresponding to the method of the present invention. As shown in FIG. 2 , the device of the present invention includes: a DMAC
其中,DMAC地址获取单元21,用于获取以太网报文中的DMAC地址。Wherein, the DMAC
优先级映射单元22,用于通过与DMAC地址获取单元21的交互,根据DMAC地址获取单元21获取的DMAC地址匹配DMAC地址映射表,当成功匹配时,则映射得到以太网报文封装至的RPR数据报文的优先级。The
这里所指的优先级映射单元22与DMAC地址获取单元21的交互是指:优先级映射单元22主动从DMAC地址获取单元21获取以太网报文的DMAC地址、或优先级映射单元22被动接收DMAC地址获取单元21发送的以太网报文的DMAC地址。The interaction between the
在本发明所提供的装置中,进一步包括:封装RPR数据报文单元33,具体结构如图3所示。The device provided by the present invention further includes: a
这里,封装RPR数据报文单元33,用于通过与优先级映射单元22的交互,将优先级映射单元22映射得到的优先级,添加至封装了所述以太网报文的RPR数据报文的基本控制字段的服务级别中。Here, the encapsulating RPR
这里,所指的优先级映射单元22与封装RPR数据报文单元33的交互是指:封装RPR数据报文单元33主动从优先级映射单元22获取当前以太网报文的优先级、或RPR数据报文单元33被动接收优先级映射单元22发送的当前以太网报文的优先级。Here, the interaction between the
同时,封装RPR数据报文单元33,将获取的优先级添加至封装了所述以太网报文的RPR数据报文中的以太网报文,根据RPR设备不同的数据处理流程,可以是从DMAC地址获取单元21中直接得到;也可以是DMAC地址获取单元21将所述以太网报文传送给优先级映射单元22,再由优先级映射单元22传送给封装RPR数据报文单元33;也可以是封装RPR数据报文单元33,自身首先收到当前要封装的以太网报文,然后发送给DAMC地址获取单元21,而在封装以太网报文则可以根据自身接收到的以太网报文进行封装。Simultaneously, encapsulation RPR
在本发明中,根据设置的DMAC地址映射表的不同,列举两实施例并参照附图,对本发明做进一步的详细说明。In the present invention, according to the difference of the set DMAC address mapping table, two embodiments are listed and the present invention is further described in detail with reference to the accompanying drawings.
其中,实施例一描述的是:DMAC地址映射表中记录的是DMAC地址与优先级之间的映射关系;实施例二描述的是:DMAC地址映射表中记录的是DMAC地址与COS值之间的映射关系。本发明中所描述的两个实施例均应用于RPR环网上的RPR设备。Wherein, what embodiment one describes is: what is recorded in the DMAC address mapping table is the mapping relationship between the DMAC address and the priority; what embodiment two describes is: what is recorded in the DMAC address mapping table is the relationship between the DMAC address and the COS value mapping relationship. The two embodiments described in the present invention are both applied to RPR devices on the RPR ring network.
实施例一Embodiment one
在执行本实施例所述方法之前,需要预先设置以太网报文的DMAC地址至优先级映射表,用于根据以太网报文的DMAC地址,实现以太网报文优先级至RPR数据报文优先级的映射。Before performing the method described in this embodiment, it is necessary to pre-set the DMAC address of the Ethernet message to the priority mapping table, which is used to realize the priority of the Ethernet message to the priority of the RPR data message according to the DMAC address of the Ethernet message level mapping.
在DMAC地址至优先级映射表中,每个DMAC地址至优先级映射表项都包括以下三项内容,DMAC地址、掩码(MASK)和优先级,具体如表1所示。在本实施例中,可以将DMAC地址至优先级映射表项简称为表项。In the DMAC address-to-priority mapping table, each DMAC address-to-priority mapping entry includes the following three items: DMAC address, mask (MASK) and priority, as shown in Table 1. In this embodiment, the DMAC address-to-priority mapping entry may be referred to as an entry for short.
表1Table 1
其中,DMAC地址的长度为48比特(bits);掩码的长度可以根据具体的需要配置0~48bits中的任意值;优先级的长度为2bits。这里,掩码的长度可以是0~48bit中的任意值,但由于DMAC地址的高24位通常情况下是固定的,因此较佳的掩码的长度最好选择在0~24位之间。当掩码长度不足48bit时,则掩码从DMAC地址的低位开始进行屏蔽。同时,优先级为2bit的原因是:RPR数据报文只分为四个等级的优先级,当然,表项中优先级长度可以根据日后RPR数据报文的优先级等级进行相应扩展。Wherein, the length of the DMAC address is 48 bits; the length of the mask can be configured with any value from 0 to 48 bits according to specific needs; the length of the priority is 2 bits. Here, the length of the mask can be any value from 0 to 48 bits, but since the upper 24 bits of the DMAC address are usually fixed, a better length of the mask should be selected between 0 and 24 bits. When the length of the mask is less than 48 bits, the mask is masked from the low bit of the DMAC address. At the same time, the reason why the priority is 2 bits is that the RPR data message is only divided into four levels of priority. Of course, the length of the priority in the table entry can be extended correspondingly according to the priority level of the RPR data message in the future.
DMAC地址至优先级映射表表项中的DMAC地址和掩码用来联合匹配以太网报文中的DMAC地址,当匹配成功时,则获得与该以太网报文DMAC地址对应的优先级,即以太网报文映射至的RPR数据报文的优先级。具体匹配的方法在本实施例方法的执行流程中进行详细描述。The DMAC address and mask in the DMAC address-to-priority mapping table entry are used to jointly match the DMAC address in the Ethernet packet. When the match is successful, the priority corresponding to the DMAC address of the Ethernet packet is obtained, that is, The priority of the RPR data packet to which the Ethernet packet is mapped. The specific matching method is described in detail in the execution flow of the method in this embodiment.
本实施例方法的流程如图4所示,包括以下步骤:The process flow of the method of this embodiment is shown in Figure 4, including the following steps:
步骤401:当RPR设备收到以太网报文,需要对该以太网报文进行RPR扩展帧格式的数据报文封装之前,获取当前收到以太网报文中携带的DMAC地址。Step 401: When the RPR device receives an Ethernet packet, it needs to obtain the DMAC address carried in the currently received Ethernet packet before encapsulating the Ethernet packet with a data packet in the RPR extended frame format.
步骤402:根据步骤401中获取的DMAC地址,在DMAC地址至优先级映射表中进行匹配,判断是否存在匹配的DMAC地址至优先级映射表项,如果存在,则执行步骤403;否则,执行步骤404。Step 402: According to the DMAC address obtained in step 401, match in the DMAC address to the priority mapping table, judge whether there is a matching DMAC address to the priority mapping table entry, if there is, then perform step 403; otherwise, perform step 404.
这里,判断是否存在与获取的DMAC地址匹配的表项,也就是用所述获取的DMAC地址匹配DMAC地址至优先级映射表中的每个表项,判断是否存在与所述DMAC地址匹配的表项,如果其中有某一个表项成功匹配,则所述DMAC地址存在匹配的表项;如果DMAC地址至优先级映射表没有一个表项成功匹配,则所述DMAC地址不存在匹配的表项。Here, judge whether there is an entry matching the obtained DMAC address, that is, use the obtained DMAC address to match each entry in the DMAC address to priority mapping table, and judge whether there is a table matching the DMAC address If one of the entries is successfully matched, there is a matching entry for the DMAC address; if no entry in the DMAC address-to-priority mapping table is successfully matched, then there is no matching entry for the DMAC address.
其中,判断某个表项是否能够成功匹配获取的DMAC地址为:利用表项中的掩码屏蔽表项中的DMAC地址和获取的DMAC,判断屏蔽后的表项中的DMAC地址和获取的DMAC是否相同,如果相同,则成功匹配;否则,没有成功匹配。具体为:根据掩码数据0所在的比特位,屏蔽表项中DMAC地址对应的比特位、以及获取的DMAC地址对应的比特位,判断表项中DMAC地址未被屏蔽的比特位和获取的DMAC地址未被屏蔽的比特位上的数据是否相同,如果相同,则该表项成功匹配所述DMAC地址;否则,该表项不能成功匹配所述DMAC地址。Among them, judging whether an entry can successfully match the obtained DMAC address is: using the mask in the entry to shield the DMAC address in the entry and the obtained DMAC, and judging the DMAC address in the masked entry and the obtained DMAC Whether they are the same, if they are the same, the match is successful; otherwise, there is no match. Specifically: According to the bit where the mask data 0 is located, the bit corresponding to the DMAC address in the shielded entry, and the bit corresponding to the obtained DMAC address, determine the unmasked bit of the DMAC address in the entry and the obtained DMAC Whether the data on the unmasked bits of the address are the same, if they are the same, the entry successfully matches the DMAC address; otherwise, the entry cannot successfully match the DMAC address.
以下以掩码长度为12bit,表项值如表2所示为例,进一步说明判断某个表项是否能够成功匹配获取的DMAC地址的方法。Taking the mask length as 12 bits and table entry values as shown in Table 2 as an example, the method for judging whether a certain entry can successfully match the obtained DMAC address is further described below.
表2Table 2
表2中的0x代表十六进制,表项配置的DMAC地址为0x0100.5E11.3388,掩码为0xF00,优先级为1。这里,掩码的二进制表示为1111.0000.0000,表示屏蔽获取的DMAC地址和该掩码对应的表项中的DMAC地址中的后8个比特位,比较获取的DMAC和该表项中的DMAC地址的高32个比特位。当收到的以太网报文的DMAC地址为0x0100.5E11.3344,此时比较以太网报文的DMAC和表项中的DMAC地址的高32个比特位是否相同,由于0x0100.5E11.3344和0x0100.5E11.3388的高32个比特位相同,因此收到的以太网报文成功匹配当前表项,则该以太网报文对应的优先级为1。0x in Table 2 represents hexadecimal, the DMAC address configured in the entry is 0x0100.5E11.3388, the mask is 0xF00, and the priority is 1. Here, the binary representation of the mask is 1111.0000.0000, which means that the acquired DMAC address and the last 8 bits of the DMAC address in the entry corresponding to the mask are shielded, and the obtained DMAC is compared with the DMAC address in the entry The upper 32 bits. When the DMAC address of the received Ethernet message is 0x0100.5E11.3344, compare whether the upper 32 bits of the DMAC address of the Ethernet message and the DMAC address in the entry are the same, because 0x0100.5E11.3344 and The upper 32 bits of 0x0100.5E11.3388 are the same, so the received Ethernet packet successfully matches the current entry, and the corresponding priority of the Ethernet packet is 1.
当收到的以太网报文的DMAC地址为0x0100.5D11.3344,则此时以太网报文的DMAC和配置的MAC地址的高32个比特位上的数据不相同,则当前收到的以太网报文不能匹配到当前表项。When the DMAC address of the received Ethernet message is 0x0100.5D11.3344, the DMAC of the Ethernet message is different from the data in the upper 32 bits of the configured MAC address, and the currently received Ethernet The network packet cannot match the current entry.
当然在本实施例中,也可以不用DMAC和掩码联合对收到的以太网报文的DMAC地址进行匹配,仅在表项中配置的DMAC地址,根据收到以太网报文的DMAC地址判断DMAC地址至优先级映射表是否存在相同的DMAC,如果存在,则成功匹配;否则,则不成功匹配。Of course, in this embodiment, the DMAC address of the received Ethernet message can also be matched without the combination of DMAC and mask, and only the DMAC address configured in the entry can be judged according to the DMAC address of the received Ethernet message. Whether the same DMAC exists in the DMAC address-to-priority mapping table, and if it exists, the match is successful; otherwise, the match is unsuccessful.
步骤403:根据成功匹配的表项,映射得到表项中记录的优先级,执行步骤405。Step 403: According to the successfully matched entry, the priority of the record in the entry is obtained through mapping, and step 405 is executed.
步骤404:按照现有技术中的COS值匹配的方式,映射得到当前收到以太网报文封装至的RPR数据报文的优先级。Step 404: According to the COS value matching method in the prior art, the priority of the RPR data packet to which the currently received Ethernet packet is encapsulated is obtained through mapping.
步骤405:将当前映射得到的优先级添加至封装了当前收到以太网报文的RPR数据报文的基本控制(basecontrol)字段中服务级别(SC)内,将封装了所述以太网报文的RPR数据报文映射至当前映射得到的优先级。Step 405: Add the priority obtained by the current mapping to the service level (SC) in the basic control (basecontrol) field of the RPR data message that encapsulates the currently received Ethernet message, and encapsulate the Ethernet message The RPR data packets are mapped to the priority obtained by the current mapping.
图5为本实施例与方法对应的装置结构图。如图5所示,包括DMAC地址获取单元21、优先级映射单元52和封装RPR数据报文单元33。其中优先级映射单元22包括:DMAC地址匹配单元521和COS值匹配单元522。FIG. 5 is a structural diagram of a device corresponding to the method in this embodiment. As shown in FIG. 5 , it includes a DMAC
其中,DMAC地址获取单元21用于获取以太网报文中的DMAC地址。Wherein, the DMAC
DMAC地址匹配单元521,用于通过与DMAC地址获取单元21的交互,根据DMAC地址获取单元21获取的DMAC地址,匹配记录了DMAC地址与优先级之间映射关系的DMAC地址映射表,当成功匹配时,则映射得到所述RPR数据报文的优先级;当没有成功匹配时,则指示COS值匹配单元522映射得到所述RPR数据报文的优先级。The DMAC
COS值匹配单元522,用于根据DMAC地址匹配单元521的指示,根据以太网报文携带的COS值映射得到所述RPR数据报文的优先级。The COS
封装RPR数据报文单元33,用于通过与DMAC地址匹配单元521的交互,将DMAC地址匹配单元521映射得到的优先级,添加至封装了所述以太网报文的RPR数据报文的基本控制字段的服务级别中;以及通过与COS值匹配单元522的交互,将COS值匹配单元522映射得到的优先级,添加至封装了所述以太网报文的RPR数据报文的基本控制字段的服务级别中。Encapsulating the RPR
实施例二Embodiment two
在执行本实施例所述方法之前,需要根据调整的以太网报文与RPR数据报文之间优先级映射关系,设置以太网报文的DMAC地址与对应的COS值之间映射关系的DMAC地址映射表。具体方法是:根据各需要调整的以太网报文封装至的RPR数据报文的优先级,获取与该优先级对应的COS值,记录各以太网报文的DMAC地址与对应的COS值之间映射关系的DMAC地址映射表。Before executing the method described in this embodiment, it is necessary to set the DMAC address of the mapping relationship between the DMAC address of the Ethernet message and the corresponding COS value according to the priority mapping relationship between the adjusted Ethernet message and the RPR data message mapping table. The specific method is: according to the priority of the RPR data message encapsulated into each Ethernet message that needs to be adjusted, obtain the COS value corresponding to the priority, and record the difference between the DMAC address of each Ethernet message and the corresponding COS value The DMAC address mapping table of the mapping relationship.
在DMAC地址至COS值映射表中,每个DMAC地址至COS值映射表项都包括以下三项内容,DMAC地址、掩码(MASK)和对应的COS值,具体如表3所示。在本实施例中,可以将DMAC地址至COS值映射表项简称为表项。In the DMAC address-to-COS value mapping table, each DMAC address-to-COS value mapping entry includes the following three items, DMAC address, mask (MASK) and corresponding COS value, as shown in Table 3. In this embodiment, the DMAC address-to-COS value mapping entry may be referred to as an entry for short.
表3table 3
其中,DMAC地址的长度为48比特(bits);掩码的长度可以根据具体的需要配置0~48bits中的任意值;COS值的长度为3bits。这里,掩码的长度可以是0~48bit中的任意值,但由于DMAC地址的高24位通常情况下是固定的,因此较佳的,掩码的长度最好选择在0~24位之间。当掩码长度不足48bit时,则可以设置掩码从DMAC地址的低位开始进行屏蔽。同时,COS值的长度是根据以太网报文中携带的COS值的长度确定,当然,表项中COS值长度可以根据日后以太网报文中携带的COS值进行相应扩展。Wherein, the length of the DMAC address is 48 bits; the length of the mask can be configured with any value from 0 to 48 bits according to specific needs; the length of the COS value is 3 bits. Here, the length of the mask can be any value from 0 to 48 bits, but since the upper 24 bits of the DMAC address are usually fixed, it is better to choose the length of the mask between 0 and 24 bits . When the length of the mask is less than 48 bits, the mask can be set to mask from the low bit of the DMAC address. At the same time, the length of the COS value is determined according to the length of the COS value carried in the Ethernet message. Of course, the length of the COS value in the entry can be extended correspondingly according to the COS value carried in the Ethernet message in the future.
DMAC地址至COS值映射表表项中的DMAC地址和掩码用来联合匹配COS值,当匹配成功时,则获得与该以太网报文DMAC地址对应的COS值。具体匹配的方法,与本实施例一中根据DMAC地址和掩码联合匹配得到优先级的方法相同,所不同的是,在本实施例中根据DMAC地址和掩码联合匹配得到的是COS值。The DMAC address and the mask in the DMAC address-to-COS value mapping table entry are used to jointly match the COS value, and when the match is successful, the COS value corresponding to the DMAC address of the Ethernet packet is obtained. The specific matching method is the same as the method for obtaining the priority according to the joint matching of the DMAC address and the mask in the first embodiment, except that the COS value is obtained according to the joint matching of the DMAC address and the mask in this embodiment.
本实施例方法的流程如图6所示,包括以下步骤:The process flow of the method of this embodiment is shown in Figure 6, including the following steps:
步骤601:当RPR网络设备收到以太网报文,需要对该以太网报文进行RPR扩展帧格式的数据报文封装之前,获取当前收到报文的DMAC地址。Step 601: When an RPR network device receives an Ethernet packet, it needs to obtain the DMAC address of the currently received packet before encapsulating the Ethernet packet in a data packet in the RPR extended frame format.
步骤602:根据步骤601中获取的DMAC地址,在DMAC地址至COS值映射表中进行匹配,判断是否存在匹配的DMAC地址至COS值映射表项,如果存在,则执行步骤603;否则,执行步骤604。Step 602: According to the DMAC address obtained in step 601, perform a match in the DMAC address to COS value mapping table, and judge whether there is a matching DMAC address to COS value mapping entry, and if so, perform step 603; otherwise, perform step 603 604.
这里,判断是否存在与获取的DMAC地址匹配的DMAC地址至COS值映射表项的具体方法,与实施例一中判断是否存在与获取的DMAC地址匹配的DMAC地址至优先级映射表项的方法相同,在此不再详述。Here, the specific method for judging whether there is a DMAC address-to-COS value mapping entry that matches the obtained DMAC address is the same as the method for judging whether there is a DMAC address-to-priority mapping entry that matches the obtained DMAC address in Embodiment 1 , which will not be described in detail here.
步骤603:根据匹配成功的表项,获得表项中记录的COS值,用获得的COS值代替当前收到的以太网报文中携带的COS值,执行步骤604。Step 603: Obtain the COS value recorded in the entry according to the successfully matched entry, replace the COS value carried in the currently received Ethernet message with the obtained COS value, and execute step 604.
步骤604:根据现有技术中的COS值匹配,映射得到当前以太网报文封装至的RPR数据报文的优先级。Step 604: According to the matching of COS values in the prior art, the priority of the RPR data packet to which the current Ethernet packet is encapsulated is obtained through mapping.
步骤605:将当前映射得到的优先级添加至封装了当前收到以太网报文的RPR数据报文的基本控制(basecontrol)字段中服务级别(SC)内,将封装了所述以太网报文的RPR数据报文映射至当前映射得到的优先级。Step 605: Add the priority obtained by the current mapping to the service level (SC) in the basic control (basecontrol) field of the RPR data message that encapsulates the currently received Ethernet message, and encapsulate the Ethernet message The RPR data packets are mapped to the priority obtained by the current mapping.
图7为本实施例与方法对应的装置结构图。如图7所示,包括DMAC地址获取单元21、优先级映射单元72和封装RPR数据报文单元33。其中优先级映射单元72包括:DMAC地址匹配单元721和COS值匹配单元722。FIG. 7 is a structural diagram of a device corresponding to the method in this embodiment. As shown in FIG. 7 , it includes a DMAC
其中,DMAC地址获取单元21用于获取以太网报文中的DMAC地址。Wherein, the DMAC
DMAC地址匹配单元721,用于根据DMAC地址获取单元21获取的DMAC地址匹配记录了的DMAC地址与COS值之间映射关系的DMAC地址映射表,当成功匹配时,则用映射获得的COS值替换以太网报文中的COS值,将替换COS值后的以太网报文发送至COS值匹配单元;当没有成功匹配时,则直接将以太网报文发送至COS值匹配单元;The DMAC address matching unit 721 is used to match the DMAC address mapping table of the mapping relationship between the recorded DMAC address and the COS value according to the DMAC address obtained by the DMAC
COS值匹配单元722,用于根据从DMAC地址匹配单元721收到的以太网报文中携带的COS值映射得到所述RPR数据报文的优先级。The COS value matching unit 722 is configured to map the COS value carried in the Ethernet message received from the DMAC address matching unit 721 to obtain the priority of the RPR data message.
封装RPR数据报文单元33,用于通过与COS值匹配单元722的交互,将COS值匹配单元722映射得到的所述RPR数据报文的优先级,添加至封装了所述以太网报文的RPR数据报文的基本控制字段的服务级别中。The encapsulation RPR
本发明所提供方法的能够在FPGA、NP和CPU等不同的硬件内实现;本发明所提供的装置可以位于FPGA、NP和CPU等不同的硬件芯片内。The method provided by the present invention can be realized in different hardware such as FPGA, NP and CPU; the device provided by the present invention can be located in different hardware chips such as FPGA, NP and CPU.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention.
Claims (2)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2006101122533A CN1937568B (en) | 2006-08-29 | 2006-08-29 | A method and device for implementing message priority mapping |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2006101122533A CN1937568B (en) | 2006-08-29 | 2006-08-29 | A method and device for implementing message priority mapping |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN1937568A CN1937568A (en) | 2007-03-28 |
| CN1937568B true CN1937568B (en) | 2010-06-09 |
Family
ID=37954844
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN2006101122533A Expired - Fee Related CN1937568B (en) | 2006-08-29 | 2006-08-29 | A method and device for implementing message priority mapping |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN1937568B (en) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101282282B (en) * | 2007-04-06 | 2010-08-25 | 杭州华三通信技术有限公司 | Method, system and terminal for determining service quality degree |
| CN101312425A (en) * | 2007-05-24 | 2008-11-26 | 华为技术有限公司 | A method and device for quality assurance through different network messages |
| CN101594296B (en) * | 2008-05-30 | 2012-08-22 | 原创信通电信技术(北京)有限公司 | IP telecommunication network edge gateway equipment resource management method based on fairness algorithm |
| CN102104547A (en) * | 2011-02-24 | 2011-06-22 | 上海华为技术有限公司 | Method, device and system for transmitting data messages in train control system |
| CN111866202B (en) * | 2019-11-08 | 2023-04-07 | 北京嘀嘀无限科技发展有限公司 | Message sending method and device, electronic equipment and storage medium |
-
2006
- 2006-08-29 CN CN2006101122533A patent/CN1937568B/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| CN1937568A (en) | 2007-03-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11528598B2 (en) | Identifying and controlling remote user equipment on network side | |
| US11558879B2 (en) | Handling network traffic via a fixed access | |
| US8917625B2 (en) | Mapping quality of service (QOS) from a wireless network to a wired network | |
| US10263916B2 (en) | System and method for message handling in a network device | |
| US9154993B1 (en) | Mobile-IPv6 encapsulation for wireless networks | |
| CN101296186A (en) | A routing switching device, method and switching line card board | |
| WO2018126692A1 (en) | Method and apparatus for controlling data transmission | |
| EP2216946B1 (en) | Bi-directional traffic classification for wireless communication | |
| CN107196834B (en) | Message processing method and device | |
| CN105052106B (en) | method and system for receiving and transmitting Internet Protocol (IP) data packets | |
| CN113765762A (en) | Data transmission method and device | |
| CN106161226A (en) | Send, receive the method and apparatus of stream specification rule | |
| CN110062060B (en) | System and method for IP address allocation | |
| JP7572013B2 (en) | IPv6 network communication method, device, and system | |
| CN1937568B (en) | A method and device for implementing message priority mapping | |
| US20100303069A1 (en) | Server, transmission system and gre tunnel encapsulation transferring method thereof | |
| CN113438705A (en) | Communication data processing method, communication data processing device, communication equipment and storage medium | |
| TW202025677A (en) | Information transmission method and apparatus, and communication device | |
| US20070127456A1 (en) | Communications apparatus and method | |
| EP3395017B1 (en) | Improvements in network transmission of usb traffic | |
| CN110505137B (en) | Function expansion type wired network device | |
| JP2018142796A (en) | Routing control system and routing control method | |
| CN111555977A (en) | Method, device and system for business processing |
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 | ||
| CP03 | Change of name, title or address | ||
| CP03 | Change of name, title or address |
Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No. Patentee after: NEW H3C TECHNOLOGIES Co.,Ltd. Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base Patentee before: HANGZHOU H3C TECHNOLOGIES Co.,Ltd. |
|
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20230616 Address after: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province Patentee after: H3C INFORMATION TECHNOLOGY Co.,Ltd. Address before: 310052 Changhe Road, Binjiang District, Hangzhou, Zhejiang Province, No. 466 Patentee before: NEW H3C TECHNOLOGIES Co.,Ltd. |
|
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20100609 |