RU2781916C1 - Data modification method in network packet switching - Google Patents

Data modification method in network packet switching Download PDF

Info

Publication number
RU2781916C1
RU2781916C1 RU2022106881A RU2022106881A RU2781916C1 RU 2781916 C1 RU2781916 C1 RU 2781916C1 RU 2022106881 A RU2022106881 A RU 2022106881A RU 2022106881 A RU2022106881 A RU 2022106881A RU 2781916 C1 RU2781916 C1 RU 2781916C1
Authority
RU
Russia
Prior art keywords
cell
data
bit
address
memory area
Prior art date
Application number
RU2022106881A
Other languages
Russian (ru)
Inventor
Михаил Викторович Бадин
Алексей Михайлович Михайлов
Сергей Алексеевич Плотко
Original Assignee
Акционерное общество "Научно-производственное предприятие "Цифровые решения"
Filing date
Publication date
Application filed by Акционерное общество "Научно-производственное предприятие "Цифровые решения" filed Critical Акционерное общество "Научно-производственное предприятие "Цифровые решения"
Application granted granted Critical
Publication of RU2781916C1 publication Critical patent/RU2781916C1/en

Links

Images

Abstract

FIELD: routing systems.
SUBSTANCE: invention relates to the field of building routing systems in network packet switching systems. To achieve the effect, a method for modifying data in network packet switching is proposed, which consists in specifying a mask and a pattern. The data packet to be modified is stored in a memory area with a fixed address space. The package control block is initialized, including the address of the first cell in memory containing the specified data packet, the address A1 of the first data cell to be modified, and the address A2 of the last cell containing the data packet in memory. Initialization of the control blocks of the cell of the memory area containing the specified data packet is performed, and the control blocks of the cell are initialized for each data cell with the address An. Each of the cell control blocks contains a set of two bytes, the first of which contains a mask, and the second - a pattern, moreover, the k-th bit of the mask corresponds to the k-th bit of the pattern.
EFFECT: providing data modification of network packets at the level of individual bytes with a minimum processing delay and high bandwidth, as well as the elimination of vulnerabilities.
1 cl, 4 dwg

Description

Предлагаемый способ относится к области построения систем маршрутизации в системах коммутации сетевых пакетов, а именно к способам обработки данных при маршрутизации, и направлен на решение задачи предварительной модификации данных, передаваемых в составе сетевых пакетов, с целью снижения вычислительной нагрузки на системы глубокого анализа данных при передаче больших объемов данных, передаваемых по сети, а также обеспечения защиты информации путем обезличивания части сетевого трафика и может быть реализован, например, в составе сетевых коммутаторов стандарта Ethernet, поддерживающих стек протокола TCP/IP на базе ПЛИС или СБИС. The proposed method relates to the field of building routing systems in network packet switching systems, namely to methods for processing data during routing, and is aimed at solving the problem of preliminary modification of data transmitted as part of network packets in order to reduce the computational load on deep data analysis systems during transmission large amounts of data transmitted over the network, as well as ensuring information protection by depersonalizing part of the network traffic and can be implemented, for example, as part of Ethernet network switches that support the TCP / IP protocol stack based on FPGA or VLSI.

Достигаемый технический результат - обеспечение модификации данных сетевых пакетов на уровне отдельных байт с минимальной задержкой на обработку и высокой пропускной способностью, а также исключение уязвимости со стороны злоумышленников, действующих по сети.Achievable technical result - providing data modification of network packets at the level of individual bytes with a minimum processing delay and high bandwidth, as well as the exclusion of vulnerabilities from intruders operating over the network.

В настоящее время большинство локальных вычислительных сетей подключено к сети Интернет. Расширение спектра и повышение требований к уровню конфиденциальности требует использования специальных технических средств глубокого анализа данных, передаваемых по сети, а также разграничения доступа к информационным ресурсам.Currently, most local area networks are connected to the Internet. Expanding the range and increasing the requirements for the level of confidentiality requires the use of special technical tools for in-depth analysis of data transmitted over the network, as well as delimiting access to information resources.

Одним из способов снижения вычислительной нагрузки на системы глубокого анализа данных при передаче больших объемов сетевого трафика (более 1,5 Тбит/с) является выполнение предварительной модификации данных в составе передаваемых пакетов, например, заголовков, в узловых коммутаторах вычислительных сетей на уровне отдельных байт.One of the ways to reduce the computational load on deep data analysis systems when transmitting large amounts of network traffic (more than 1.5 Tbps) is to perform preliminary modification of data in the transmitted packets, for example, headers, in the node switches of computer networks at the level of individual bytes.

В существующих пакетных коммутаторах, функционирующих под управлением операционных систем, обработка пакета включает последовательность следующих операций чтения, модификации и записи данных. Данные посредством драйвера сначала загружаются в системную память, которая обычно реализуется на основе DRAM, где они последовательно обрабатываются центральным процессором, и по завершению обработки перегружаются в память сетевого интерфейса, откуда далее передаются потребителю. При этом коммутатором вносится значительная временная задержка, связанная с ограниченной пропускной способностью системной памяти, и в результате не обеспечивается пропускная способность, достаточная для передачи требуемых объемов сетевого трафика (предельно достижимая величина пропускной способности для таких коммутаторов составляет не более 40 Гбит/с). In existing packet switches running operating systems, packet processing includes the sequence of the following operations of reading, modifying and writing data. Data through the driver is first loaded into system memory, which is usually implemented on the basis of DRAM, where they are sequentially processed by the central processor, and upon completion of processing, they are reloaded into the network interface memory, from where they are further transferred to the consumer. In this case, the switch introduces a significant time delay associated with the limited bandwidth of the system memory, and as a result, it does not provide sufficient bandwidth to transfer the required volumes of network traffic (the maximum achievable bandwidth for such switches is no more than 40 Gb / s).

