RU2530250C1 - Method and device for distribution of virtual local network - Google Patents

Method and device for distribution of virtual local network Download PDF

Info

Publication number
RU2530250C1
RU2530250C1 RU2013106261/08A RU2013106261A RU2530250C1 RU 2530250 C1 RU2530250 C1 RU 2530250C1 RU 2013106261/08 A RU2013106261/08 A RU 2013106261/08A RU 2013106261 A RU2013106261 A RU 2013106261A RU 2530250 C1 RU2530250 C1 RU 2530250C1
Authority
RU
Russia
Prior art keywords
packet
mac address
terminal device
vlan tag
vlan
Prior art date
Application number
RU2013106261/08A
Other languages
Russian (ru)
Other versions
RU2013106261A (en
Inventor
Даолун ЧЖОУ
Жунвэй ГУ
Original Assignee
Хуавэй Текнолоджиз Ко., Лтд.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Хуавэй Текнолоджиз Ко., Лтд. filed Critical Хуавэй Текнолоджиз Ко., Лтд.
Publication of RU2013106261A publication Critical patent/RU2013106261A/en
Application granted granted Critical
Publication of RU2530250C1 publication Critical patent/RU2530250C1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5038Address allocation for local use, e.g. in LAN or USB networks, or in a controller area network [CAN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/604Address structures or formats
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Landscapes

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

Abstract

FIELD: information technology.
SUBSTANCE: method involves stages at which a MAC-address of a terminal device is received; a prefix field is extracted from the MAC-address according to the pre-set extraction rule; with that, the prefix field is a binary field of the first N bits in the MAC-address; with that, N is bigger than or equal to 1 and less than 48; and the corresponding VLAN tag is distributed to the terminal device according to the prefix field.
EFFECT: reducing load on a commutator and increasing the distribution request processing speed.
12 cl, 4 dwg

Description

ОБЛАСТЬ ТЕХНИКИ, К КОТОРОЙ ОТНОСИТСЯ ИЗОБРЕТЕНИЕFIELD OF THE INVENTION

Настоящее изобретение относится к области связи, и в частности к способу и устройству для распределения виртуальной локальной сети.The present invention relates to the field of communication, and in particular to a method and apparatus for distributing a virtual local area network.

УРОВЕНЬ ТЕХНИКИBACKGROUND

Виртуальная локальная сеть (VLAN) является технологией коммутации данных для логического разделения устройств локальной сети на сетевые сегменты или особо мелкие локальные сети, для реализации виртуальных рабочих групп, которая в основном применяется в коммутаторе или маршрутизаторе.Virtual local area network (VLAN) is a data switching technology for logically dividing local area network devices into network segments or particularly small local networks, for implementing virtual workgroups, which is mainly used in a switch or router.

Появление технологии VLAN позволяет администратору логически разделять разных пользователей в одной и той же локальной сети на разные широковещательные домены, как это требуется на практике. Каждая VLAN включает в себя группу компьютерных рабочих станций с одинаковыми требованиями, которые имеют одинаковые атрибуты как физическая локальная сеть. Благодаря логическому разделению, в отличие от физического разделения, рабочие станции в одной и той же VLAN не ограничены тем, что должны находиться в одной и той же физической области. А именно, эти рабочие станции могут размещаться в разных сегментах физической сети. Как видно из особенностей VLAN, широковещательный и одноадресный трафик в VLAN не будет пересылаться другой VLAN, тем самым способствуя управлению трафиком, сокращению вложений в устройства, упрощению управления сетью и улучшению сетевой безопасности. VLAN способна разделять сеть на множественные широковещательные домены для эффективного управления возникновением всплеска широковещательной передачи и создания более гибкой структуры топологии сети. В дополнение VLAN также может использоваться для управления взаимным доступом между разными частями и разными местоположениями сети.The advent of VLAN technology allows the administrator to logically separate different users on the same local network into different broadcast domains, as is required in practice. Each VLAN includes a group of computer workstations with the same requirements, which have the same attributes as a physical local area network. Due to logical separation, unlike physical separation, workstations in the same VLAN are not limited to what should be in the same physical area. Namely, these workstations can be located in different segments of the physical network. As you can see from the features of VLANs, broadcast and unicast traffic in a VLAN will not be forwarded to another VLAN, thereby contributing to traffic management, reducing investment in devices, simplifying network management and improving network security. A VLAN is capable of dividing a network into multiple broadcast domains to efficiently control the occurrence of a broadcast spike and create a more flexible network topology structure. In addition, VLANs can also be used to control mutual access between different parts and different network locations.

Наиболее общий способ для разделения VLAN основан на портах. В соответствии с данным способом, пакетам, принятым от одного и того же порта, у которых отсутствуют тэги VLAN, добавляется одинаковый тэг VLAN и пересылается внутри одной и той же VLAN. Данный способ прост применительно к конфигурации и применяется к сетевой среде, в которой физическое размещение терминальных устройств фиксированное. С распространением мобильных офисов и радиодоступа терминальное устройство не получает доступ к устройству, используя фиксированный порт. Наоборот, терминальное устройство получает доступ к сети, используя порт A, а в следующий раз получает доступ к сети, используя порт B. Если порт A и порт B имеют разные конфигурации VLAN, то терминальное устройство после получения доступа к сети во второй раз, в результате разделения относится к другой VLAN, что приводит к тому, что услуги или ресурсы в исходной VLAN становятся недоступными. Если порт A и порт B имеют одинаковую конфигурацию VLAN, то возникает проблема обеспечения безопасности доступа, когда порт B распределяется другому терминальному устройству.The most common way to split VLANs is based on ports. According to this method, packets received from the same port that do not have VLAN tags add the same VLAN tag and forward them within the same VLAN. This method is simple with respect to configuration and is applied to a network environment in which the physical location of terminal devices is fixed. With the proliferation of mobile offices and radio access, the terminal device does not gain access to the device using a fixed port. On the contrary, the terminal device gains access to the network using port A, and the next time it gains access to the network using port B. If port A and port B have different VLAN configurations, then the terminal device after gaining access to the network a second time, The split results in a different VLAN, which results in services or resources in the original VLAN becoming inaccessible. If port A and port B have the same VLAN configuration, then there is a problem of access security when port B is allocated to another terminal device.

В известном уровне техники, для решения проблемы перемещения терминального устройства используется способ разделения VLAN в соответствии с адресом управления доступом к среде передачи (MAC), и, таким образом, когда меняется физическое местоположение терминального устройство, исходный тэг VLAN все же может использоваться. Тем не менее, данный способ имеет недостаток, который состоит в том, что во время инициализации должны быть сконфигурированы все пользователи. В данном случае, если используются сотни или даже десятки сотен терминальных устройств, объем работ огромен, если для каждого MAC-адреса требуется уникальный тэг VLAN. В дополнение, множество членов группы VLAN проводится по портам каждого коммутатора, и сохраняются MAC-адреса множества пользователей; и вследствие этого выполнение запроса неудобно. В результате, падает эффективность работы коммутатора.In the prior art, to solve the problem of moving a terminal device, a VLAN separation method is used in accordance with a media access control (MAC) address, and thus, when the physical location of the terminal device changes, the original VLAN tag can still be used. However, this method has the disadvantage that all users must be configured during initialization. In this case, if hundreds or even tens of hundreds of terminal devices are used, the amount of work is huge if a unique VLAN tag is required for each MAC address. In addition, multiple VLAN group members are routed through the ports of each switch, and the MAC addresses of multiple users are stored; and as a result, the execution of the request is inconvenient. As a result, the efficiency of the switch decreases.

СУЩНОСТЬ ИЗОБРЕТЕНИЯSUMMARY OF THE INVENTION

Варианты осуществления настоящего изобретения предоставляют способ и устройство для распределения VLAN для быстрого и гибкого распределения VLAN большому количеству терминальных устройств.Embodiments of the present invention provide a method and apparatus for distributing VLANs for quickly and flexibly distributing VLANs to a large number of terminal devices.

Предоставленный в варианте осуществления настоящего изобретения способ для распределения виртуальной локальной сети (VLAN) включает в себя этапы, на которых: получают адрес управления доступом к среде MAC терминального устройства; извлекают поле префикса из MAC-адреса в соответствии с заранее установленным правилом извлечения, при этом поле префикса является бинарным полем из первых N бит в MAC-адресе, причем N больше либо равно 1 и меньше 48; и распределяют соответствующий тэг VLAN терминальному устройству в соответствии с полем префикса.The method for distributing a virtual local area network (VLAN) provided in an embodiment of the present invention includes the steps of: obtaining an MAC media access control address of a terminal device; extracting the prefix field from the MAC address in accordance with a predetermined extraction rule, wherein the prefix field is a binary field from the first N bits in the MAC address, wherein N is greater than or equal to 1 and less than 48; and distributing the corresponding VLAN tag to the terminal device in accordance with the prefix field.

Предоставленное в варианте осуществления настоящего изобретение устройство для распределения виртуальной локальной сети (VLAN) включает в себя: модуль получения, выполненный с возможностью получения адреса управления доступом к среде MAC терминального устройства; модуль извлечения, выполненный с возможностью извлечения поля префикса из MAC-адреса в соответствии с заранее установленным правилом извлечения, при этом поле префикса является бинарным полем из первых N бит в MAC-адресе, причем N больше либо равно 1 и меньше 48; и модуль распределения, выполненный с возможностью распределения соответствующего тэга VLAN терминальному устройству в соответствии с полем префикса.An apparatus for distributing a virtual local area network (VLAN) provided in an embodiment of the present invention includes: a receiving unit, configured to obtain an MAC media access control address of a terminal device; an extraction module configured to extract the prefix field from the MAC address in accordance with a predetermined extraction rule, wherein the prefix field is a binary field of the first N bits in the MAC address, wherein N is greater than or equal to 1 and less than 48; and a distribution module, configured to distribute the corresponding VLAN tag to the terminal device in accordance with the prefix field.

Из приведенных выше технических решений может быть видно, что варианты осуществления настоящего изобретения обладают следующими преимуществами. В соответствии с настоящим изобретением из MAC-адреса извлекается поле префикса, и соответствующий тэг VLAN распределяется терминальному устройству в соответствии с полем префикса; если требуется выделить тэги VLAN множеству терминальных устройств с одинаковым полем префикса, то в соответствии с настоящим изобретением VLAN могут распределяться единообразно множеству терминальных устройств таким образом, что терминальные устройства с одинаковым полем префикса имеют одинаковый тэг VLAN, тем самым сокращая нагрузку на коммутатор и увеличивая скорость обработки запроса распределения.From the above technical solutions, it can be seen that the embodiments of the present invention have the following advantages. In accordance with the present invention, a prefix field is extracted from the MAC address, and the corresponding VLAN tag is allocated to the terminal device in accordance with the prefix field; if you want to allocate VLAN tags to multiple terminal devices with the same prefix field, then in accordance with the present invention, VLANs can be distributed uniformly to multiple terminal devices so that terminal devices with the same prefix field have the same VLAN tag, thereby reducing the load on the switch and increasing speed processing distribution request.

КРАТКОЕ ОПИСАНИЕ ЧЕРТЕЖЕЙBRIEF DESCRIPTION OF THE DRAWINGS

Фиг.1 является схематической блок-схемой способа для распределения VLAN в соответствии с вариантом осуществления настоящего изобретения;Figure 1 is a schematic flowchart of a method for allocating VLANs in accordance with an embodiment of the present invention;

Фиг.2 является другой схематической блок-схемой способа для распределения VLAN в соответствии с вариантом осуществления настоящего изобретения;2 is another schematic flowchart of a method for allocating VLANs in accordance with an embodiment of the present invention;

Фиг.3 является другой схематической блок-схемой способа для распределения VLAN в соответствии с вариантом осуществления настоящего изобретения; иFigure 3 is another schematic flowchart of a method for allocating VLANs in accordance with an embodiment of the present invention; and

Фиг.4 является принципиальной логической структурной схемой устройства для распределения VLAN в соответствии с вариантом осуществления настоящего изобретения.4 is a schematic structural diagram of a device for distributing VLANs in accordance with an embodiment of the present invention.

ПОДРОБНОЕ ОПИСАНИЕ ВАРИАНТОВ ОСУЩЕСТВЛЕНИЯDETAILED DESCRIPTION OF EMBODIMENTS

Варианты осуществления настоящего изобретения предоставляют способ и устройство для распределения VLAN, применительно к быстрому и гибкому распределению VLAN большому количеству терминальных устройств.Embodiments of the present invention provide a method and apparatus for distributing VLANs with respect to the fast and flexible distribution of VLANs to a large number of terminal devices.

Обращаясь к Фиг.1, способ для распределения VLAN в соответствии с вариантом осуществления включает в себя этапы, на которых:Turning to FIG. 1, a method for allocating VLANs in accordance with an embodiment includes the steps of:

101. Получают MAC-адрес терминального устройства.101. Get the MAC address of the terminal device.

Устройство для распределения VLAN получает MAC-адрес терминального устройства. Устройство для распределения VLAN является устройством доступа, которое обладает функциональными возможностями Уровня 2, например коммутатором, мультиплексором доступа цифровой абонентской линии (DSLAM) или маршрутизатором с функциональными возможностями Уровня 2.The device for distributing the VLAN receives the MAC address of the terminal device. A VLAN distribution device is an access device that has Layer 2 functionality, such as a switch, digital subscriber line access multiplexer (DSLAM), or Layer 2 functionality router.

MAC-адрес является глобально уникальным 48-битным (бинарным) физическим адресом, который жестко прописан поставщиком в карте сетевого интерфейса. Биты с 0 по 23 MAC-адреса указывают уникальный идентификатор организации (OUI). OUI является уникальным идентификатором, который распределен Институтом Инженеров по Электротехнике и Радиоэлектронике (IEEE) различным организациям, для идентификации узла в локальной сети. Биты с 24 по 47 MAC-адреса распределены поставщиком.The MAC address is a globally unique 48-bit (binary) physical address that is hardcoded by the provider in the network interface card. Bits 0 through 23 of the MAC address indicate a unique organization identifier (OUI). OUI is a unique identifier distributed by the Institute of Electrical and Electronics Engineers (IEEE) to various organizations to identify a node in a local network. Bits 24 through 47 of the MAC address are allocated by the provider.

102. Из MAC-адреса извлекают поле префикса.102. A prefix field is extracted from the MAC address.

Устройство для распределения VLAN извлекает поле префикса из MAC-адреса, в соответствии с заранее установленным правилом извлечения, при этом поле префикса является бинарным полем из первых N бит в MAC-адресе, причем N больше либо равно 1 и меньше 48.The device for distributing the VLAN extracts the prefix field from the MAC address in accordance with a predetermined retrieval rule, the prefix field being a binary field from the first N bits in the MAC address, and N is greater than or equal to 1 and less than 48.

OUI MAC-адресов терминальных устройств, изготовленных одной и той же компанией или поставщиком, безусловно постоянны (т.е. первые 24 бита одинаковы). Если терминальное устройство, изготовленное одной и той же компанией или поставщиком, является изделием одного и того же типа (например, цифровой телевизионной абонентской приставкой), то одинаковые поля в частях префикса MAC-адресов могут быть длиннее (т.е. больше значения N).The OUIs of the MAC addresses of terminal devices manufactured by the same company or supplier are certainly constant (i.e., the first 24 bits are the same). If the terminal device manufactured by the same company or supplier is a product of the same type (for example, a digital television set-top box), then the same fields in the parts of the MAC address prefix may be longer (i.e., greater than N) .

При распределении VLAN терминальным устройствам устройство управления локальной сетью может гибко устанавливать значение для N в соответствии с типами, количеством и распределением различных терминальных устройств внутри предприятия с тем, чтобы была возможность получить больше информации о терминальных устройствах при реализации удобного управления.When distributing VLANs to terminal devices, the LAN control device can flexibly set the value for N in accordance with the types, number and distribution of various terminal devices within the enterprise so that it is possible to obtain more information about terminal devices when implementing convenient management.

Конкретный способ для извлечения поля префикса будет описан в нижеследующих вариантах осуществления.A specific method for extracting a prefix field will be described in the following embodiments.

103. Распределяют тэг VLAN.103. Distribute the VLAN tag.

Устройство для распределения VLAN распределяет соответствующий тэг VLAN терминальному устройству, в соответствии с полем префикса. Если тэг VLAN распределяется исходно терминальному устройству, то сохраняется поле префикса и соответствующий тэг VLAN и устанавливается зависимость отображения между полем префикса и соответствующим тэгом VLAN.The VLAN distribution device distributes the corresponding VLAN tag to the terminal device according to the prefix field. If the VLAN tag is distributed initially to the terminal device, then the prefix field and the corresponding VLAN tag are saved and the mapping relationship between the prefix field and the corresponding VLAN tag is established.

Различные типы терминальных устройств имеют разные требования к приложению услуг и должны быть распределены соответствующим VLAN для получения соответствующих сетевых ресурсов. Терминальные устройства одного и того же типа, как правило, имеют одинаковое поле префикса. Устройство для распределения VLAN может различать разные типы терминальных устройств в соответствии с полем префикса и может распределять одинаковый тэг VLAN множеству терминальных устройств одного и того же типа. Это предотвращает проблемы, когда возникает большой объем данных, и он не может быть обслужен из-за точной статической привязки зависимости отображения между MAC-адресом и VLAN.Different types of terminal devices have different requirements for the service application and must be allocated by the corresponding VLAN to obtain the appropriate network resources. Terminal devices of the same type, as a rule, have the same prefix field. A device for distributing VLANs can distinguish between different types of terminal devices according to a prefix field and can distribute the same VLAN tag to a plurality of terminal devices of the same type. This prevents problems when a large amount of data occurs and cannot be served due to the exact static binding of the mapping relationship between the MAC address and VLAN.

В соответствии с настоящим изобретением из MAC-адреса извлекается поле префикса, и соответствующий тэг VLAN распределяется терминальному устройству в соответствии с полем префикса; если в соответствии с настоящим изобретением требуется распределить тэги VLAN множеству терминальных устройств с одинаковым полем префикса, то VLAN могут быть распределены единообразно множеству терминальных устройств таким образом, что терминальные устройства с одинаковым полем префикса имеют одинаковый тэг VLAN, тем самым сокращая нагрузку на коммутатор и увеличивая скорость обработки запроса распределения.In accordance with the present invention, a prefix field is extracted from the MAC address, and the corresponding VLAN tag is allocated to the terminal device in accordance with the prefix field; if in accordance with the present invention it is required to distribute VLAN tags to a plurality of terminal devices with the same prefix field, then VLANs can be distributed uniformly to a plurality of terminal devices so that terminal devices with the same prefix field have the same VLAN tag, thereby reducing the load on the switch and increasing the load distribution request processing speed.

Компьютерное устройство не может автоматически идентифицировать то, какие биты указывают поле префикса. Настоящее изобретение предоставляет способ для извлечения поля префикса. Обращаясь к Фиг.2, способ для распределения VLAN в соответствии с другим вариантом осуществления настоящего изобретения включает в себя этапы, на которых:A computer device cannot automatically identify which bits indicate a prefix field. The present invention provides a method for retrieving a prefix field. Turning to FIG. 2, a method for allocating VLANs in accordance with another embodiment of the present invention includes the steps of:

201. Получают MAC-адрес терминального устройства.201. Get the MAC address of the terminal device.

Когда инициализируются все терминальные устройства внутри предприятия, то устройство для распределения VLAN получает MAC-адрес терминального устройства, которому требуется распределить тэг VLAN.When all terminal devices within the enterprise are initialized, the VLAN distribution device obtains the MAC address of the terminal device that needs to distribute the VLAN tag.

202. Запрашивают маску, соответствующую MAC-адресу.202. Request a mask corresponding to the MAC address.

Устройство для распределения VLAN запрашивает маску, соответствующую MAC-адресу.The VLAN distributor requests a mask corresponding to the MAC address.

В устройстве для распределения VLAN заранее установлена маска, согласующая поле префикса MAC-адреса. В частности, если полем префикса являются N бит MAC-адреса, то первые N бит маски представляют собой «1», а оставшиеся 48 минус N бит представляют собой «0». Например, если поле префикса составляет 32 бита (1234-5678-xxxx), то маской является ffff-ffff-0000.A mask matching the MAC address prefix field is predefined in the VLAN distribution device. In particular, if the prefix field is N bits of the MAC address, then the first N bits of the mask are “1”, and the remaining 48 minus N bits are “0”. For example, if the prefix field is 32 bits (1234-5678-xxxx), then the mask is ffff-ffff-0000.

В настоящем изобретении функцией маски является маскирование полей в MAC-адресе за исключением поля префикса с тем, чтобы компьютер независимо идентифицировал поле префикса в MAC-адресе.In the present invention, the function of the mask is to mask the fields in the MAC address except for the prefix field so that the computer independently identifies the prefix field in the MAC address.

203. Выполняют операцию применительно к MAC-адресу и маске.203. Perform the operation with respect to the MAC address and mask.

Устройство для распределения VLAN выполняет операцию бинарного логического И над MAC-адресом и соответствующей маской, чтобы получить поле префикса.The device for distributing the VLAN performs a binary logical AND operation on the MAC address and the corresponding mask to obtain a prefix field.

После того как для MAC-адреса и маски выполнена побитовая операция «И», в MAC-адресе сохраняется только значение поля префикса, и таким образом компьютер может независимо выполнить соответствующую обработку для поля префикса.After the bitwise operation “AND” is performed for the MAC address and mask, only the value of the prefix field is stored in the MAC address, and thus the computer can independently perform the corresponding processing for the prefix field.

Количество разных терминалов, которые могут указываться способом с MAC-адресом плюс маской, очень гибкое, и главным образом зависит от длины сконфигурированной маски. Если количество терминалов конкретного типа большое, то длина маски конфигурируется таким образом, чтобы быть короче (т.е. конфигурируя меньшее число «1» для первых бит маски). Если количество терминалов небольшое, то для реализации более точной конфигурации и управления может конфигурироваться более длинная маска (т.е. конфигурируя большее число «1» для первых бит маски).The number of different terminals that can be indicated in a way with a MAC address plus a mask is very flexible, and mainly depends on the length of the configured mask. If the number of terminals of a particular type is large, then the length of the mask is configured to be shorter (that is, by configuring a smaller number of “1” for the first bits of the mask). If the number of terminals is small, then to implement a more accurate configuration and control, a longer mask can be configured (that is, by configuring a larger number of “1” for the first bits of the mask).

Предположим, что MAC-адресом терминального устройства является 1234-5678-9abc. Когда на предприятии присутствует несколько терминальных устройств данного типа, то маска может конфигурироваться в виде ffff-ff00-0000. В данном случае информация, представляемая терминальными устройствами данного типа в сети, соответствует лишь 1234-56. Тем не менее, такое сочетание MAC-адреса плюс маски может указывать терминалы в диапазоне от 1234-5600-0000 до 1234-56ff-ffff. Когда на предприятии присутствует небольшое количество терминальных устройств данного типа, то маска может быть сконфигурирована в виде ffff-ffff-0000. В данном случае, информация, представляемая терминальными устройствами данного типа в сети, соответствует 1234-5678. Компьютер может узнать больше информации о терминальном устройстве посредством поля префикса в виде 1234-5678 и таким образом распределение VLAN осуществляется более рационально. Тем не менее, соответственно, такое сочетание MAC-адреса плюс маски может указывать терминалы в меньшем диапазоне и соответственно лишь терминалы в диапазоне от 1234-5678-0000 до 1234-5678-ffff.Assume that the MAC address of the terminal device is 1234-5678-9abc. When several terminal devices of this type are present at the enterprise, the mask can be configured as ffff-ff00-0000. In this case, the information provided by terminal devices of this type in the network corresponds to only 1234-56. However, this combination of MAC address plus mask can indicate terminals ranging from 1234-5600-0000 to 1234-56ff-ffff. When a small number of terminal devices of this type are present at the enterprise, the mask can be configured as ffff-ffff-0000. In this case, the information provided by terminal devices of this type in the network corresponds to 1234-5678. The computer can learn more information about the terminal device through the prefix field in the form 1234-5678, and thus the distribution of VLANs is more rational. However, accordingly, this combination of MAC address plus mask can indicate terminals in a smaller range and, accordingly, only terminals in the range from 1234-5678-0000 to 1234-5678-ffff.

На этапах с 202 по 203 поле префикса извлекается посредством конфигурирования маски. Тем не менее, в соответствии с настоящим изобретением поле префикса с заранее установленной длиной может извлекаться неизменно посредством предварительной установки параметра. На практике, правило извлечения поля префикса может отличаться от того, что описано в настоящем изобретении, и правило здесь не ограничивается.In steps 202 to 203, the prefix field is retrieved by configuring the mask. However, in accordance with the present invention, a prefix field with a predetermined length can be retrieved invariably by presetting the parameter. In practice, the rule for retrieving the prefix field may differ from what is described in the present invention, and the rule is not limited here.

204. Распределяют тэг VLAN.204. Distribute the VLAN tag.

Содержимое этапа 204 в данном варианте осуществления точно такое же, как и у этапа 103 в варианте осуществления, проиллюстрированном на Фиг.1, и которое здесь вновь подробно не описывается.The content of step 204 in this embodiment is exactly the same as that of step 103 in the embodiment illustrated in FIG. 1, and which is not described in detail here again.

В варианте осуществления настоящего изобретения, для распределения VLAN используется способ MAC-адреса плюс маски. Во-первых, данный способ представления терминальных устройств очень гибок. Количество терминалов и точность могут управляться в соответствии с тем, как это требуется на практике. Во-вторых, в сети, как правило, разные VLAN используются для указания разных услуг (разные услуги имеют разные приоритеты); вследствие этого предназначенные терминалы (например, IP телефон или цифровая телевизионная абонентская приставка) используются для реализации многих услуг. Различие между разными терминалами может реализовываться посредством сочетания MAC-адреса и маски, тем самым дополнительно разграничивая разные услуги и реализуя управление разными услугами.In an embodiment of the present invention, the MAC address plus mask method is used for VLAN allocation. Firstly, this way of representing terminal devices is very flexible. The number of terminals and accuracy can be controlled according to how it is required in practice. Secondly, in a network, as a rule, different VLANs are used to indicate different services (different services have different priorities); as a result, designated terminals (for example, an IP telephone or a digital television set-top box) are used to implement many services. The difference between different terminals can be realized by combining a MAC address and a mask, thereby further delimiting different services and implementing management of different services.

На практике, во время инициализации устройство для распределения VLAN распределяет VLAN всем терминальным устройствам. Во время отправки пакета некоторые терминальные устройства могут конфигурировать тэг VLAN для отправляемого пакета. Тем не менее, некоторым терминальным устройствам не удается сконфигурировать тэг VLAN для отправляемого пакета. Вследствие этого, настоящее изобретение дополнительно предоставляет механизм для распределения VLAN в режиме реального времени. Обращаясь к Фиг.3, способ для распределения VLAN в соответствии с другим вариантом осуществления настоящего изобретения включает в себя этапы, на которых:In practice, during initialization, a VLAN distribution device distributes VLANs to all terminal devices. During packet sending, some terminal devices may configure the VLAN tag for the packet being sent. However, some terminal devices cannot configure the VLAN tag for the packet being sent. Therefore, the present invention further provides a mechanism for real-time VLAN allocation. Turning to FIG. 3, a method for distributing VLANs in accordance with another embodiment of the present invention includes the steps of:

301. Принимают пакет, отправленный терминальным устройством.301. Receive the packet sent by the terminal device.

Устройство для распределения VLAN принимает пакет, отправленный терминальным устройством в одной и той же локальной сети. Пакет указывает услуги, которые должны выполняться соответствующим терминальным устройством.A VLAN distribution device receives a packet sent by a terminal device on the same local network. The packet indicates the services to be performed by the corresponding terminal device.

302.Определяют, несет ли пакет в себе тэг VLAN.302. Determines if a packet carries a VLAN tag.

Устройство для распределения VLAN определяет, несет ли пакет в себе тэг VLAN; если пакет несет в себе тэг VLAN, то инициируется этап 308; если пакет не несет в себе тэг VLAN, то инициируется этап 303.The device for distributing the VLAN determines whether the packet carries a VLAN tag; if the packet carries a VLAN tag, then step 308 is triggered; if the packet does not carry a VLAN tag, then step 303 is triggered.

На практике во время отправки пакета некоторые терминальные устройства могут конфигурировать тэг VLAN для отправляемого пакета, в то время как некоторые терминальные устройства не могут конфигурировать тэг VLAN для отправляемого пакета. В данном случае устройству коммутатору требуется в режиме реального времени добавить заранее установленный тэг VLAN в пакет, в котором отсутствует тэг VLAN, с тем чтобы возможно было реализовать пересылку пакета внутри соответствующей VLAN.In practice, when sending a packet, some terminal devices may configure the VLAN tag for the packet being sent, while some terminal devices cannot configure the VLAN tag for the packet being sent. In this case, the device switch needs to add a predefined VLAN tag to the packet in which there is no VLAN tag in real time so that it is possible to forward the packet inside the corresponding VLAN.

303. Получают MAC-адрес терминала.303. Get the MAC address of the terminal.

Устройство для распределения VLAN восстанавливает пакет после инкапсуляции и получает из пакета MAC-адрес терминального устройства-отправителя.The VLAN distribution device restores the packet after encapsulation and obtains the MAC address of the sending terminal device from the packet.

304. Запрашивают маску, соответствующую MAC-адресу.304. Request a mask corresponding to the MAC address.

Содержимое этапа 304 в данном варианте осуществления точно такое же, как этапа 202 в варианте осуществления, проиллюстрированном на Фиг.2, и которое здесь вновь подробно не описывается.The contents of step 304 in this embodiment are exactly the same as step 202 in the embodiment illustrated in FIG. 2, and which is not described in detail here again.

305. Выполняют операцию применительно к MAC-адресу и маске.305. Perform the operation with respect to the MAC address and mask.

Содержимое этапа 305 в данном варианте осуществления точно такое же, как этапа 203 в варианте осуществления, проиллюстрированном на Фиг.2, и которое здесь вновь подробно не описывается.The contents of step 305 in this embodiment are exactly the same as step 203 in the embodiment illustrated in FIG. 2, and which is not described in detail here again.

306. Запрашивают зависимость отображения.306. Request display dependency.

Устройство для распределения VLAN запрашивает локально хранящуюся зависимость отображения между полем префикса и тэгом VLAN.The VLAN distributor requests a locally stored mapping relationship between the prefix field and the VLAN tag.

Поле префикса MAC-адреса указывает все устройства одного и того же типа. Для данного типа терминальных устройств должны быть сконфигурированы соответствующие сетевые ресурсы и приоритеты передачи. Вследствие этого, требуется осуществлять пересылку пакетов, отправляемых терминальными устройствами, в пределах VLAN с соответствующими сетевыми ресурсами и приоритетами передачи. Так как процесс пересылки пакетов выполняется после инициализации терминального устройства, то поля префикса и соответствующие тэги VLAN хранятся локально.The MAC address prefix field indicates all devices of the same type. For this type of terminal device, the appropriate network resources and transmission priorities must be configured. As a result, it is necessary to forward packets sent by terminal devices within the VLAN with the appropriate network resources and transmission priorities. Since the packet forwarding process is performed after the terminal device is initialized, the prefix fields and the corresponding VLAN tags are stored locally.

307. Распределяют тэг VLAN.307. Distribute the VLAN tag.

После запроса зависимости отображения между полем префикса и соответствующим тэгом VLAN устройство для распределения VLAN добавляет соответствующий тэг VLAN в пакет с тем, чтобы можно было осуществить пересылку пакета внутри соответствующей VLAN.After requesting the mapping dependency between the prefix field and the corresponding VLAN tag, the VLAN distribution device adds the corresponding VLAN tag to the packet so that the packet can be forwarded inside the corresponding VLAN.

308. Пересылают пакет.308. Forward the packet.

Устройство для распределения VLAN пересылает пакет соответствующей VLAN в соответствии с тэгом VLAN в пакете и обрабатывает услугу, переносимую в пакете.The VLAN allocator forwards the packet to the corresponding VLAN in accordance with the VLAN tag in the packet and processes the service carried in the packet.

В варианте осуществления настоящего изобретения при приеме пакета устройство для распределения VLAN определяет, несет ли пакет в себе тэг VLAN; если пакет не несет в себе тэг VLAN, то распределяет тэг VLAN пакету в соответствии с полем префикса пакета таким образом, чтобы можно было осуществить пересылку пакета внутри соответствующей VLAN для соответствующей обработки услуги. В сравнении с обычной технологией распределения тэга VLAN в соответствии с MAC-адресом, поле префикса в соответствии с настоящим изобретение может указывать множество терминальных устройств. Поэтому хранится небольшой объем данных с тем, чтобы реализовать более удобный запрос зависимости отображения, которая относится к тэгу VLAN, и заметно увеличить скорость пересылки пакета.In an embodiment of the present invention, upon receiving a packet, the VLAN distributor determines whether the packet carries a VLAN tag; if the packet does not carry a VLAN tag, it distributes the VLAN tag to the packet in accordance with the packet prefix field so that it can forward the packet inside the corresponding VLAN for the corresponding service processing. Compared to conventional technology for distributing a VLAN tag according to a MAC address, a prefix field in accordance with the present invention may indicate a plurality of terminal devices. Therefore, a small amount of data is stored in order to implement a more convenient mapping dependency request, which refers to the VLAN tag, and significantly increase the packet forwarding rate.

Чтобы облегчить понимание, нижеследующее использует конкретный сценарий приложения, для подробного описания способа для распределения VLAN в соответствии с вышеприведенным вариантом осуществления, в частности в соответствии со следующим:To facilitate understanding, the following uses a specific application scenario to describe in detail a method for allocating VLANs in accordance with the above embodiment, in particular in accordance with the following:

1. Конфигурация Инициализации1. Initialization Configuration

Во время инициализации всех терминальных устройств в одной и той же VLAN устройство для распределения VLAN сначала получает MAC-адреса всех терминальных устройств, анализирует и классифицирует все MAC-адреса, определяет поля префикса терминальных устройств различных типов в соответствии с такими факторами, как типы, количество и распределение терминальных устройств, и локально сохраняет поля префикса в виде MAC-адреса плюс маска.During initialization of all terminal devices in the same VLAN, the VLAN distribution device first receives the MAC addresses of all terminal devices, analyzes and classifies all MAC addresses, determines the prefix fields of various types of terminal devices in accordance with factors such as types, number and distribution of terminal devices, and locally stores the prefix fields as a MAC address plus mask.

Предположим, что все терминальные устройства могут быть классифицированы на три типа: компьютер, IP телефон и цифровая телевизионная абонентская приставка. Посредством анализа типов, количества и распределения различных терминальных устройств определяется, что полями префикса компьютера, IP телефона и цифровой телевизионной абонентской приставки являются соответственно 24 бита, 32 бита и 40 бит. Предположим что MAC-адреса 1234-5678-9abc, 1234-56bc-349a, и 1234-5634-9a34 соответственно представляют собой компьютер, IP телефон и цифровую телевизионную абонентскую приставку. Тогда сочетание MAC-адреса плюс маски могут быть соответственно представлены как: 1234-5678-9abc+ffff-ff00-0000, 1234-56bc-349a+ffff-ffff-0000, и 1234-5634-9a34+ffff-ffff-ff00.Suppose that all terminal devices can be classified into three types: computer, IP telephone, and digital television set-top box. By analyzing the types, quantity and distribution of various terminal devices, it is determined that the fields of the computer prefix, IP telephone and digital television set-top box are 24 bits, 32 bits and 40 bits, respectively. Suppose the MAC addresses 1234-5678-9abc, 1234-56bc-349a, and 1234-5634-9a34, respectively, are a computer, an IP telephone, and a digital set-top box. Then the combination of the MAC address plus masks can be respectively represented as: 1234-5678-9abc + ffff-ff00-0000, 1234-56bc-349a + ffff-ffff-0000, and 1234-5634-9a34 + ffff-ffff-ff00.

В соответствии с требованиями в отношении сетевых ресурсов различными типами терминальных устройств, каждому полю префикса распределяется тэг VLAN, сохраняется зависимость отображения между полем префикса и тэгом VLAN и тэг VLAN отправляется соответствующему терминальному устройству. Таким образом, когда терминальное устройство, обладающее возможностью добавления тэга VLAN, отправляет пакет, то в пакет добавляется тэг VLAN, соответствующий терминальному устройству.In accordance with network resource requirements of various types of terminal devices, a VLAN tag is allocated to each prefix field, a mapping relationship between the prefix field and the VLAN tag is saved, and the VLAN tag is sent to the corresponding terminal device. Thus, when a terminal device capable of adding a VLAN tag sends a packet, a VLAN tag corresponding to the terminal device is added to the packet.

2. Пересылка Пакета2. Package Forwarding

Устройство для распределения VLAN получает пакет, отправленный терминальным устройством, определяет, несет ли пакет в себе тэг VLAN, пересылает пакет соответствующей VLAN для выполнения услуги, переносимой в пакете, если пакет несет в себе тэг VLAN, и запускает процесс распределения тэга VLAN в режиме реального времени, если пакет не несет в себе тэга VLAN (например, пакет отправлен компьютером применительно к просмотру web-страницы).The VLAN distribution device receives the packet sent by the terminal device, determines if the packet carries a VLAN tag, forwards the packet to the corresponding VLAN to perform the service carried in the packet, if the packet carries a VLAN tag, and starts the process of distributing the VLAN tag in real time time if the packet does not carry a VLAN tag (for example, a packet was sent by a computer as it relates to viewing a web page).

Процесс распределения тэга VLAN в режиме реального времени включает в себя этапы, на которых: во-первых, восстанавливают пакет после инкапсуляции, чтобы получить то, что MAC-адрес терминального устройства отправителя в пакете соответствует 1234-5678-9abc; получают, посредством запроса то, что строкой данных из MAC-адреса + маска, соответствующей MAC-адресу 1234-5678-9abc, является 1234-5678-9abc + ffff-ff00-0000, и выполняют операцию бинарного логического И над MAC-адресом и соответствующей маской, чтобы получить поле префикса вида 1234-56; в заключении, запрашивают локально хранящуюся зависимость отображения между полем префикса и тэгом VLAN (1234-56 - VLAN1) и добавляют соответствующий тэг VLAN виде VLAN1 к пакету, в соответствии с зависимостью отображения.The process of distributing a real-time VLAN tag includes the steps of: firstly, restoring the packet after encapsulation to obtain that the MAC address of the sender's terminal device in the packet corresponds to 1234-5678-9abc; receive, by request, that the data string from the MAC address + mask corresponding to the MAC address 1234-5678-9abc is 1234-5678-9abc + ffff-ff00-0000, and perform a binary logical AND operation on the MAC address and the appropriate mask to get the prefix field of the form 1234-56; finally, they request a locally stored mapping dependency between the prefix field and the VLAN tag (1234-56 - VLAN1) and add the corresponding VLAN tag as VLAN1 to the packet, in accordance with the mapping dependency.

После того как тэг VLAN добавлен в пакет, устройство для распределения VLAN пересылает пакет в VLAN 1 в соответствии с тэгом VLAN в пакете, для обработки услуги, переносимой в пакете.After the VLAN tag is added to the packet, the VLAN distribution device forwards the packet to VLAN 1 in accordance with the VLAN tag in the packet to process the service carried in the packet.

Внутри одного и того же предприятия, когда меняется физическое местоположение некоторых терминальных устройств, терминальному устройству в соответствии с настоящим изобретением распределяется VLAN в соответствии с полем префикса MAC-адреса, а соответствующее приложение терминального устройства не меняется. Вследствие этого не требуется выполнять повторную конфигурацию VLAN. Если предприятию требуется модернизировать или обновить устройства, то до тех пор, пока предприятие продолжает использовать устройства одного и того же поставщика, вероятнее всего поля префикса MAC-адресов не поменяются. Вследствие этого, также не требуется менять исходную конфигурацию VLAN, что сокращает объем работ предприятия по обслуживанию сетевых устройств.Within the same enterprise, when the physical location of some terminal devices changes, the terminal device in accordance with the present invention is allocated a VLAN according to the MAC address prefix field, and the corresponding terminal device application does not change. As a result, reconfiguration of the VLAN is not required. If an enterprise needs to upgrade or upgrade devices, then as long as the enterprise continues to use devices from the same vendor, the MAC address prefix fields will most likely not change. As a result of this, it is also not necessary to change the initial configuration of the VLAN, which reduces the amount of work the enterprise needs to service network devices.

Нижеследующее описывает устройство для распределения VLAN для реализации вышеприведенного способа для распределения VLAN в соответствии с вариантом осуществления настоящего изобретения. Применительно к логической структуре обратимся к Фиг.4. Устройство для распределения VLAN в соответствии с вариантом осуществления настоящего изобретения включает в себя:The following describes a VLAN allocation device for implementing the above method for VLAN allocation in accordance with an embodiment of the present invention. In relation to the logical structure, we turn to Figure 4. An apparatus for distributing VLANs in accordance with an embodiment of the present invention includes:

модуль 401 получения, выполненный с возможностью получения адреса MAC терминального устройства;a receiving module 401, configured to obtain a MAC address of a terminal device;

модуль 402 извлечения, выполненный с возможностью извлечения поля префикса из MAC-адреса в соответствии с заранее установленным правилом извлечения, при этом поле префикса является бинарным полем из первых N бит в MAC-адресе, причем N больше либо равно 1 и меньше 48; иan extraction module 402, configured to extract a prefix field from a MAC address in accordance with a predetermined extraction rule, wherein the prefix field is a binary field of the first N bits in the MAC address, wherein N is greater than or equal to 1 and less than 48; and

модуль 403 распределения, выполненный с возможностью распределения соответствующего тэга VLAN терминальному устройству в соответствии с полем префикса.distribution module 403, configured to distribute the corresponding VLAN tag to the terminal device in accordance with the prefix field.

Модуль извлечения в варианте осуществления настоящего изобретения может включать в себя:An extraction module in an embodiment of the present invention may include:

первый модуль 4021 запроса, выполненный с возможностью запроса маски, соответствующей MAC-адресу; иa first request module 4021, configured to request a mask corresponding to the MAC address; and

операционный модуль 4022, выполненный с возможностью выполнения операции бинарного логического И над MAC-адресом и маской, чтобы получить поле префикса.an operation module 4022 configured to perform a binary logical AND operation on the MAC address and mask to obtain a prefix field.

Модуль распределения в варианте осуществления настоящего изобретения может включать в себя:A distribution module in an embodiment of the present invention may include:

второй модуль 4031 запроса, выполненный с возможностью запроса зависимости отображения между полем префикса и тэгом VLAN; иa second request module 4031, configured to request a mapping relationship between the prefix field and the VLAN tag; and

модуль 4032 распределения, выполненный с возможностью распределения соответствующего тэга VLAN терминальному устройству в соответствии с зависимостью отображения.a distribution module 4032, configured to distribute the corresponding VLAN tag to the terminal device in accordance with a mapping dependency.

Устройство для распределения VLAN в варианте осуществления настоящего изобретения может дополнительно включать в себя:A device for distributing VLANs in an embodiment of the present invention may further include:

модуль 404 приема, выполненный с возможностью приема пакета, отправленного терминальным устройством, и инициирования получения модулем получения из пакета MAC-адреса терминального устройства;a receiving module 404, configured to receive a packet sent by the terminal device and initiating the module to receive the MAC address of the terminal device from the packet from the packet;

модуль 405 пересылки, выполненный с возможностью пересылки пакета в VLAN, соответствующую тэгу VLAN, для выполнения соответствующей обработки услуги; иforwarding module 405, configured to forward the packet to a VLAN corresponding to the VLAN tag, for performing corresponding service processing; and

модуль 406 определения, выполненный с возможностью определения, несет ли пакет в себе тэг VLAN; если пакет несет в себе тэг VLAN, то инициирования выполнения операций модулем 405 пересылки; если пакет не несет в себе тэг VLAN, то инициирования выполнения операция модулем 401 получения.a determination module 406, configured to determine if the packet carries a VLAN tag; if the packet carries a VLAN tag, then initiating operations by the forwarding module 405; if the packet does not carry a VLAN tag, then the operation is initiated by receiving module 401.

В соответствии с вариантом осуществления настоящего изобретения процесс взаимодействия модулей в устройстве для распределения VLAN следующий:According to an embodiment of the present invention, the process of interacting modules in a device for distributing VLANs is as follows:

Сначала модуль 401 получения получает MAC-адрес терминального устройства. MAC-адрес является глобально уникальным 48-битным (бинарным) физическим адресом, который прописан поставщиком в карте сетевого интерфейса. Процесс получения MAC-адреса может выполняться во время инициализации терминального устройства, или может быть следующим: модуль 404 приема принимает пакет, отправленный терминальным устройством в одной и той же локальной сети, инициирует получение модулем 401 получения MAC-адреса терминального устройства отправителя из пакета.First, acquisition module 401 obtains the MAC address of the terminal device. The MAC address is a globally unique 48-bit (binary) physical address that is specified by the provider in the network interface card. The process of obtaining a MAC address can be performed during initialization of the terminal device, or it can be as follows: the receiving module 404 receives a packet sent by the terminal device on the same local network, and the module 401 receives the MAC address of the terminal device of the sender from the packet.

Затем, если устройство для распределения VLAN выполняет процесс пересылки пакета, то модуль 406 определения в устройстве для распределения VLAN определяет, несет ли пакет в себе тэг VLAN, и инициирует выполнение операций модулем 405 пересылки, если пакет несет в себе тэг VLAN, и инициирует выполнение операции модулем 401 получения, если пакет не несет в себе тэг VLAN.Then, if the VLAN distribution device performs the packet forwarding process, the determination module 406 in the VLAN distribution device determines whether the packet carries a VLAN tag and initiates the operations by the forwarding module 405 if the packet carries a VLAN tag and initiates the execution operations by receiving module 401 if the packet does not carry a VLAN tag.

После того как модуль 401 получения получает MAC-адрес, модуль 402 извлечения извлекает из MAC-адреса поле префикса в соответствии с заранее установленным правилом извлечения. Поле префикса является бинарным полем из первых N бит в MAC-адресе, причем N больше либо равно 1 и меньше 48. Заранее установленное правило извлечения может быть таким, что первый модуль 4021 запроса запрашивает маску, которая соответствует MAC-адресу, а затем операционный модуль 4022 выполняет операцию бинарного логического B над MAC-адресом и соответствующей маской, чтобы получить поле префикса. В устройстве для распределения VLAN заранее установлена маска, согласующая поле префикса MAC-адреса. В частности, если полем префикса являются N бит MAC-адреса, то первые N биты маски представляют собой «1», а оставшиеся 48 минус N биты представляют собой «0». Например, если поле префикса составляет 32 бита (1234-5678-xxxx), то маской является ffff-ffff-0000. В соответствии с настоящим изобретением модуль 402 извлечения может извлекать неизменно поле префикса с заранее установленной длиной посредством предварительной установки параметра. На практике, правило извлечения поля префикса может отличаться от того, что описано в настоящем изобретении, и правило здесь не ограничивается.After the receiving module 401 obtains the MAC address, the extracting module 402 extracts a prefix field from the MAC address in accordance with a predetermined extraction rule. The prefix field is a binary field of the first N bits in the MAC address, and N is greater than or equal to 1 and less than 48. The predefined retrieval rule can be such that the first request module 4021 requests a mask that matches the MAC address, and then the operation module 4022 performs a binary logical B operation on the MAC address and the corresponding mask to obtain a prefix field. A mask matching the MAC address prefix field is predefined in the VLAN distribution device. In particular, if the prefix field is N bits of the MAC address, then the first N bits of the mask are “1”, and the remaining 48 minus N bits are “0”. For example, if the prefix field is 32 bits (1234-5678-xxxx), then the mask is ffff-ffff-0000. According to the present invention, the extraction module 402 can invariably retrieve a prefix field with a predetermined length by presetting the parameter. In practice, the rule for retrieving the prefix field may differ from what is described in the present invention, and the rule is not limited here.

После того как поле префикса извлечено, второй модуль 4031 запроса в модуле 403 распределения запрашивает зависимость отображения между полем префикса и тэгом VLAN. Модуль 4032 распределения распределяет соответствующий тэг VLAN пакету, отправленному терминальным устройством в соответствии с зависимостью отображения.After the prefix field is retrieved, the second request module 4031 in the distribution module 403 requests a mapping relationship between the prefix field and the VLAN tag. Distribution module 4032 distributes the corresponding VLAN tag to a packet sent by the terminal device in accordance with the mapping dependency.

Когда модуль 406 определения определяет, что пакет несет в себе тэг VLAN, или модуль 403 распределения распределяет тэг VLAN пакету, отправленному терминальным устройством, то модуль 405 пересылки пересылает пакет в VLAN, соответствующую тэгу VLAN, для соответствующей обработки услуги.When the determination module 406 determines that the packet carries a VLAN tag, or the distribution module 403 distributes the VLAN tag to the packet sent by the terminal device, the forwarding module 405 forwards the packet to the VLAN corresponding to the VLAN tag for corresponding service processing.

Специалистам в соответствующей области следует понимать, что все или часть этапов предшествующего способа могут быть реализованы посредством соответствующего аппаратного обеспечения, следующего инструкциям программ. Программы могут храниться на машиночитаемом носителе данных. Носитель данных может быть постоянным запоминающим устройством, магнитным диском или компакт диском.Specialists in the relevant field should understand that all or part of the steps of the previous method can be implemented using appropriate hardware following the instructions of the programs. Programs may be stored on a computer-readable storage medium. The storage medium may be read-only memory, a magnetic disk, or a compact disk.

Представленные выше подробности описывают способ и устройство для распределения VLAN, предоставленные в вариантах осуществления настоящего изобретения. Специалисты в соответствующей области могут выполнить модификации или вариации применительно к вариантам осуществления и приложению, не отступая от идеи вариантов осуществления. Описание не предназначено ограничивать настоящее изобретение.The above details describe a method and apparatus for distributing VLANs provided in embodiments of the present invention. Specialists in the relevant field can make modifications or variations in relation to the options for implementation and application, without departing from the idea of embodiments. The description is not intended to limit the present invention.

Claims (12)

1. Способ для распределения виртуальной локальной сети (VLAN), содержащий этапы, на которых:
получают адрес управления доступом к среде (MAC) терминального устройства;
извлекают поле префикса из MAC-адреса в соответствии с заранее установленным правилом извлечения, при этом поле префикса является бинарным полем из первых N бит в MAC-адресе, причем N больше либо равно 1 и меньше 48; и
распределяют соответствующий тэг VLAN терминальному устройству в соответствии с полем префикса.
1. A method for distributing a virtual local area network (VLAN), comprising the steps of:
obtaining a medium access control (MAC) address of the terminal device;
extracting the prefix field from the MAC address in accordance with a predetermined extraction rule, wherein the prefix field is a binary field from the first N bits in the MAC address, wherein N is greater than or equal to 1 and less than 48; and
distribute the corresponding VLAN tag to the terminal device in accordance with the prefix field.
2. Способ по п.1, в котором этап, на котором извлекают поле префикса из MAC-адреса в соответствии с заранее установленным правилом, содержит этапы, на которых:
запрашивают маску, соответствующую MAC-адресу; и
выполняют операцию бинарного логического И над MAC-адресом и маской, для получения поля префикса.
2. The method according to claim 1, wherein the step of extracting the prefix field from the MAC address in accordance with a predetermined rule, comprises the steps of:
requesting a mask corresponding to the MAC address; and
perform a binary logical AND operation on the MAC address and mask to obtain a prefix field.
3. Способ по п.2, в котором этап, на котором распределяют соответствующий тэг VLAN терминальному устройству в соответствии с полем префикса, содержит этапы, на которых:
запрашивают зависимость отображения между полем префикса и тэгом VLAN; и
распределяют соответствующий тэг VLAN терминальному устройству в соответствии с зависимостью отображения.
3. The method of claim 2, wherein the step of distributing the corresponding VLAN tag to the terminal device in accordance with the prefix field comprises the steps of:
requesting a mapping dependency between the prefix field and the VLAN tag; and
distribute the corresponding VLAN tag to the terminal device according to the mapping dependency.
4. Способ по п.3, в котором этап, на котором получают MAC-адрес терминального устройства, содержит этапы, на которых:
принимают пакет, отправленный терминальным устройством; и
получают MAC-адрес терминального устройства из пакета.
4. The method according to claim 3, in which the step of obtaining the MAC address of the terminal device comprises the steps of:
receive a packet sent by the terminal device; and
get the MAC address of the terminal device from the packet.
5. Способ по п.4, в котором после этапа, на котором распределяют соответствующий тэг VLAN терминальному устройству в соответствии с полем префикса, способ дополнительно содержит этап, на котором:
пересылают пакет в VLAN, соответствующей тэгу VLAN, чтобы выполнить соответствующую обработку услуги.
5. The method according to claim 4, in which, after the stage at which the corresponding VLAN tag is distributed to the terminal device in accordance with the prefix field, the method further comprises the step of:
forward the packet to the VLAN corresponding to the VLAN tag in order to perform the corresponding service processing.
6. Способ по п.5, в котором после этапа, на котором принимают пакет, отправленный терминальным устройством, способ дополнительно содержит этапы, на которых:
определяют, несет ли пакет в себе тэг VLAN, и если пакет несет в себе тэг VLAN, то пересылают пакет в VLAN, соответствующую тэгу VLAN, чтобы выполнить соответствующую обработку услуги;
если пакет не несет в себе тэг VLAN, то инициируют этап, на котором получают MAC-адрес терминального устройства из пакета.
6. The method according to claim 5, in which after the stage at which a packet sent by the terminal device is received, the method further comprises the steps of:
determining whether the packet carries a VLAN tag, and if the packet carries a VLAN tag, then forwarding the packet to the VLAN corresponding to the VLAN tag in order to carry out the corresponding service processing;
if the packet does not carry a VLAN tag, then initiate the step of obtaining the MAC address of the terminal device from the packet.
7. Устройство для распределения виртуальной локальной сети (VLAN), содержащее:
модуль получения, выполненный с возможностью получения адреса управления доступом к среде (MAC) терминального устройства;
модуль извлечения, выполненный с возможностью извлечения поля префикса из MAC-адреса в соответствии с заранее установленным правилом извлечения, при этом поле префикса является бинарным полем из первых N бит в MAC-адресе, причем N больше либо равно 1 и меньше 48; и
модуль распределения, выполненный с возможностью распределения соответствующего тэга VLAN терминальному устройству в соответствии с полем префикса.
7. A device for distributing a virtual local area network (VLAN), comprising:
a receiving module, configured to obtain a medium access control (MAC) address of the terminal device;
an extraction module configured to extract the prefix field from the MAC address in accordance with a predetermined extraction rule, wherein the prefix field is a binary field of the first N bits in the MAC address, wherein N is greater than or equal to 1 and less than 48; and
a distribution module, configured to distribute the corresponding VLAN tag to the terminal device in accordance with the prefix field.
8. Устройство по п.7, в котором модуль извлечения содержит:
первый модуль запроса, выполненный с возможностью запроса маски, соответствующей MAC-адресу; и
операционный модуль, выполненный с возможностью выполнения операции бинарного логического И над MAC-адресом и маской, чтобы получить поле префикса.
8. The device according to claim 7, in which the extraction module contains:
a first request module configured to request a mask corresponding to the MAC address; and
an operation module configured to perform a binary logical AND operation on the MAC address and mask to obtain a prefix field.
9. Устройство по п.8, в котором модуль распределения содержит:
второй модуль запроса, выполненный с возможностью запроса зависимости отображения между полем префикса и тэгом VLAN; и
модуль распределения, выполненный с возможностью распределения соответствующего тэга VLAN терминальному устройству в соответствии с зависимостью отображения.
9. The device of claim 8, in which the distribution module contains:
a second request module, configured to request a mapping dependency between the prefix field and the VLAN tag; and
a distribution module, configured to distribute the corresponding VLAN tag to the terminal device in accordance with the mapping dependency.
10. Устройство по п.9, дополнительно содержащее:
модуль приема, выполненный с возможностью приема пакета, отправленного терминальным устройством, и инициирования получения модулем получения из пакета MAC-адреса терминального устройства.
10. The device according to claim 9, further comprising:
a receiving module, configured to receive a packet sent by the terminal device, and initiating the receiving module receiving from the packet the MAC address of the terminal device.
11. Устройство по п.10, дополнительно содержащее:
модуль пересылки, выполненный с возможностью пересылки пакета в VLAN, соответствующую тэгу VLAN, для выполнения соответствующей обработки услуги.
11. The device according to claim 10, further comprising:
a forwarding module, configured to forward the packet to a VLAN corresponding to the VLAN tag to perform corresponding service processing.
12. Устройство по п.11, дополнительно содержащее:
модуль определения, выполненный с возможностью определения, несет ли пакет в себе тэг VLAN; если пакет несет в себе тэг VLAN, то инициирования выполнения операций модулем пересылки; а если пакет не несет в себе тэг VLAN, то инициирования получения модулем получения из пакета MAC-адреса терминального устройства.
12. The device according to claim 11, further comprising:
a determining module, configured to determine if the packet carries a VLAN tag; if the packet carries a VLAN tag, then initiating operations by the forwarding module; and if the packet does not carry a VLAN tag, then the module initiates the receipt of the MAC address of the terminal device from the packet from the packet.
RU2013106261/08A 2010-12-28 2011-08-22 Method and device for distribution of virtual local network RU2530250C1 (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN201010609713.XA CN102055641A (en) 2010-12-28 2010-12-28 Distribution method for virtual local area network and related device
CN201010609713.X 2010-12-28
PCT/CN2011/078706 WO2012088901A1 (en) 2010-12-28 2011-08-22 Method for allocating virtual local area network and associated device

Publications (2)

Publication Number Publication Date
RU2013106261A RU2013106261A (en) 2014-08-20
RU2530250C1 true RU2530250C1 (en) 2014-10-10

Family

ID=43959594

Family Applications (1)

Application Number Title Priority Date Filing Date
RU2013106261/08A RU2530250C1 (en) 2010-12-28 2011-08-22 Method and device for distribution of virtual local network

Country Status (3)

Country Link
CN (1) CN102055641A (en)
RU (1) RU2530250C1 (en)
WO (1) WO2012088901A1 (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102055641A (en) * 2010-12-28 2011-05-11 华为技术有限公司 Distribution method for virtual local area network and related device
CN102970150A (en) * 2011-09-01 2013-03-13 日电(中国)有限公司 Extensible multicast forwarding method and device for data center (DC)
CN102684971A (en) * 2012-05-28 2012-09-19 太仓市同维电子有限公司 VLAN (Virtual Local Area Network) function realizing method and Linux system LAN gateway
CN103457855B (en) * 2012-06-04 2018-08-10 中兴通讯股份有限公司 Classless inter-domain routing table is established and the method and apparatus of message forwarding
CN103532850B (en) * 2013-09-29 2017-05-24 福建星网锐捷网络有限公司 Uplink message forwarding method, device and AP (access point) equipment
CN104717380B (en) * 2015-04-09 2017-06-27 迈普通信技术股份有限公司 Interchanger, speech ciphering equipment, IP telephony system and speech ciphering equipment dispositions method
CN106330492B (en) * 2015-06-23 2019-11-26 华为技术有限公司 A kind of method, apparatus and system configuring user equipment forwarding table
CN105933134A (en) * 2015-10-26 2016-09-07 上海剑桥科技股份有限公司 Wireless AP default resetting method and system
CN113923114B (en) * 2020-07-07 2022-10-28 荣耀终端有限公司 VLAN configuration method and related equipment
CN114513695B (en) * 2022-04-19 2022-06-17 深圳市华曦达科技股份有限公司 Method and device for cross-region operation of video content in OTT industry

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2297107C2 (en) * 2003-07-23 2007-04-10 Самсунг Электроникс Ко., Лтд. Method and system for generating access terminal ip address and for transferring messages to generate ip addresses in ip system
RU2008134481A (en) * 2006-03-08 2010-02-27 Ханчжоу Х3С Текнолоджиз Ко., Лтд. (Cn) VIRTUAL NETWORK INFORMATION STORAGE SYSTEM, NETWORK STORAGE DEVICE AND VIRTUAL METHOD

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100440848C (en) * 2002-02-28 2008-12-03 威盛电子股份有限公司 Data package transmitting method and network exchanger adopting said method
US7457300B2 (en) * 2003-01-21 2008-11-25 Telefonaktiebolaget L M Ericsson (Publ) Ethernet address management system
US7707312B2 (en) * 2003-12-31 2010-04-27 Alcatel Lucent Printer discovery protocol system and method
JP2006311066A (en) * 2005-04-27 2006-11-09 Toshiba Corp Electronic equipment
CN100555949C (en) * 2006-03-22 2009-10-28 华为技术有限公司 A kind of to GPON system configuration Native VLAN and processing Ethernet method of message
CN101043330B (en) * 2006-06-22 2010-08-25 华为技术有限公司 Apparatus and method for preventing MAC address from passing-off
CN101102264B (en) * 2006-07-04 2011-07-20 华为技术有限公司 Ethernet data forwarding method and Ethernet system
CN100531148C (en) * 2007-06-30 2009-08-19 华为技术有限公司 A message forwarding method, system and communication device
CN101409685B (en) * 2008-12-01 2010-10-27 杭州华三通信技术有限公司 Forwarding method based on virtual LAN mapping and access equipment
CN101567854B (en) * 2009-05-26 2011-06-29 武汉烽火网络有限责任公司 Ethernet data frame VLAN double-layer label processing device and method based on flow classification
CN102055641A (en) * 2010-12-28 2011-05-11 华为技术有限公司 Distribution method for virtual local area network and related device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2297107C2 (en) * 2003-07-23 2007-04-10 Самсунг Электроникс Ко., Лтд. Method and system for generating access terminal ip address and for transferring messages to generate ip addresses in ip system
RU2008134481A (en) * 2006-03-08 2010-02-27 Ханчжоу Х3С Текнолоджиз Ко., Лтд. (Cn) VIRTUAL NETWORK INFORMATION STORAGE SYSTEM, NETWORK STORAGE DEVICE AND VIRTUAL METHOD

Also Published As

Publication number Publication date
CN102055641A (en) 2011-05-11
WO2012088901A1 (en) 2012-07-05
RU2013106261A (en) 2014-08-20

Similar Documents

Publication Publication Date Title
RU2530250C1 (en) Method and device for distribution of virtual local network
US20160294769A1 (en) Communication Method, Apparatus, and System of Virtual Extensible Local Area Network
CN107733799B (en) Message transmission method and device
US10063470B2 (en) Data center network system based on software-defined network and packet forwarding method, address resolution method, routing controller thereof
CN107733670B (en) Forwarding strategy configuration method and device
EP2866389B1 (en) Method and device thereof for automatically finding and configuring virtual network
US8751650B2 (en) Method and apparatus for supporting access control lists in a multi-tenant environment
EP3664420B1 (en) Managing address spaces across network elements
EP2169877B1 (en) Processing method and device for qinq termination configuration
US20140126466A1 (en) Virtual wireless networking
RU2540820C2 (en) Packet forwarding method and switch
US10425354B2 (en) Resource allocation method, packet communication method, and apparatus
KR20140057553A (en) - virtualization gateway between virtualized and non-virtualized networks
WO2021174943A1 (en) Data forwarding method and apparatus, and device and storage medium
US9591034B2 (en) Method and gateway device for managing address resource
US20220350637A1 (en) Virtual machine deployment method and related apparatus
US9900804B2 (en) Method and device for processing to share network resources, and method, device and system for sharing network resources
US9729385B2 (en) Service provisioning method, device, and system in coaxial cable system
CN109995637B (en) S-VXLAN construction method, data forwarding method and system
US11258720B2 (en) Flow-based isolation in a service network implemented over a software-defined network
WO2022160982A1 (en) Ipv6 address configuration method and routing device
CN113923114B (en) VLAN configuration method and related equipment
US10601649B1 (en) Stack switching detection and provisioning
JP2023527929A (en) Virtual network service deployment method and apparatus
EP4204953A1 (en) Packaging system for deploying computer software