METHOD FOR FORWARDING PACKET AND APPARATUS THEREOF

Abstract

A method for transmitting message includes setting the coincidence relation between the physic features and traffic features. The method includes the following steps: A. receiving the message, and obtaining the physic feature of said message (301); B. looking up the coincidence relation between the physic features and traffic features based on the obtained physic features, thereby obtaining the traffic feature (302); C. encapsulating the traffic feature of message into the message, and transmitting the said message (303). In addition, an apparatus for transmitting message. By applying the method and apparatus, it realizes that the network device can process the message directly according to the traffic feature information of message, and it increases the efficiency of message process and realizes the discrepant service to the users, and decreases the cost for processing message during the management, and improves the management and control to traffic in management.

Method for Forwarding Packet and Apparatus Thereof
Field of the Technology
[0001] The present invention relates to data communication technologies, more particularly to a method and an apparatus for forwarding packet.
Background of the Invention
[0002] Virtual Local Area Network (VLAN) is a booming technique, which divides equipment in a Local Area Network (LAN) not physically but logically into segments, and thereby implementing virtual working groups.
[0003] The IEEE 802.1Q standard draft defines a method for bearing several logical VLAN subnets on the same physical link. The IEEE 802.1Q adds four bytes into a standard IEEE802.3 Ethernet frame, wherein, the four bytes are called a Virtual Local Area Network Tag (VLAN Tag), as shown in Figure 1, which is a schematic diagram illustrating a structure of a virtual Ethernet frame based on the IEEE802.1Q. In the definition of the virtual Ethernet frame structure shown in Figure 1, a VLAN Tag is inserted between a source Media Access Control (MAC) address and a frame type. The VLAN Tag contains a type field of value 0x8100, which occupies two bytes and is used for identifying the Ethernet frame as a frame of the VLAN structure. The VLAN Tag also contains VLAN Identifier (VLAN-ID), which occupies 12 bits and can support 4096 VLAN instances.
0004] Recently, with the widespread applications of the VLAN, especially in Metropolitan Area Networks (MANs), each user will use one VLAN, which has made the 4096 VLAN instances defined in the virtual Ethernet frame structure become a bottleneck of the network development.
[0005] In order to solve the problem, a QinQ technique, i.e. 802.1Q in 802.1Q technique for expanding the VLAN ID number is provided. It also can be called a VLAN stack technique. The QinQ technique satisfies the demand of networks by increasing the

number of the VLAN ID.
[0006] The QinQ technique adds a 4-bytes VLAN Tag into the existing 802.1Q frame. i.e., adds a 4 bytes VLAN Tag, which is completely the same as that in the 802.1Q. closely behind the VLAN Tag in the 802.1Q, as shown in figure' 2. Under such a design concept and a scheme, the QinQ technique is completely compatible with all the characteristics of the original 802.1Q VLAN. Meanwhile, the added 12-bit VLAN ID makes the number of available VLAN IDs reach as high as 24 bits, therefore satisfying the demand for the VLAN ID under diversified circumstances.
[0007] In the related art, the QinQ technique is implemented as follows: a network device which supports the QinQ technique, such as a convergence switch, a router, a broadband access server, etc., receives an Ethernet packet with only one VLAN Tag sent by a user access device. It encapsulates another VLAN Tag into the packet according to a standard VLAN tagging technique, such as in-port number, or out-port number, before forwarding the packet to a backbone network.
[0008] The existing VLAN tagging techniques includes: port-based VLAN tagging techniques, MAC-based VLAN tagging techniques, network layer based VLAN tagging techniques and Internet Protocol (IP) multicast based VLAN tagging techniques.
[0009] Although the second VLAN Tag in the related art can provide a VLAN lag number as long as 24 bits, the two VLAN tags contained in the Ethernet packet can only reflect physical features of the Ethernet packet, such as out-port information of the Ethernet packet, MAC address information, etc., while not reflecting service information corresponding to the Ethernet packet. Therefore, after the backbone network receives an Ethernet packet forwarded by the convergence switch, it cannot process the Ethernet packet according to corresponding service features of the Ethernet packet, and cannot implement service management and control in operations.
Summary of the Invention
[0010] The present invention provides a method for forwarding packet, so as to forward packet which carries a service feature, and it is possible for a network device in a