Кроме того, операционные системы, применяемые в коммутаторах, могут потенциально содержать уязвимости, используемые злоумышленниками для нарушения штатного функционирования межсетевого экрана.In addition, the operating systems used in switches can potentially contain vulnerabilities that can be used by attackers to disrupt the proper functioning of the firewall.

Известен способ модификации сетевых пакетов («System for user-space network packet modification»), описанный в патенте US 6,675,218 B1 от 06.01.2004 [1], не имеющий существенных общих признаков с предлагаемым изобретением, но обладающий схожим функциональным назначением.There is a known method for modifying network packets ("System for user-space network packet modification"), described in US patent 6,675,218 B1 dated January 6, 2004 [1], which does not have significant common features with the proposed invention, but has a similar functional purpose.

Основные недостатки данного способа заключаются в том, что он предназначен для реализации в коммутаторах, функционирующих под управлением операционных систем, которые потенциально могут быть подвержены уязвимости. При его практической реализации будут иметь место существенные временные задержки на обработку и пересылку пакетов информации между сетевыми интерфейсами и снижение пропускной способности при передаче больших объемов сетевого трафика.The main disadvantages of this method are that it is intended for implementation in switches running operating systems that can potentially be vulnerable to vulnerabilities. With its practical implementation, there will be significant time delays for processing and forwarding information packets between network interfaces and a decrease in throughput when transmitting large amounts of network traffic.

Также известен способ для эффективного изменения сетевых кадров данных, описанные в патенте US 7,522,621 B2 от 21.04.2009 «Apparatus and method for efficiently modifying network data frames» [2], по функциональному назначению, а также схожести ряда признаков выбранный в качестве прототипа.Also known is a method for effectively modifying network data frames, described in US patent 7,522,621 B2 dated 04/21/2009 "Apparatus and method for efficiently modifying network data frames" [2], according to the functionality, as well as the similarity of a number of features selected as a prototype.

Способ прототипа включает следующие операции: сохранение указанного кадра данных во множестве буферов; создание блока управления кадром, идентифицирующего первый буфер, содержащий указанный кадр данных; создание блока управления буфером для каждого из указанных буферов, содержащих данные, указанный блок управления буфером идентифицирует следующий буфер в последовательности указанных буферов, содержащих данные кадра; изменение данных, по меньшей мере, в двух из указанных блоков управления буфером для идентификации новой последовательности буферов, содержащих кадр данных; изменение данных первого блока управления, который указывает на буфер в указанной последовательности, где данные должны быть удалены, чтобы он указывал на второй блок управления буфером, и чтобы он указывал, что данные указанного буфера заканчиваются в точке удаления удаленных данных; создание второго блока управления буфером, соответствующего пустому буферу, на который указывает указанный первый блок управления буфером и который указывает на буфер, на который ранее указывал первый блок управления.The prototype method includes the following operations: storing the specified data frame in a plurality of buffers; creating a frame control block identifying a first buffer containing said data frame; creating a buffer management unit for each of said buffers containing data, said buffer management unit identifying the next buffer in the sequence of said buffers containing frame data; changing data in at least two of said buffer control blocks to identify a new sequence of buffers containing the data frame; changing the data of a first control block that points to a buffer in a specified sequence where data is to be deleted to point to a second buffer control block and to indicate that the data of said buffer ends at a point where the deleted data is deleted; creating a second buffer control block corresponding to the empty buffer pointed to by said first buffer control block and which points to the buffer previously pointed to by the first control block.

Способ прототипа также дополнительно включает модификацию данных кадра для удаления данных, хранящихся в одном из указанных буферов, а также модификацию данных кадра путем включения дополнительных данных, хранящихся в дополнительном буфере, посредством включения дополнительных этапов: изменения данных в одном из указанных блоков управления буфером для идентификации указанного дополнительного буфера; создания нового блока управления для идентификации буфера, ранее идентифицированного в указанном модифицированном блоке управления буфером и создание новой последовательности буферов, включающей указанный дополнительный буфер.The prototype method also further includes modifying the frame data to remove data stored in one of the specified buffers, as well as modifying the frame data by including additional data stored in the additional buffer by including additional steps: changing the data in one of the specified buffer control blocks for identification specified additional buffer; creating a new control block to identify the buffer previously identified in said modified buffer control block and creating a new buffer sequence including said additional buffer.

Как описано в [2], пакеты в рассматриваемом прототипе модифицируются путем внесения соответствующих изменений в блоки управления, без копирования и модификации самих данных. Изменяя определенные блоки управления, можно связать данные с кадром данных, а также удалить данные, хранящиеся в буферах, из кадра без необходимости копировать, перемещать или изменять сами сохраненные данные [2]. Всего предусмотрены следующие виды модификация пакетов [2]: вставка в один пакет другого пакета данных, удаление из пакета данных входящего в него пакета, объединения множества пакетов в один или разделения пакета на множество составных пакетов. As described in [2], the packages in the prototype under consideration are modified by making appropriate changes to the control blocks, without copying and modifying the data itself. By changing certain control blocks, it is possible to associate data with a data frame, as well as remove data stored in buffers from a frame without the need to copy, move or change the stored data itself [2]. In total, the following types of package modification are provided [2]: inserting another data package into one package, deleting a package included in it from the data package, combining multiple packages into one or dividing the package into many composite packages.

