The present disclosure relates to the field of network communications technologies, and, in particular embodiments, to a method and an apparatus for converting a virtual local area network identity.
In a conventional layer 2 network, the virtual local area network identity (VID) of each virtual local area network (VLAN) is unique. After the VID of a VLAN is determined, other VLANs in the network cannot use the same VID, and any node in the VLAN can only be identified by the VID. Because the length of the VID is 12 bits, at most, about 4,000 VLANs can be identified in the network. Even if each user uses only one VLAN, the number of users is limited to the range of approximately 4,000.
The transparent interconnection of lots of links protocol (TRILL) is a working group of the Internet Engineering Task Force (IETF), and is also a protocol. It mainly integrates advantages of a bridge and a router, applies a link state routing (LSR) technology at a link layer, and does not interfere with the work of an upper-layer router. The TRILL protocol is developed to replace the spanning tree protocol (STP). It has three main advantages, namely, replacing the degenerative STP technology, improving support for unicast and multicast in multi-pathing, and reducing delay of data transmission.
As applications of layer 2 routing protocols such as TRILL and deployment of virtual servers gradually mature, it is expected that a layer 2 network can support a larger number of virtual servers in the future. In such a scenario, if the VLAN technology is used to perform natural layer 2 isolation between services or customers, the number of required VLANs will be far greater than 4,000. However, as described above, usually VIDs can identify at most 4,000 VLANs. Therefore, the practice of identifying a VLAN by a VID in the conventional network is infeasible in this scenario. To solve the problem, a method for localizing VLAN IDs may be used. To be specific, for a designated service or customer, different VIDs may be used in different switch racks, thereby improving a reuse rate of the VIDs, so that each rack has 4,000 available VIDs.
After the VIDs are localized, because a same service may use different VLANs in different switch racks, and nodes belonging to different VLANs cannot directly communicate, different nodes belonging to a same service cannot directly communicate with each other. To overcome the above problem, some designated switches in each switch rack supporting a same service need to convert different VIDs before forwarding data packets, and store mappings between VIDs of each service in different racks. In the TRILL protocol, a switch supporting the TRILL protocol is a routing bridge (RB), but VIDs are usually manually configured on the RB, which leads to a huge workload. In addition, a virtual server may be migrated to other switch racks in real time. If a switch rack to which the virtual server is migrated does not have a server supporting the same services as the virtual server, new VIDs need to be configured in the switch rack for the services supported by the virtual server. In addition, the mappings between the VIDs corresponding to the services supported by the virtual server and the VIDs allocated by other switches for the services need to be configured on other RBs. The lag of manual configuration inevitably causes delay of the services.
The present disclosure provides a method and an apparatus for converting a virtual local area network identity, which can avoid the problems of a huge workload and serious configuration lag. These problems generally occur because mappings between virtual local area network identities, and virtual local area network identities of routing bridges in other switch racks, are manually configured on a routing bridge.
A first aspect of the present disclosure provides a method for converting a virtual local area network identity. A service information table of each routing bridge RB is obtained and stored. Each service information table includes mappings among services supported by a RB, an identity of the RB, and local VIDs of the service supported by the RB. A data packet in TRILL encapsulation, sent by a source terminal, is received and forwarded by a neighboring RB. A stored service information table is queried according to an identity of an ingress RB and a VID in the data packet. A local VID of a service that the data packet belongs to is obtained according to a service information table of an egress RB. The VID in the data packet is converted into the local VID. The data packet with the converted VID is sent to a destination terminal.
A second aspect of the present disclosure provides an apparatus for converting a virtual local area network identity including an obtaining unit, a storing unit, a receiver, a querying unit, a converting unit and a transmitter. The obtaining unit is configured to obtain a service information table of each RB. Each service information table includes mappings among services supported by a RB, an identity of the RB, and local VIDs of the service supported by the RB. The storing unit is configured to store the service information table of each RB obtained by the obtaining unit. The receiver is configured to receive a data packet in TRILL encapsulation, sent by a source terminal and forwarded by a neighboring RB. The querying unit is configured to query a service information table stored by the storing unit according to an identity of an ingress RB and a VID in the data packet. The querying unit is further configured to obtain a local VID of a service that the data packet belongs to according to a service information table of an egress RB. The converting unit is configured to convert the VID carried in the data packet into the local VID according to a query result of the querying unit. The transmitter is configured to send the data packet with the converted VID to a destination terminal.
As seen from the above technical solutions, in the embodiments of the present disclosure, the service information table of each routing bridge can be dynamically obtained and stored. After an RB receives a data packet whose egress RB is the RB itself, the RB queries the stored service information table according to the ingress RB in the data packet and the VID information of the inner-layer packet to obtain information of a local VID to be converted into. When a virtual machine is migrated, service information tables in the whole network can be updated in real time. This process avoids the shortage of VIDs caused by use of a globally unique VID by each service, and a huge configuration workload and configuration lag caused by manual configuration of local VIDs.
For a more complete understanding of the present invention, and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawing, in which:
Embodiments of the present disclosure provide a method and an apparatus for converting a virtual local area network identity. Various embodiments are used to avoid the problems of a workload and serious configuration speed lag which are generated because a service information table between services of other RBs supporting a same service as an RB and local VIDs of other RBs is manually configured on the RB.
For ease of understanding, VLAN globalization in the TRILL protocol is described with reference to
The following describes VID localization. The VID localization means that for a designated service or customer, different VIDs may be used in different switch racks to identify the service or customer. Referring to
For ease of understanding, the following describes the process of forwarding and encapsulating a data packet in the TRILL protocol. Taking a unicast data packet as an example and referring to
For a multicast or broadcast packet, the egress RB nickname indicates a distribution tree and is the root of the distribution tree. The ingress RB is responsible for selecting a distribution tree to perform multicast or broadcast forwarding. The intermediate RBs, for example, the RB 303 and RB 304 in
The following describes the method for converting a virtual local area network identity according to an embodiment of the present disclosure. A method for converting a virtual local area network identity in the TRILL protocol according to an embodiment of the present disclosure is described in
Referring first to
401. Obtain and store a service information table of each routing bridge, where the service information table includes mappings among services supported by each routing bridge, an identity of each routing bridge, and local virtual local area network identities of the services supported by each routing bridge. In this step, in each RB, a service information table corresponding to the RB needs to be established according to the services (each service corresponds to a VLAN) supported by the RB, the identity of the RB, and local VIDs allocated for the services supported by the RB. Then, each RB sends its own service information table to a neighboring RB through a link state packet, and the neighboring RB continues forwarding the state packet, so that the service information table is spread in the network. Finally, all RBs can obtain the service information table of each RB in the whole network, that is, each RB stores the local VIDs of other RBs with respect to a same service.
The service in the above service information table may be indicated by a uniformly agreed service number, for example, service1 for a voice service, service2 for a data service, and service3 for a video service. The identity of the RB may be a system identity or a nickname of the RB.
For ease of understanding,
A service information table is configured on each RB. For example, assuming that the nickname of the RB 501 is ToR1, the nickname of the RB 502 is ToR2, and the nickname of the RB 503 is ToR3, for the service1, the service information table on the RB 501 is (service1: ToR1, VID35), the service information table on the RB 502 is (service1: ToR2, VID1028), and the service information table on the RB 503 is (service1: ToR3, VID314). Each RB supporting the service1 sends its service information table to a neighboring RB, and then the neighboring RB continues forwarding, and spreads the service information table in the network. Finally, all the RBs supporting the service1 store the service information table of each RB, where the service information table includes the information of each RB supporting the service1 and information of the local VID of the RB. It is understandable that the service number may also be a user group number.
It should be noted that the service information table may be stored in a link state database (LSDB). The service information table configured on each RB may be implemented by extending the TLV (Type, Length, Value) in an LSP packet of the Intermediate System to Intermediate System Routing Protocol (IS-IS). For example, a new TLV field may be defined, where the TLV field may be named as user-group-to-vlan mapping TLV, or a sub-TLV of an existing TLV may be defined and may be named as user-group-to-vlan mapping sub-TLV, where the format of the new TLV or the sub-TLV may be shown as follows:
System ID may be a system identity of the RB sending the information, or may also be feature information with uniqueness, such as a nickname. In this example User Group ID is an identity of a designated user group or service, and is also globally unique. Local VID is a value of the local VLAN identity used by a designated user group ID under the RB with the given System ID, and is locally unique.
The format of each User Group to VID mapping is shown as follows:
402. Receive a data packet in Transparent Interconnection of Lots of Links protocol encapsulation, sent by a source terminal and forwarded by a neighboring routing bridge.
Referring to
The data packet sent by the source terminal 508 arrives at the egress RB 503 through forwarding layer by layer.
403. Query the stored service information table, and convert the virtual local area network identity in the received data packet into a local virtual local area network identity.
The RB 503 of
404. Send the data packet with the converted virtual local area network identity to the destination terminal.
The egress RB in
Based on the method shown in
For example, in
An embodiment of the present disclosure also provides a method for converting a virtual local area network identity, applicable to a routing bridge. As shown in
601. Obtain and store a service information table, where the service information table includes mappings among services supported by the routing bridge, an identity of the routing bridge, and local virtual local area network identities of the services supported by the routing bridge.
When the RB is a top of rack switch of a switch rack, the services supported by the RB include services that the switches under the switch rack can provide, and the local VID corresponding to a service is the VID used by the service under the switch rack.
602. Receive a migration notification sent by a physical server, where the migration notification carries the identity of a virtual terminal to be migrated.
When the terminal in the virtual local area network is a virtual terminal, the virtual terminal may be migrated between different switch racks. When the virtual terminal is ready to be migrated, an adaptation layer of the physical server at the migration destination sends a migration notification to a neighboring RB under the rack to which the virtual terminal is to be migrated, where the migration notification may be a virtual station interface discovery and configuration protocol (VDP) message, which carries the identity of the virtual terminal to be migrated.
603. Determine, according to the identity of the virtual terminal carried in the migration notification, local virtual local area network identities corresponding to the services supported by the virtual terminal, and update the service information table.
After receiving the migration notification sent by the physical server at the migration destination of the virtual terminal, the RB determines, according to the identity of the virtual terminal carried in the migration notification, local virtual local area network identities corresponding to the services supported by the virtual terminal.
Specifically, the RB queries, according to the identity of the virtual terminal in the migration notification sent by the physical server, for information (for example, the service number) of all the services supported by the virtual terminal, and judges one by one, according to the found information of the services and stored service information table, whether local VIDs are allocated for the services supported by the virtual terminal, that is, judges whether a terminal supporting a same service as the virtual terminal exists under the rack. If a local VID is already allocated for a service, which indicates that a terminal supporting a same service as the virtual terminal exists under the rack, it is unnecessary to allocate a local VID for the service. If no local VID is allocated for the service supported by the virtual terminal, which indicates that the service is a new service under the rack, it is necessary to select an unused VID from the database as the local VID corresponding to the new service, and update the stored service information table. The updated service information table includes the services supported by the RB, the identity of the RB, and local VIDs corresponding to all the services supported by the RB after the update.
In this embodiment, a use state of a VID in the system database is managed through a management program. Whether a VID is used is known by query, and based on this information an unused VID may be selected as the local VID corresponding to a new service of the migrated virtual terminal.
604. Send the updated service information table to a neighboring routing bridge, so that the updated service information table is spread in the VLAN.
The following uses
As seen from the above description, the embodiment shown by
The process of sending the data packet and converting the VID after the virtual terminal is migrated, and the process of learning the source address based on TRILL, are the same as those described in the above embodiments and are not further described herein.
In the embodiments of the present disclosure, when the virtual terminal leased by the user is migrated, the RB to which the virtual terminal is to be migrated allocates a new local VID for the new service supported by the virtual terminal, updates the local service information table, and spreads the updated service information table in the whole network, implementing the real-time update of the service information table in the whole network and reducing the workload of manual configuration.
The following describes an apparatus for converting a virtual local area network identity according to an embodiment of the present disclosure, which is used to implement the above method embodiments of the present disclosure. Referring to
The obtaining unit 701 is configured to obtain a service information table sent by each RB (referring to step 401). After a forwarded data packet sent by a source terminal is received and the stored service information table is queried according to an identity of an ingress RB in the data packet and a VID in the data packet, the obtaining unit 701 is further configured to obtain a local VID of a service that the data packet belongs to, and after the data packet sent by the source terminal is forwarded, obtain a medium access control address of the source terminal sending the data packet, the local VID of the service that the data packet belongs to, and a service information table of the ingress RB.
The storing unit 702 is configured to store the service information table sent by each RB and obtained by the obtaining unit 701, and store the medium access control address of the source terminal sending the data packet, the local VID of the service that the data packet belongs to, and the service information table of the ingress RB.
The receiver 703 is configured to receive the data packet in TRILL encapsulation sent by the source terminal and forwarded by a neighboring RB (step 403), and receive a migration notification sent by a physical server to which a virtual terminal is to be migrated (step 602).
The querying unit 704 is configured to query, according to the identity of the ingress RB carried in the data packet and the VID information included in the inner-layer data packet, the service information table stored by the storing unit 702 (step 403). The querying unit 704 is further configured to query, according to the identity of the migrated virtual terminal, for information of all services supported by the migrated virtual terminal (step 603).
The converting unit 705 is configured to convert the VID carried in the data packet into a local VID according to a query result of the querying unit 704 after querying the service information table (step 403). The transmitter 706 is configured to send the data packet with the VID converted by the converting unit 705 to a destination terminal (step 404). The transmitter is further configured to send the service information table of the egress RB to the neighboring RB through a link state packet (step 401), and send the updated service information table to the neighboring RB through a link state packet after the virtual terminal is migrated (step 604).
It should be noted that the apparatus may further include a determining unit 707 configured to after receiving the migration notification sent by the physical server at the migration destination of the virtual terminal, determine, according to the information of the identity of the virtual terminal to be migrated which is carried in the migration notification, local VIDs corresponding to services after the virtual terminal is migrated (step 603). The apparatus also may include a judging unit 708 configured to judge one by one, according to the information of the services found by the querying unit 704 and the stored service information table, whether local VIDs are allocated for the services supported by the virtual terminal (step 603). In some embodiments, a selecting unit 709 is configured to select unused VIDs from the database as the local VIDs corresponding to the new services when the judging unit 708 determines that the services supported by the virtual terminal are new services (step 603). The apparatus may further include an updating unit 710 configured to update the service information table according to the local VIDs corresponding to the services supported by the migrated virtual terminal (step 603).
The apparatus in the embodiment of the present disclosure may include different combinations of the above units according to different implemented functions, and not all the above units should be used as the necessary technical features of this apparatus embodiment.
The apparatus in the embodiment of the present disclosure can dynamically obtain and store the service information table of each routing bridge. After the apparatus receives a data packet in which the egress RB is the apparatus itself, the apparatus queries the stored service information table according to the ingress RB in the data packet and the VID information of the inner-layer packet to obtain information of the local VID to be converted into, and when a virtual machine is migrated, updates the service information table in the whole network in real time. This avoids the shortage of VIDs caused by use of a globally unique VID by each service, and a huge configuration workload and configuration lag caused by manual configuration of local VIDs.
It should be noted that the technical solutions provided by the embodiments of the present disclosure are also applicable to multicasting or broadcasting a data packet in the network. The steps are almost the same, and are not further described herein.
Persons of ordinary skill in the art may understand that all or part of the steps of the method in the embodiments of the present disclosure may be implemented by a program instructing relevant hardware. The program may be stored in a computer readable storage medium, and the above mentioned storage medium may be a Read-Only Memory (ROM), a magnetic disk or an optical disk.
Detailed above are a method and an apparatus for converting a virtual local area network identity according to the present disclosure. With respect to the implementation manner and applicability scope, persons of ordinary skill in the art can make variations without departing from the idea of the embodiments of the present disclosure. To conclude, the content of the specification shall not be construed as a limitation on the present disclosure.
This application is a continuation of International Application No. PCT/CN2011/073381, filed on Apr. 27, 2011, which is hereby incorporated by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2011/073381 | Apr 2011 | US |
Child | 14013855 | US |