backbone network to process the packet according to the service feature of the packet.
[0011] The present invention also provides an apparatus for forwarding packet, the apparatus makes it possible to forward packet, and the network device which received the packet can process the packet according to the service feature of the packet.
[0012] The technical scheme according to one aspect of, the present invention is implemented as follows:
[0013] A method for forwarding packet includes:
[0014] configuring a corresponding relationship between a physical feature and a service feature of a packet;
[0015] receiving a packet, obtaining the physical feature of the packet;
[0016] finding the corresponding relationship between the physical feature and the service feature according to the obtained physical feature, and obtaining the service feature of the packet;
[0017] encapsulating the service feature of the packet into the packet, and forwarding the packet which has been encapsulated with the service feature.
[0018] Wherein, the service feature is represented by a second Virtual Local Area Network Tag (VLAN Tag).
[0019] Wherein, the service feature includes: service type of the packet, or service priority of the packet.
[0020] Wherein, the physical feature includes: in-port number, Media Access Control (MAC) address, network address, IP multicast or a first VLAN Tag.
[0021] Wherein, the physical feature is the first VLAN Tag;
[0022] the corresponding relationships between the physical feature and the service

feature include: a corresponding relationship between the service priority of the packet and the first VLAN Tag; and a corresponding relationship between the service type of the packet and the first VLAN Tag.
[0023] In addition, a corresponding relationship is further ;set between the physical feature of the packet and at least one physical feature; and /or, a corresponding relationship is further set between the physical feature of the packet and at least one service feature of the packet;
[0024] the at least one physical feature, which is (are) set further, and/or service feature is (are) encapsulated in the packet.
[0025] In addition, the method further includes: when receiving a packet encapsulated with at least one physical feature and/or service feature, removing the encapsulated physical feature and/or service feature, then forwarding the packet.
[0026] Furthermore, the packet can be an Ethernet packet, and the method further includes:
[0027] setting VLAN Tag(s) in the packet, wherein, the number of the VLAN Tags is equal to the number of the at least one physical feature and/or service feature which is (are) further set;
[0028] the at least one physical feature and/or service feature is (are) respectively represented by the further set VLAN Tag(s).
[0029] Wherein, the packet is an Ethernet packet; and the physical feature is the first VLAN Tag;
[0030] before the step of obtaining the physical feature of the packet, the method further includes the following steps:
[0031] determining whether a reception device which receives the current packet supports a VLAN stack function, if it supports, executing the step of obtaining the

physical feature of the packet.
[0032] Wherein, the packet reception device is a convergence switch.
[0033] Meanwhile, according to another aspect of the present invention provides an apparatus for forwarding packet, including a reception unit and a transmitter unit; wherein,
[0034] the reception unit, used for receiving a packet and obtaining a physical feature of the packet, and obtaining a service feature of the packet according to corresponding relationship between the physical feature and the service feature of the packet, and encapsulating the service feature of the packet into the packet;
[0035] the transmitter unit, used for transmitting a packet that has been encapsulated with a service feature.
[0036] Wherein, the reception unit further includes a unit which is used for encapsulating one or more physical features and/or service features into the packet;
[0037] the transmitter unit further includes a unit which is used for transmitting packet containing one or more physical features and/or service features.
[0038] Wherein, the reception unit further includes a unit which is used for receiving packet containing one or more physical features and/or service features, and removing the physical features and/or service features contained in the packets;
[0039] the transmitter unit further includes a unit which is used for transmitting packet whose physical features and/or service features have been removed by the reception unit;
[0040] or
[0041] the transmitter unit further includes a unit which is used for receiving packet containing one or more physical features and/or service features, and removing the physical features and/or service features contained in the packets;

[0042] the reception unit further includes a unit which is used for transmitting packet whose physical features and/or service features have been removed by the transmitter unit.
[0043] By setting a corresponding relationship between the physical feature and the service feature of a packet, the method and the apparatus according to embodiments of the present invention obtains the service feature of a packet -according to the physical feature of the packet after receiving the packet, and further encapsulates the service feature into the packet, then forwards the packet carrying the service feature. The method and the apparatus make it possible for a network device to process a packet directly according to the service feature of the packet, which may improve the processing efficiency of the packet. In addition, the method and the apparatus implements differential services for users, which may decrease the cost for processing the packet during operation, and improve the service management and service control abilities during operation.
Brief Description of the Drawings
[0044] Figure 1 is a schematic diagram illustrating a structure of an IEEE802.1Q-based virtual Ethernet frame;
[0045] Figure 2 is a schematic diagram illustrating a structure of a QinQ data frame;
[0046] Figure 3 is a basic flowchart in accordance with an embodiment of the present invention;
[0047] Figure 4 is a flowchart according to an embodiment of the present invention;
[0048] Figure 5 is a schematic diagram illustrating a frame structure with three layers of tags according to an embodiment of the present invention;
[0049] Figure 6 is a schematic diagram illustrating a frame structure with multiple layers of tags according to an embodiment of the present invention;
[0050] Figure 7 is a schematic diagram illustrating a structure of a forwarding apparatus