В прототипе [2] обеспечивается минимальная задержка на фильтрацию данных кадра. Однако это достигается за счет того, что в нем модификация данных выполняется только на уровне пакетов и отсутствует возможность ее модификации на уровне отдельных байт, что необходимо для систем глубокого анализа данных. Данное свойство является основным существенным недостатком рассматриваемого прототипа.The prototype [2] provides the minimum delay for filtering frame data. However, this is achieved due to the fact that in it data modification is performed only at the packet level and there is no possibility of its modification at the level of individual bytes, which is necessary for deep data analysis systems. This property is the main significant drawback of the considered prototype.

Недостатки, присущие рассмотренным прототипам, преодолены в предлагаемом способе модификации данных при сетевой пакетной коммутации, который заключатся в том, что в способ, содержащий признаки прототипа: сохранение пакета данных, подлежащих модификации, в области памяти, инициализацию блока управления пакетом, включающего адрес первой ячейки в упомянутой области памяти, содержащей указанный пакет данных, инициализацию блоков управления ячейкой упомянутой области памяти, содержащей указанный пакет данных, включены новые признаки: каждая из ячеек упомянутой области памяти содержит один байт пакета данных, блок управления пакетом дополнительно содержит адрес A1 первой ячейки данных, подлежащих модификации, а также адрес A2 последней ячейки, содержащей указанный пакет данных в упомянутой области памяти, блоки управления ячейкой инициализируются для каждой ячейки данных c адресом Аn, в упомянутой области памяти, который изменяется в диапазоне от A1 до A2 включительно, каждый из блоков управления ячейкой содержит набор из двух байт, первый из которых содержит маску, а второй - паттерн, причем, k-му биту маски соответствует k-й бит паттерна, модификация данных в каждой ячейке с адресом An в упомянутой области памяти, осуществляется по правилу: если k-й бит маски в блоке управления ячейкой, соответствующем данной ячейке, равен «1», то k-й бит данной ячейки устанавливается равным k-му биту паттерна в блоке управления ячейкой, соответствующем данной ячейке, а если k-й бит маски в блоке управления ячейкой, соответствующем данной ячейке, равен «0», то k-й бит данной ячейки не подвергается модификации, измененный пакет данных дополняется контрольной суммой, вычисляемой по алгоритму CRC-32 в соответствии со стандартом IEEE 802.3 и доставляется получателю, причем блок управления пакетом и блоки управления ячейкой задаются оператором посредством не связанного с сетью конфигурационного интерфейса и остаются неизменными для каждого пакета данных, подлежащих модификации, а модификация данных в каждой ячейке в упомянутой области памяти, вычисление контрольной последовательности и дополнение ей данных, доставляемых получателю, выполняется аппаратно на основе жесткой логики.The disadvantages inherent in the considered prototypes are overcome in the proposed method for modifying data in network packet switching, which consists in the fact that in a method containing the features of the prototype: saving the data packet to be modified in the memory area, initializing the packet control unit, including the address of the first cell in the mentioned memory area containing the specified data packet, the initialization of the control blocks of the cell of the mentioned memory area containing the specified data packet, new features are included: each of the cells of the mentioned memory area contains one byte of the data packet, the package control block additionally contains the address A1 of the first data cell, subject to modification, as well as the address A2 of the last cell containing the specified data packet in the mentioned memory area, the cell control blocks are initialized for each data cell with the address An, in the mentioned memory area, which varies in the range from A1 to A2 inclusive, each of the control blocks cell contains a set of two bytes, the first of which contains a mask, and the second - a pattern, moreover, the k -th bit of the mask corresponds to the k -th bit of the pattern, the modification of data in each cell with the address An in the mentioned memory area is carried out according to the rule: if the k -th bit of the mask in the cell control block corresponding to this cell is "1", then the k -th bit of this cell is set equal to the k -th bit of the pattern in the cell control block corresponding to this cell, and if the k -th bit of the mask in the cell control block corresponding to this cell is "0", then the k -th bit of this cell is not modified, the modified data packet is supplemented with a checksum calculated using the CRC-32 algorithm in accordance with the IEEE 802.3 standard and delivered to the recipient, and the block packet control and cell control blocks are set by the operator through a non-networked configuration interface and remain unchanged for each data packet to be modified, and modi fication of data in each cell in the mentioned memory area, calculation of the check sequence and addition of the data delivered to the recipient with it, is performed by hardware based on hard logic.

Следовательно, предлагаемый способ удовлетворяет критерию «новизна».Therefore, the proposed method satisfies the criterion of "novelty".

Сравнение с другими техническими решениями показывает, что предлагаемый способ обладает признаками, позволяющими достичь обеспечения модификации данных пакетов на уровне отдельных байт в составе сетевых коммутаторов, например, стандарта Ethernet, поддерживающих стек протокола TCP/IP. Comparison with other technical solutions shows that the proposed method has features that make it possible to achieve modification of data packets at the level of individual bytes as part of network switches, for example, the Ethernet standard that supports the TCP/IP protocol stack.

Поскольку реализация предлагаемого способа осуществляется аппаратно, на основе жесткой логики, без применения операционной системы и центрального процессора, сетевые коммутаторы, в составе которых он будет реализован, будут обладать минимальной задержкой на обработку данных и высокой пропускная способностью, а с учетом того, что маска и паттерн в блоках управления ячейками задаются оператором посредством не связанного с сетью доверенного интерфейса, исключается возможность вмешательства в работу средств модификации данных со стороны сети. Since the implementation of the proposed method is carried out in hardware, based on rigid logic, without the use of an operating system and a central processor, the network switches in which it will be implemented will have a minimum delay in data processing and high bandwidth, and taking into account the fact that the mask and the pattern in the cell control blocks is set by the operator through a trusted interface not connected to the network, the possibility of interference in the operation of data modification tools from the network is excluded.

Изобретение поясняется следующими графическими материалами:The invention is illustrated by the following graphics:

фиг. 1 - Схема, поясняющая заявляемый способ модификации данных при сетевой пакетной коммутации;fig. 1 - Scheme explaining the claimed method of data modification in network packet switching;

фиг. 2 - Функциональная схема сетевого коммутатора, реализующего заявляемый способ;fig. 2 - Functional diagram of a network switch that implements the proposed method;

фиг. 3 - Структурная схема - пример аппаратной реализации блока модификации данных;fig. 3 - Structural diagram - an example of hardware implementation of the data modification block;

фиг. 4 - Пример обработки данных, поясняющий заявляемый способ.fig. 4 - An example of data processing, explaining the claimed method.

Способ модификации данных при сетевой пакетной коммутации (фиг. 1) заключается в том, что оператором через не связанный с сетью доверенный конфигурационный интерфейс загружаются маска и паттерн, сохраняются в памяти коммутатора и остаются неизменными для всех передаваемых пакетов, до тех пор, пока они не будут изменены оператором. The data modification method for network packet switching (Fig. 1) is that the operator loads the mask and pattern through a trusted configuration interface that is not connected to the network, stores it in the switch memory and remains unchanged for all transmitted packets until they are will be changed by the operator.

Пакет данных, подлежащий модификации, сохраняется в области памяти коммутатора с фиксированным адресным пространством, причем каждая из ячеек упомянутой области памяти содержит один байт пакета данных. The data packet to be modified is stored in a memory area of the switch with a fixed address space, each of the cells of said memory area containing one byte of the data packet.

Выполняется инициализация блока управления пакетом, включающего адрес A0 первой ячейки в упомянутой области памяти, содержащей указанный пакет данных, адрес A1 первой ячейки данных, подлежащих модификации, а также адрес A2 последней ячейки, содержащей указанный пакет данных в упомянутой области памяти.The package control block is initialized, including the address A0 of the first cell in the mentioned memory area containing the specified data packet, the address A1 of the first data cell to be modified, and the address A2 of the last cell containing the specified data packet in the mentioned memory area.

Выполняется инициализация блоков управления ячейкой упомянутой области памяти, содержащей указанный пакет данных, причем блоки управления ячейкой инициализируются для каждой ячейки данных c адресом Аn, в упомянутой области памяти (адрес Аn изменяется в диапазоне от A1 до A2 включительно). Каждый из блоков управления ячейкой содержит набор из двух байт, первый из которых содержит маску, а второй - паттерн, причем, k-му биту маски соответствует k-й бит паттерна.The cell control blocks of the mentioned memory area containing the specified data packet are initialized, and the cell control blocks are initialized for each data cell with the address An in the mentioned memory area (the address An varies in the range from A1 to A2 inclusive). Each of the cell control blocks contains a set of two bytes, the first of which contains a mask, and the second - a pattern, moreover, the k -th bit of the mask corresponds to the k -th bit of the pattern.

Модификация данных в каждой ячейке с адресом An в упомянутой области памяти, осуществляется по правилу: если k-й бит маски в блоке управления ячейкой, соответствующем данной ячейке, равен «1», то k-й бит данной ячейки устанавливается равным k-му биту паттерна в блоке управления ячейкой, соответствующем данной ячейке, а если k-й бит маски в блоке управления ячейкой, соответствующем данной ячейке, равен «0», то k-й бит данной ячейки не подвергается модификации. Modification of data in each cell with the address An in the mentioned memory area is carried out according to the rule: if the k -th bit of the mask in the cell control block corresponding to this cell is "1", then the k -th bit of this cell is set equal to the k -th bit pattern in the cell control block corresponding to this cell, and if the k -th bit of the mask in the cell control block corresponding to this cell is "0", then the k -th bit of this cell is not modified.

Модифицированный пакет данных дополняется контрольной суммой, вычисляемой по алгоритму CRC-32 в соответствии со стандартом IEEE 802.3 [3] и доставляется получателю.The modified data packet is supplemented with a checksum calculated using the CRC-32 algorithm in accordance with the IEEE 802.3 standard [3] and delivered to the recipient.

Модификация данных в каждой ячейке в упомянутой области памяти, вычисление контрольной последовательности и дополнение ей данных, доставляемых получателю, выполняется аппаратно на основе жесткой логики.Modification of the data in each cell in the mentioned memory area, calculation of the check sequence and addition of the data delivered to the recipient with it, is performed by hardware based on hard logic.