according to an embodiment of the present invention.
Detailed Description of the Invention
[0051] In order to make the technical solution and the advantages of the present invention clearer, the present invention will be described in detail hereinafter with reference to the accompanying drawings and embodiments.
[0052] In embodiments of the present invention, a corresponding relationship between the physical feature and the service feature of a packet is set. After receiving a packet, obtain the service feature according to the physical feature of the packet, and encapsulate the service feature into the packet.
[0053] Wherein, the physical feature of a packet includes: out-port number, MAC address, network address, IP multicast, or VLAN Tag. The service feature of a packet includes: service-related features, such as service type, or service priority, etc.
[0054] After the service feature corresponding to the packet is encapsulated into the packet, network devices can process the packet according to the service feature encapsulated in the packet.
[0055] A basic flowchart according to an embodiment of the present invention is shown in Figure 3, including the following steps:
[0056] Step 301: receive a packet, and obtain the physical feature of the packet;
[0057] Step 302: find the corresponding relationship between the physical feature and the service feature according to the obtained physical feature, and obtain service feature of the packet;
[0058] Step 303: encapsulate the service feature of the packet into the packet, and forward the packet.
[0059] In the following embodiment, the first VLAN Tag of an Ethernet packet is taken

as the physical feature of the Ethernet packet, and the second VLAN Tag is taken as the service feature of the Ethernet packet. Corresponding relationship between the first VLAN Tag and the second VLAN Tag of the Ethernet packet is set. The Ethernet packet will be shortened as packet hereinafter.
[0060] Wherein, the first VLAN Tag is the VLAN Tag defined by the 802.1Q. And the second VLAN Tag is: the second layer VLAN Tag encapsulated following the QinQ technique, and the second VLAN Tag can be encapsulated either in the inner layer or in the outer layer.
[0061] The corresponding relationship between the service feature, which is represented by the second VLAN Tag, and the first VLAN Tag is determined according to the requirements of practical operation circumstances and practical applications. Wherein, the corresponding relationship can be: the corresponding relationship between the service priority of the packet and the first VLAN Tag; or, the corresponding relationship between the service type of the packet and the first VLAN Tag, etc.
[0062] In this embodiment, the corresponding relationship between the second VLAN Tag and the first VLAN Tag is: the corresponding relationship between the service type of the packet and the VLAN identifier of the first VLAN Tag.
[0063] For example, under practical circumstances, if the value of the VLAN identifier carried in the VLAN Tag is between 1~2K, it corresponds to Internet browse services. And the value between 2~3K corresponds to SOHO services or commercial services, the value between 3~4K corresponds to Voice over IP (VoIP) services or video services. Therefore, the corresponding relationship between the first VLAN Tag and the second VLAN Tag is: if the value of the VLAN identifier of the first VLAN Tag is between I-2K. the second VLAN Tag it corresponds is 1. And if the value is between 2-3K, the second VLAN Tag it corresponds is 10, if the value is between 3~4K, the second VLAN Tag it corresponds is 1000, etc. At this time, the value 1 of the second VLAN Tag represents Internet browse services; the value 10 of the second VLAN Tag represents SOI 10 services or commercial services; and the value 1000 of the second VLAN Tag represents VoIP services or video services.

[0064] The present embodiment illustrates the procedure of a convergence switch receiving a packet which is sent by a user access device and forwarding the packet to a network device in the backbone network. The procedure is shown in Figure 4, which includes the following steps:
[0065] Step 401: a convergence switch receives a packet sent by a user access device.
[0066] Step 402: the convergence switch processes the received packet according to packet receiving strategies.
[0067] Wherein, the packet receiving strategies includes diversified security inspections and bandwidth control strategies.
[0068] Step 403: the convergence switch determines whether it supports the QinQ function, if it supports, goes to Step 404; otherwise, goes to Step 409.
[0069] Step 404: the convergence switch obtains the first VLAN Tag contained in the received packet.
[0070] Step 405: search the corresponding relationship between the first VLAN Tag and the second VLAN Tag, and obtain the second VLAN Tag according to the first VLAN Tag.
[0071] For example, when the value of the VLAN identifier of the first VLAN Tag is between 1~2K, the corresponding second VLAN Tag is 1, which representing Internet browse services. When the value of the VLAN identifier of the first VLAN Tag is between 2~3K, the corresponding second VLAN Tag is 10, which representing SOI 10 services or commercial services, when the value of the VLAN identifier of the first VLAN Tag is between 3-4K, the corresponding second VLAN Tag is 1000. which represents VoIP services or video services.
[0072] Wherein, the corresponding relationship between the first VLAN Tag and the second VLAN Tag can be configured through command-line, network manager or other configuration methods, or can be a fixed strategy implemented by hardware or software