Подлежащий модификации и модифицированный пакеты могут иметь формат в соответствии с используемым в коммутаторе сетевым протоколом, например, IEEE 802.3 [3].The packets to be modified and the modified packets can be formatted according to the network protocol used in the switch, for example, IEEE 802.3 [3].

Количество блоков управления ячейкой, включающих маску и паттерн, определяется количеством ячеек памяти, подлежащих модификации (равно разности А2 и A1), ограничивается объемом памяти, используемой в сетевом коммутаторе и при использовании протокола IEEE 802.3 может находиться в пределах от 8 до 16000 байт.The number of cell control blocks, including mask and pattern, is determined by the number of memory cells to be modified (equal to the difference between A2 and A1 ), is limited by the amount of memory used in the network switch, and when using the IEEE 802.3 protocol, can be in the range from 8 to 16000 bytes.

Адреса A1, А0, А2 остаются постоянными для модифицируемых пакетов и могут, например, задаваться, оператором через не связанный с сетью доверенный конфигурационный интерфейс.AddressesA1,A0,A2remain constant for modifiable packages and may, for example, be set by the operator via a non-network-related, trusted configuration interface.

Длина контрольной последовательности, вычисляемой с использованием алгоритма CRC-32 в соответствии со стандартом сетевого протокола IEEE 802.3, равна 4 байтам.The length of the check sequence calculated using the CRC-32 algorithm in accordance with the IEEE 802.3 network protocol standard is 4 bytes.

Заявляемый способ может быть аппаратно реализован в виде устройства, включающего последовательно соединенные: входной сетевой интерфейс, блок памяти для хранения модифицируемых пакетов, блок модификации данных, блок вычисления и добавления контрольной суммы, выходной сетевой интерфейс, последовательно соединенные конфигурационный интерфейс и блок памяти для хранения набора блоков управления ячейками, выход которого соединен со входом блока модификации для загрузки маски и паттерна, а также включающего блок управления пакетом, адресный выход которого соединен с адресным входом блока памяти для хранения модифицируемых пакетов, а выход сигнала разрешения модификации соединен с одноименным входом блока модификации данных.The claimed method can be implemented in hardware in the form of a device that includes serially connected: an input network interface, a memory unit for storing modified packets, a data modification unit, a unit for calculating and adding a checksum, an output network interface, a serially connected configuration interface and a memory unit for storing a set cell control blocks, the output of which is connected to the input of the modification block for loading the mask and pattern, and also includes a package control block, the address output of which is connected to the address input of the memory block for storing modified packages, and the output of the modification enable signal is connected to the input of the data modification block of the same name .

Устройство функционирует следующим образом. Набор блоков управления ячейками загружается оператором через не связанный с сетью конфигурационный интерфейс и сохраняется в блоке памяти для хранения блоков управления ячейками.The device functions as follows. A set of cell control blocks is loaded by the operator through a non-networked configuration interface and stored in a memory block for storing cell control blocks.

Модифицируемый пакет данных подается через входной сетевой интерфейс и загружается в область памяти блока памяти для хранения модифицируемых пакетов. Текущий, начальный и конечный адреса упомянутой области памяти, An, А0 и А2 соответственно, а также адрес первой ячейки данных, подлежащих модификации, A1 формируются блоком управления пакетом.Modifiable data packet is fed through the input network interface and loaded into the memory area of the memory block for storing modified packets. The current, starting and ending addresses of said memory area, An , A0 and A2 , respectively, as well as the address of the first data cell to be modified, A1 , are formed by the packet control unit.

После окончания загрузки модифицируемого пакета данных, последний начинает побайтно выгружаться. В это время в освобождающуюся область памяти загружается следующий модифицируемый пакет.After the download of the modified data packet is completed, the latter begins to be unloaded byte by byte. At this time, the next modifiable package is loaded into the freed memory area.

Во время выгрузки данных из ячеек памяти для хранения модифицируемых пакетов с адресом с А1 по А2, в блок модификации из блока памяти для хранения блоков управления ячейками подаются маска и паттерн. During the unloading of data from memory cells for storing modified packets with addresses from A1 to A2 , a mask and a pattern are supplied to the modification block from the memory block for storing cell control blocks.

Блок модификации данных функционирует следующим образом: если данные пакета поступают из ячейки памяти для хранения модифицируемых пакетов с адресом An, причем An находится в диапазоне от A0 до (А1-1), то указанные данные не модифицируются; если данные пакета поступают из ячейки памяти для хранения модифицируемых пакетов с адресом An, причем An находится в диапазоне от A1 до А2, то указанные данные модифицируются по правилу: если k-й бит маски, соответствующей ячейке с адресом An, равен «1», то k-й бит указанных данных устанавливается равным k-му биту паттерна, соответствующего ячейке с адресом An, а если k-й бит маски, соответствующей ячейке с адресом An, равен «0», то k-й бит указанных данных не подвергается модификации. The data modification block functions as follows: if the packet data comes from the memory location for storing modified packets with address An , and An is in the range from A0 to ( A1-1 ), then the indicated data is not modified; if the packet data comes from a memory cell for storing modified packets with the address An , and An is in the range from A1 to A2 , then the specified data is modified according to the rule: if the k -th bit of the mask corresponding to the cell with the address An is "1", then the k -th bit of the specified data is set equal to the k -th bit of the pattern corresponding to the cell with the address An , and if the k -th bit of the mask corresponding to the cell with the address An is "0", then the k -th bit of the specified data is not modified .

К данным, снимаемым с выхода блока модификации, в соответствующем блоке добавляется контрольная сумма, вычисленная по ним в соответствии с протоколом IEEE 802.3, после чего пакет выдается потребителю через выходной сетевой интерфейс.To the data taken from the output of the modification block, a checksum is added in the corresponding block, calculated from them in accordance with the IEEE 802.3 protocol, after which the packet is issued to the consumer through the output network interface.

Блок памяти для хранения модифицируемых пакетов должен обеспечивать одновременное чтение/запись из ячеек с различными адресами, и может быть реализован, например, в виде двухпортового статического оперативного запоминающего устройства. The memory block for storing modifiable packets must provide simultaneous reading/writing from cells with different addresses, and can be implemented, for example, in the form of a two-port static RAM.

Объем указанного блока оперативной памяти определяется длиной модифицируемого пакета. Например, при использовании протокола IEEE 802.3 объем оперативной памяти для хранения модифицируемых пакетов должен составлять не менее 16000 байт. The volume of the specified RAM block is determined by the length of the package being modified. For example, when using the IEEE 802.3 protocol, the amount of RAM for storing modified packages must be at least 16000 bytes.

Блок памяти для хранения блоков управления ячейками может быть, например, статическим оперативным запоминающим устройством.The memory block for storing cell control blocks may be, for example, static random access memory.

Объем блока памяти для хранения блоков управления ячейками определяется объемом модифицируемых данных. The size of the memory block for storing cell control blocks is determined by the amount of data being modified.

Входной и выходной сетевые интерфейсы коммутатора могут быть, например, стандарта Ethernet.The input and output network interfaces of the switch can be, for example, the Ethernet standard.

В качестве конфигурационного интерфейса, в зависимости от элементной базы, на основе которой реализовано рассматриваемое устройство, может быть использован любой цифровой интерфейс, например, JTAG.As a configuration interface, depending on the element base on the basis of which the device in question is implemented, any digital interface, for example, JTAG, can be used.

Блок дополнения контрольной последовательностью является стандартным устройством, реализованном в сетевых коммутаторах, функционирующих в соответствии со стандартом IEEE 802.3.The check sequence padding block is a standard device implemented in network switches operating in accordance with the IEEE 802.3 standard.

Блок управления пакетом выполняет следующие функции: формирование адресов в блоке памяти для хранения модифицируемых пакетов для загрузки и выгрузки из него модифицируемых данных; хранение адресов: первой ячейки, подлежащих модификации (A1), первой (А0) и последней (А2) ячеек памяти, содержащей модифицируемый пакет данных; выработку сигнала разрешения модификации данных и может быть реализован, например, в виде цифрового логического автомата.The package control block performs the following functions: generating addresses in the memory block for storing modifiable packages for loading and unloading modifiable data from it; storage of addresses: the first cell to be modified (A1), first (A0) and last (A2) memory cells containing the modified data packet; generating a data modification enable signal and can be implemented, for example, in the form of a digital logic machine.

Блок модификации данных может быть реализован в виде цифрового логического устройства (фиг. 3), имеющего входы: шину для подачи данных модифицируемого пакета, шину для подачи маски, шину для подачи паттерна, вход для подачи сигнала разрешения модификации данных, и выход - шину для снятия байт данных модифицированного пакета, и состоящего из восьми одноразрядных мультиплексоров (SW0,, SW7), каждый из которых имеет по два одноразрядных входа данных (P0, D0),…, (P7, D7), по одному одноразрядному входу адреса (M0,M7) и одному одноразрядному выходу (D’0,D’7), и одного восьмиразрядного мультиплексора (SW8) с двумя восьмиразрядными входами данных (D’, D), восьмиразрядным выходом Out и одноразрядным входом адреса En, выходы одноразрядных мультиплексоров (D’0,D’7) объединены в общую шину, которая поразрядно подсоединена к первому входу данных (D’) восьмиразрядного мультиплексора (SW8), второй вход данных (D) восьмиразрядного мультиплексора (SW8) и вторые входы (D0,D7) каждого из восьми одноразрядных мультиплексоров (SW0,, SW7) поразрядно объединены между собой и являются входной шиной для подачи данных модифицируемого пакета блока модификации, а первые входы (P0,P7) одноразрядных мультиплексоров (SW0,, SW7) объединены в общую шину, которая являются входной шиной для подачи паттерна блока модификации данных, адресные входы (M0,M7) одноразрядных мультиплексоров (SW0,, SW7) объединены в общую шину, которая является входной шиной для подачи маски блока модификации данных, выход восьмиразрядного мультиплексора (SW8) является выходной шиной блока модификации, с которой снимаются данные модифицированного пакета, а адресный вход (En) восьмиразрядного мультиплексора (SW8) является входом для подачи сигнала разрешения блока модификации данных, причем каждый из указанных мультиплексоров (SW0,, SW8) выдает на свой выход данные со своего первого входа, когда сигнал на его адресном входе равен «1» и со своего второго входа - в противном случае.The data modification block can be implemented as a digital logic device (Fig. 3) having inputs: a bus for supplying data of a modified packet, a bus for supplying a mask, a bus for supplying a pattern, an input for supplying a data modification enable signal, and an output - a bus for removing the data bytes of the modified packet, and consisting of eight single-bit multiplexers (SW0,, SW7), each of which has two one-bit data inputs (P0, D0),…, (P7, D7), one single-bit address input (M0,M7) and one single-bit output (D'0,D'7), and one eight-bit multiplexer (SW8) with two eight-bit data inputs (D', D), eight-bit outputOut and a one-bit input of the address En, the outputs of one-bit multiplexers (D'0,D'7) are combined into a common bus, which is bit-by-bit connected to the first data input (D') eight-bit multiplexer (SW8), the second data input (D) eight-bit multiplexer (SW8) and second inputs (D0,D7) of each of the eight single-bit multiplexers (SW0,, SW7) are bit-wise combined with each other and are the input bus for supplying data of the modified package of the modification block, and the first inputs (P0,P7) single-bit multiplexers (SW0,, SW7) are combined into a common bus, which is the input bus for supplying the pattern of the data modification block, address inputs (M0,M7) single-bit multiplexers (SW0,, SW7) are combined into a common bus, which is the input bus for supplying the data modification block mask, the output of an eight-bit multiplexer (SW8) is the output bus of the modification block, from which the data of the modified package is taken, and the address input (En) eight-bit multiplexer (SW8) is the input for the enable signal of the data modification block, and each of the specified multiplexers (SW0,, SW8) outputs data at its output from its first input when the signal at its address input is "1" and from its second input otherwise.