[0073] Step 406: encapsulate the obtained second VLAN Tag into the received packet.
[0074] Step 407: forward the packet carrying the second VLAN Tag to the network device in the backbone network. During this procedure, the packet can also be processed according to packet strategies. And the current procedure is ended.
[0075] Wherein, the packet transmission strategies include diversified security inspections and bandwidth control strategies.
[0076] Step 408: end the current procedure.
[0077] The convergence switch can process each packet it receives according to the steps shown in Figure 4.
[0078] Since a second VLAN Tag is carried in the packet forwarded to the network device in the backbone network by the convergence switch, and the second VLAN Fag in the packet can identify the service type of the packet, the network device in the backbone network can process the packet according to the service feature of the packet. For example, if the service feature is the service priority, then the network device in the backbone network can first process the packets with higher priorities, which satisfies different requirement of users with different priorities.
[0079] In the present invention, except for encapsulating a service feature into the packet according to the physical feature of the packet, it is also possible to set corresponding relationships between the physical feature and at least one physical Feature and/or at least one service feature according to the requirement oi~ the practical circumstances. After the packet is received, at least one physical feature and/or at least one service feature are (is) encapsulated into the packet according to the corresponding relationships. Therefore, the packet can carry more information.
[0080] After the packet encapsulated with at least one physical feature and/or at least one service feature is received, the encapsulated at least one physical feature and/or at least one service feature are (is) removed, and the packet is forwarded.

[0081] Correspondingly, in the above embodiment, the QinQ technique can only support two VLAN Tags. Therefore, in order to carry more physical and/or service features, more VLAN Tags can be set into the packet, the number of the VLAN tags is equal to the number of the physical and/or service features to be encapsulated into the packet. According to the number of the physical and/or service features encapsulated in the packet, the number of the VLAN Tag can be three, four, or more. The format of the added VLAN Tag is the same as that of the original VLAN Tag in' the packet. Figure 5 is a diagram illustrating a frame structure of a packet with three VLAN Tags. Figure 6 is a diagram illustrating a frame structure of a packet with multiple VLAN Tags. In addition, other information can also be carried in the packet by the additionally set VLAN Tags. And the number of the VLAN Tags is not limited.
[0082] When the convergence switch receives the packet with multiple VLAN Tags from the network device in the backbone network, it only needs to remove the encapsulated VLAN Tags layer by layer to finish the de-encapsulation, and then forwards the packet to the user access device.
[0083] In addition, an embodiment of the invention provides a packet forwarding apparatus corresponding to the packet forwarding method. The structure of the apparatus is shown in Figure 7, which includes a reception unit 71 and a transmitter unit 72.
[0084] The reception unit 71, used for receiving a packet and obtaining a physical feature of the packet; and obtaining a service feature of the packet according to the obtained physical feature; and encapsulating the service feature of the packet into the packet;
[0085] the transmitter unit 72, used for transmitting a packet that has been encapsulated with a service feature.
[0086] Wherein, the reception unit 71 further includes a unit used for encapsulating at least one physical feature and/or at least one service feature into the packet. Accordingly. the transmitter unit 72 further includes a unit used for transmitting a packet containing at least one physical feature and/or at least one service feature.

[0087] When the apparatus needs to de-encapsulate a packet which has been encapsulated with at least one physical feature and/or at least one service feature, the reception unit 71 further includes a unit used for receiving a packet containing at least one physical feature and/or at least one service feature, and removing the at least one physical feature and/or at least one service feature contained in the; packet. Accordingly, the transmitter unit 72 further includes a unit used for transmitting a packet whose physical feature and/or service feature have (has) been removed by the reception unit 71;
[0088] or, the transmitter unit 72 further includes a unit used for receiving a packet containing at least one physical feature and/or at least one service feature, and removing the at least one physical feature and/or at least one service feature contained in the packet. The reception unit 71 further includes a unit used for transmitting a packet whose physical feature and/or service feature have (has) been removed by the transmitter unit.
[0089] The forgoing embodiments are only the preferred embodiments of the present invention, which are not used to confine the protection scope of the present invention. Any changes and modifications maybe made by those skilled in the art without departing from the spirit and principle of this invention and therefore should be protected by the protection scope of this invention as set by the appended claim and its equivalents.