Данные пакетов поступают в блок модификации побайтно и последовательно. Когда данные поступают из ячеек оперативной памяти для хранения модифицируемых пакетов с адресом в диапазоне от A0 до (А1-1), сигналу разрешения модификации данных присваивается значение «0», и восьмиразрядный мультиплексор (SW8) передает байты модифицируемого пакета со входа на выход блока модификации данных без изменений. Когда данные пакета поступают из ячеек оперативной памяти для хранения модифицируемых пакетов с адресом в диапазоне от A1 до А2, сигналу разрешения модификации данных присваивается значение «1», и восьмиразрядный мультиплексор (SW8) переключается на выдачу на выход блока модификации данных, снимаемых с выходов (D’0,D’7) восьми одноразрядных мультиплексоров (SW0,, SW7), каждый из которых управляется соответствующим k-м битом маски на входах (M0,M7), в зависимости от значения которого на выход соответствующего одноразрядного мультиплексора выдается либо k-й бит паттерна (при k-м битом маски равном «1»), либо k-й бит обрабатываемого байта данных модифицируемого пакета.Packet data enters the modification block byte by byte and sequentially. When data is received from the memory cells for storing modifiable packets with an address in the range from A0 to (A1-1), the data modification enable signal is set to "0", and the eight-bit multiplexer ( SW8 ) transfers the bytes of the modifiable package from the input to the output of the modification block data unchanged. When the packet data comes from the RAM for storing modified packets with an address in the range from A1 to A2, the data modification enable signal is set to "1", and the eight-bit multiplexer ( SW8 ) switches to output the modification block of data taken from the outputs ( D'0, ... D'7 ) of eight one-bit multiplexers ( SW0, ... , SW7 ), each of which is controlled by the corresponding k-th bit of the mask at the inputs ( M0, ... M7 ), depending on the value of which, the output of the corresponding one-bit multiplexer is given either the k-th bit of the pattern (with the k-th bit of the mask equal to "1"), or the k-th bit of the processed data byte of the modified packet.

Использованные источникиUsed sources

1. Патент US 6,675,218 B1 от 06.01.2004. System for user-space network packet modification.1. Patent US 6,675,218 B1 dated 01/06/2004. System for user-space network packet modification.

2. Патент US 7,522,621 B2 от 21.04.2009. Apparatus and method for efficiently modifying network data frames. 2. Patent US 7,522,621 B2 dated April 21, 2009. Apparatus and method for efficiently modifying network data frames.

3. IEEE Std 802.3-2012. IEEE Standard for Ethernet (https://standards.ieee.org/ieee/802.3/5084/).3. IEEE Std 802.3-2012. IEEE Standard for Ethernet (https://standards.ieee.org/ieee/802.3/5084/).

Claims (1)

Способ модификации данных при сетевой пакетной коммутации, содержащий: сохранение пакета данных, подлежащего модификации, в области памяти, инициализацию блока управления пакетом, включающего адрес первой ячейки в упомянутой области памяти, содержащей указанный пакет данных, инициализацию блоков управления ячейкой упомянутой области памяти, содержащей указанный пакет данных, отличающийся тем, что каждая из ячеек упомянутой области памяти содержит один байт пакета данных, блок управления пакетом дополнительно содержит адрес A1 первой ячейки данных, подлежащих модификации, а также адрес A2 последней ячейки, содержащей указанный пакет данных в упомянутой области памяти, блоки управления ячейкой инициализируются для каждой ячейки данных c адресом Аn в упомянутой области памяти, который изменяется в диапазоне от A1 до A2 включительно, каждый из блоков управления ячейкой содержит набор из двух байт, первый из которых содержит маску, а второй - паттерн, причем k-му биту маски соответствует k-й бит паттерна, модификация данных в каждой ячейке с адресом An в упомянутой области памяти осуществляется по правилу: если k-й бит маски в блоке управления ячейкой, соответствующем данной ячейке, равен «1», то k-й бит данной ячейки устанавливается равным k-му биту паттерна в блоке управления ячейкой, соответствующем данной ячейке, а если k-й бит маски в блоке управления ячейкой, соответствующем данной ячейке, равен «0», то k-й бит данной ячейки не подвергается модификации, измененный пакет данных дополняется контрольной суммой, вычисляемой по алгоритму CRC-32 в соответствии со стандартом IEEE 802.3 и доставляется получателю, причем блок управления пакетом и блоки управления ячейкой задаются оператором посредством не связанного с сетью конфигурационного интерфейса и остаются неизменными для каждого пакета данных, подлежащих модификации, а модификация данных в каждой ячейке в упомянутой области памяти, вычисление контрольной последовательности и дополнение ей данных, доставляемых получателю, выполняется аппаратно на основе жесткой логики.A method for modifying data in network packet switching, comprising: storing a data packet to be modified in a memory area, initializing a packet control block that includes the address of the first cell in the said memory area containing the specified data packet, initializing control blocks for a cell of the said memory area containing the specified a data packet, characterized in that each of the cells of the said memory area contains one byte of the data packet, the packet control block additionally contains the address A1 of the first data cell to be modified, as well as the address A2 of the last cell containing the specified data packet in the said memory area, blocks cell controls are initialized for each data cell with address An in the mentioned memory area, which varies in the range from A1 to A2 inclusive, each of the cell control blocks contains a set of two bytes, the first of which contains a mask, and the second - a pattern, and k- th bit of the mask corresponds to k- th bit of the pattern, data modification in each cell with the address An in the mentioned memory area is carried out according to the rule: if the k-th bit of the mask in the cell control block corresponding to this cell is “1”, then the k-th bit of this cell is set equal to k the -th bit of the pattern in the cell control block corresponding to this cell, and if the k-th bit of the mask in the cell control block corresponding to this cell is "0", then the k-th bit of this cell is not modified, the modified data packet is supplemented with a control the amount calculated by the CRC-32 algorithm in accordance with the IEEE 802.3 standard and delivered to the recipient, with the packet control unit and cell control units being set by the operator through a configuration interface not connected to the network and remain unchanged for each data packet to be modified, and the data modification in each cell in the mentioned memory area, calculation of the control sequence and addition to it of the data delivered by the received telya, is performed by hardware based on hard logic.
RU2022106881A 2022-03-16 Data modification method in network packet switching RU2781916C1 (en)

Publications (1)

Publication Number Publication Date
RU2781916C1 true RU2781916C1 (en) 2022-10-20

Family

ID=

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5191582A (en) * 1991-08-14 1993-03-02 Transwitch Corporation Method and apparatus for the high speed modification of a packet address field of a transmitted packet in a frame relay system
US7522621B2 (en) * 2005-01-06 2009-04-21 International Business Machines Corporation Apparatus and method for efficiently modifying network data frames
US20110310901A1 (en) * 2010-02-16 2011-12-22 Nec Corporation Packet forwarding apparatus, communication system, process rule update method, and program
RU2628477C2 (en) * 2012-12-19 2017-08-17 Нек Корпорейшн Package processing device, method of configuring stream entry and program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5191582A (en) * 1991-08-14 1993-03-02 Transwitch Corporation Method and apparatus for the high speed modification of a packet address field of a transmitted packet in a frame relay system
US7522621B2 (en) * 2005-01-06 2009-04-21 International Business Machines Corporation Apparatus and method for efficiently modifying network data frames
US20110310901A1 (en) * 2010-02-16 2011-12-22 Nec Corporation Packet forwarding apparatus, communication system, process rule update method, and program
RU2628477C2 (en) * 2012-12-19 2017-08-17 Нек Корпорейшн Package processing device, method of configuring stream entry and program

Similar Documents

Publication Publication Date Title
JP3734704B2 (en) Packet classification engine
US9639501B1 (en) Apparatus and methods to compress data in a network device and perform ternary content addressable memory (TCAM) processing
US7643505B1 (en) Method and system for real time compression and decompression
US20050171937A1 (en) Memory efficient hashing algorithm
US7650429B2 (en) Preventing aliasing of compressed keys across multiple hash tables
US8085780B1 (en) Optimized buffer loading for packet header processing
WO2012138521A1 (en) Systems and methods for in-line removal of duplicate network packets
JP2003508954A (en) Network switch, components and operation method
US9306851B1 (en) Apparatus and methods to store data in a network device and perform longest prefix match (LPM) processing
CN110928483A (en) Data storage method, data acquisition method and equipment
US20070261110A1 (en) Packet firewalls of particular use in packet switching devices
US11316804B2 (en) Forwarding entry update method and apparatus in a memory
CN111614580B (en) Data forwarding method, device and equipment
US5684962A (en) Context control block for computer communications
US20040025105A1 (en) CRC calculation system for a packet arriving on an n-byte wide bus and a method of calculation thereof
US6870849B1 (en) Apparatus and method for efficient hashing in networks
CN112425131A (en) ACL rule classification method, ACL rule search method and ACL rule classification device
CN115941598A (en) Flow table semi-uninstalling method, device and medium
EP3720068A1 (en) Message processing method and device
RU2781916C1 (en) Data modification method in network packet switching
US9703484B2 (en) Memory with compressed key
CN100499564C (en) Packet processing engine
US20160105363A1 (en) Memory system for multiple clients
US11436172B2 (en) Data frame interface network device
CN110704419A (en) Data structure, data indexing method, device and equipment, and storage medium