We Claim:-
1. A method for forwarding packet, comprising:
configuring a corresponding relationship between a physical feature and a service feature of a packet;
receiving a packet, and obtaining the physical feature of the packet;
finding the corresponding relationship between the physical feature and the service feature according to the obtained physical feature, and obtaining the service feature of the packet;
encapsulating the service feature of the packet into the packet, and forwarding the packet encapsulated with the service feature.
2. The method according to Claim 1, wherein the service feature is represented by a second Virtual Local Area Network Tag (VLAN Tag).
3. The method according to Claim 1 or 2, wherein the service feature comprises one of: service type of the packet and service priority of the packet.
4. The method according to Claim 1, wherein the physical feature comprises in-port number, Media Access Control (MAC) address, network address, IP multicast or a first VLAN Tag.
5. The method according to Claim 1, wherein the physical feature is a first VLAN Tag;
the corresponding relationship between the physical feature and the service feature comprises: a corresponding relationship between the service priority of the packet and the first VLAN Tag; or a corresponding relationship between the service type of the packet

and the first VLAN Tag.
6. The method according to Claim 1, wherein a corresponding relationship is further
set between the physical feature of the packet and at least one physical feature; and/or. a
corresponding relationship is further set between the physical feature of the packet and at
least one service feature of the packet;
the at least one physical feature and/or at least one service feature are (is) encapsulated in the packet.
7. The method according to Claim 6, further comprising:
when receiving a packet encapsulated with at least one physical feature and/or at least one service feature, removing the encapsulated at least one physical feature and/or at least one service feature, and forwarding the packet.
8. The method according to Claim 6, wherein the packet is an Ethernet packet, and the
method further comprising:
setting VLAN Tag(s) in the packet, wherein the number of the VLAN Tag(s) is (are) equal to the number of the at least one physical feature and/or at least one service feature which are (is) further set;
the at least one physical feature and/or at least one service feature are (is) respectively represented by the further set VLAN Tag(s).
9. The method according to Claim 1, 2, 6 or 7, wherein the packet is an Ethernet
packet; and the physical feature is a first VLAN Tag;
the method further comprising:
before the step of obtaining the physical feature of the packet, determining whether a reception device which receives the current packet supports a VLAN stack function, if it supports the VLAN stack function, executing the step of obtaining the physical feature of

the packet.
10. The method according to Claim 1, wherein, the packet reception device is a
convergence switch.
11. An apparatus for forwarding packet, comprising: a reception unit and a transmitter
unit; wherein,
the reception unit is used for receiving a packet and obtaining a physical feature of the packet, and obtaining a service feature of the packet according to a corresponding relationship between the physical feature and the service feature of the packet, and encapsulating the service feature of the packets into the packet;
the transmitter unit is used for transmitting a packet that has been encapsulated with a service feature.
12. The apparatus according to Claim 11, wherein, the reception unit further
comprises a unit used for encapsulating at least one physical feature and/or at least one
service feature into the packet;
the transmitter unit further comprises a unit used for transmitting a packet containing at least one physical feature and/or at least one service feature.
13. The apparatus according to Claim 11, wherein, the reception unit further
comprises a unit used for receiving a packet containing at least one physical feature
and/or at least one service feature, and removing the at least one physical feature and/or at
least one service feature contained in the packet;
the transmitter unit further comprises a unit used for transmitting a packet whose physical feature and/or service feature have (has) been removed by the reception unit;
or
the transmitter unit further comprises a unit used for receiving a packet containing at

least one physical feature and/or at least one service feature, and removing the physical feature and/or the service feature contained in the packet;
the reception unit further comprises a unit used for transmitting a packet whose physical feature and/or service feature have (has) been removed by the transmitter unit.

Abstract
A method for forwarding packet includes: configuring a corresponding relationship between a physical feature and a service feature of a packet; receiving a packet, obtaining the physical feature of the packet; finding the corresponding relationship between the physical feature and the service feature according to the obtained physical feature, and obtaining service feature of the packet; encapsulating the service feature of the packet into the packet and forwarding the packet. In addition, the present invention also discloses an apparatus for forwarding packet. The method and the apparatus of the present invention make it possible for a network device to process a packet directly according to the service feature of the packet, which improves the processing efficiency of the packet. and implement differential services for users, decreases the cost for processing the packet during operation, and improves the service management and service control abilities during operation.