RU2779135C1 - Method for dynamic filtering of network packets by sessions - Google Patents

Method for dynamic filtering of network packets by sessions Download PDF

Info

Publication number
RU2779135C1
RU2779135C1 RU2022110253A RU2022110253A RU2779135C1 RU 2779135 C1 RU2779135 C1 RU 2779135C1 RU 2022110253 A RU2022110253 A RU 2022110253A RU 2022110253 A RU2022110253 A RU 2022110253A RU 2779135 C1 RU2779135 C1 RU 2779135C1
Authority
RU
Russia
Prior art keywords
packet
session
information
packets
address
Prior art date
Application number
RU2022110253A
Other languages
Russian (ru)
Inventor
Михаил Викторович Бадин
Алексей Михайлович Михайлов
Сергей Алексеевич Плотко
Original Assignee
Акционерное общество "Научно-производственное предприятие "Цифровые решения"
Filing date
Publication date
Application filed by Акционерное общество "Научно-производственное предприятие "Цифровые решения" filed Critical Акционерное общество "Научно-производственное предприятие "Цифровые решения"
Application granted granted Critical
Publication of RU2779135C1 publication Critical patent/RU2779135C1/en

Links

Images

Abstract

FIELD: network packets dynamic filtering.
SUBSTANCE: invention relates to the methods for dynamic filtering of network packets. To resolve collisions that occur when tracking a session based on a HASH sum, one RAM cell contains records with information about four sessions. The information includes the destination IP address, the source IP address, the L4 protocol code, the destination port, the source port, the time the last session packet was received, and the code for the action to be performed on the packet. Next, the HASH sum is transmitted to the session tracking unit (106), which checks the address in the RAM memory cell, which is equal to the HASH sum, the presence of information consisting of packet header fields, which were used to calculate the HASH sum of the already received packet with such the same HASH sum, while the counter of the number of packets in the session is increased by 1 packet. If the RAM cell already contains information about the session, then it is compared with the data from the packet descriptor. If the information matches and the packet does not contain the SYN flag in the TCP header, then the packet is considered to belong to an already existing session and the action identifier stored in this RAM memory cell is added to the packet descriptor, which is an 8-bit number based on which the filter block performs packet filtering. If the information matches, but the packet contains the SYN flag in the TCP header, then a new session identifier is assigned and information about the current packet is entered into the RAM memory cell. If the information does not match, then the other three records about other sessions are checked in the same way; if there is no match, a new record is created in the RAM-memory cell.
EFFECT: invention improves throughput and performance.
1 cl, 4 dwg

Description

Изобретение относится к области построения систем мониторинга и анализа сетей передачи данных, а именно к методам высокоскоростного поиска и отслеживания TCP/UDP сессий в высоконагруженных сетях (TCP/IP – сетевая модель передачи данных, представленных в цифровом виде) и может быть использовано в устройствах предварительной обработки для систем глубокого анализа сетевого трафика, в частности брокерах сетевых пакетов, поддерживающих стек протоколов TCP/IP, а также в устройствах на базе программируемой логической интегральной схемы (ПЛИС) или сверхбольшой интегральной схемы (СБИС). Одним из ключевых способов, позволяющих повысить производительность систем глубокого анализа сетевого трафика, является выделение заголовка пакета, передача на обработку и сравнение только требуемых полей заголовков пакета. При этом весь пакет сохраняется в пакетном буфере и передается в порт, определенный в результате анализа заголовка.The invention relates to the field of building systems for monitoring and analyzing data transmission networks, and in particular to methods for high-speed search and tracking of TCP / UDP sessions in high-load networks (TCP / IP - a network model for transmitting data presented in digital form) and can be used in devices for preliminary processing for systems of deep analysis of network traffic, in particular, network packet brokers that support the TCP / IP protocol stack, as well as in devices based on a programmable logic integrated circuit (FPGA) or very large integrated circuit (VLSI). One of the key ways to improve the performance of systems for deep analysis of network traffic is to extract the packet header, transfer for processing and compare only the required fields of the packet headers. In this case, the entire packet is stored in the packet buffer and transmitted to the port determined as a result of header analysis.

Брокеры сетевых пакетов – специализированные устройства, которые нашли наибольшее применение в системах информационной безопасности. Правила распределения и агрегации трафика в брокерах сетевых пакетов полностью определяются настройками, в них нет стандартов построения таблиц пересылки (MAC-таблиц) и протоколов обмена с другими коммутаторами (типа STP), а поэтому диапазон возможных настроек и понимаемых полей в них гораздо шире.Network packet brokers are specialized devices that have found the greatest use in information security systems. The rules for distribution and aggregation of traffic in network packet brokers are completely determined by the settings, they do not have standards for building forwarding tables (MAC tables) and exchange protocols with other switches (such as STP), and therefore the range of possible settings and understandable fields in them is much wider.

Брокер может равномерно распределить трафик из одного или нескольких входных портов на заданный диапазон выходных портов. Можно задать правила на копирование, фильтрацию, классификацию, дедупликацию и модификацию трафика. Данные правила можно применять к разным группам входных портов брокера сетевых пакетов, а также применять последовательно друг за другом в самом устройстве. A broker can evenly distribute traffic from one or more input ports to a given range of output ports. You can set rules for copying, filtering, classifying, deduplicating and modifying traffic. These rules can be applied to different groups of input ports of the network packet broker, as well as applied sequentially one after the other in the device itself.

Заявленный способ динамической фильтрации сетевых пакетов направлен на обеспечение функции фильтрации сетевых пакетов с учетом принадлежности к сессиям протоколов, например, TCP или UDP, и может быть применен в устройствах предварительной обработки сетевого трафика. Алгоритм фильтрации трафика сводится к определению соответствия параметров пакета заданным условиям. Протоколы TCP или UDP передают данные отдельными частями – «пакетами». Каждый пакет данных имеет специальный заголовок. TCP и UDP – это транспортные протоколы интернета, которые обеспечивают доставку данных через соединение, предварительно установленное между двумя компьютерами. Оба протокола в заголовке пакета данных указывают номер порта получателя, а также исходящий номер порта – отправителя.The claimed method of dynamic filtering of network packets is aimed at providing the function of filtering network packets, taking into account belonging to protocol sessions, for example, TCP or UDP, and can be applied in network traffic preprocessing devices. The traffic filtering algorithm is reduced to determining whether the packet parameters correspond to the given conditions. TCP or UDP protocols transmit data in separate parts - "packets". Each data packet has a special header. TCP and UDP are Internet transport protocols that deliver data over a connection pre-established between two computers. Both protocols in the header of the data packet indicate the port number of the recipient, as well as the outgoing port number of the sender.

Наиболее близким аналогом к предложенному способу является способ динамической фильтрации пакетов с использованием отслеживания сессий, описанный в патенте на изобретение JP4162210B2 (кл. H04L 12/66, 08.10.2008), «Dynamic packet filter using session tracking». Известный способ включает прием входного потока пакетов через входной интерфейс, последующую передачу его в блок анализа пакетов, в котором выполняется выделение из пакета Ethernet, IP и TCP/UDP-заголовков и формирование на их основе дескриптора, сохранение пакетов в пакетном буфере, а дескриптора – в буфере дескрипторов, из которого дескрипторы передаются в блок расчета HASH. The closest analogue to the proposed method is the method of dynamic packet filtering using session tracking, described in the patent for the invention JP4162210B2 (class H04L 12/66, 08.10.2008), "Dynamic packet filter using session tracking". The known method includes receiving the input stream of packets through the input interface, then passing it to the packet analysis unit, in which the Ethernet, IP and TCP / UDP headers are extracted from the packet and the descriptor is formed on their basis, the packets are stored in the packet buffer, and the descriptor is in the descriptor buffer, from which the descriptors are passed to the HASH calculation block.

Недостатком известного способа является большая вариативность методов фильтрации сетевых пакетов, что усложняет систему и снижает защищенность от внешних атак, а также невозможность фильтрации сетевых пакетов, принадлежащих к UDP-сессиям, и отсутствие решения для ситуаций, когда несколько сессий имеют одно и то же значение HASH-суммы, а также использование общей шины данных, к которой составляющие части системы не имеют монопольный доступ, что усложняет техническую реализацию и снижает производительность решения. The disadvantage of the known method is the large variability of network packet filtering methods, which complicates the system and reduces protection from external attacks, as well as the impossibility of filtering network packets belonging to UDP sessions, and the lack of a solution for situations where several sessions have the same HASH value. -sums, as well as the use of a common data bus, to which the constituent parts of the system do not have exclusive access, which complicates the technical implementation and reduces the performance of the solution.

Целью предложенного изобретения является устранение вышеуказанных недостатков.The aim of the proposed invention is to eliminate the above disadvantages.

Техническим результатом представленного изобретения является снижение нагрузки на информационную систему, повышение пропускной способности и производительности, а также независимость от работы программного обеспечения или архитектуры системы, обеспечение функционирования устройств предварительной обработки трафика с возможностью фильтрации пакетов на основе принадлежности к TCP/UDP сессии и применение в устройствах на базе ПЛИС или СБИС. The technical result of the presented invention is to reduce the load on the information system, increase throughput and performance, as well as independence from the operation of software or system architecture, ensuring the operation of traffic pre-processing devices with the ability to filter packets based on belonging to a TCP / UDP session and use in devices based on FPGA or VLSI.

Преимуществом заявленного решения является также использование конвейерной обработки, в которой может выполняться одновременная обработка нескольких пакетов.The advantage of the claimed solution is also the use of pipeline processing, in which several batches can be processed simultaneously.

Технический результат достигается путем динамической фильтрации сетевых пакетов по принадлежности к сессии, включающий прием входного потока пакетов через входной интерфейс, передачу его в блок анализа пакетов, в котором выполняется выделение из пакета Ethernet, IP и TCP/UDP-заголовков и формирование на их основе дескриптора, сохранение пакетов в пакетном буфере, а дескрипторов – в буфере дескрипторов, из которого дескрипторы передаются в блок расчета HASH,The technical result is achieved by dynamic filtering of network packets by belonging to the session, including receiving the input stream of packets through the input interface, passing it to the packet analysis unit, in which the Ethernet, IP and TCP / UDP headers are extracted from the packet and the descriptor is formed on their basis. , saving packets in the packet buffer, and descriptors in the descriptor buffer, from which the descriptors are transferred to the HASH calculation block,

в блоке расчета HASH на основе полей заголовков пакета, включающих: IP-адрес получателя, IP-адрес отправителя, код протокола L4 и TCP/UDP портов получателя и отправителя, рассчитывается HASH-сумма по алгоритму счетчика с аутентификацией Галуа; in the HASH calculation block, based on the packet header fields, including: the recipient's IP address, the sender's IP address, the L4 protocol code and TCP / UDP ports of the recipient and sender, the HASH sum is calculated using the counter algorithm with Galois authentication;

при этом для разрешения коллизий, возникающих при отслеживании сессии на основе HASH-суммы, в одной ячейке RAM-памяти содержатся записи с информацией о четырех сессиях, включающей IP-адрес получателя, IP-адрес отправителя, код протокола L4, порт получателя, порт отправителя, время, когда был принят последний пакет сессии и код выполняемого над пакетом действия,at the same time, to resolve collisions that occur when tracking a session based on a HASH sum, one RAM cell contains records with information about four sessions, including the recipient's IP address, the sender's IP address, the L4 protocol code, the recipient's port, and the sender's port , the time when the last packet of the session was received and the code of the action to be performed on the packet,

далее HASH-сумма передается в блок отслеживания сессий, который проверяет в ячейке RAM-памяти адрес, которой равен HASH-сумме, наличие информации, состоящей из полей заголовков пакета, по которым выполнялся расчет HASH-суммы об уже принятом пакете с такой же HASH-суммой; then the HASH sum is transferred to the session tracking block, which checks the address in the RAM memory cell, which is equal to the HASH sum, the presence of information consisting of packet header fields, which were used to calculate the HASH sum of the already received packet with the same HASH amount;

если в ячейке RAM-памяти уже присутствует информация о сессии, то выполняется ее сравнение с данными из дескриптора пакета, if the RAM cell already contains information about the session, then it is compared with the data from the packet descriptor,

если информация совпадает и пакет не содержит флага SYN в TCP-заголовке, то считается, что пакет принадлежит к уже существующей сессии и увеличивается счетчик количества пакетов в сессии на 1 пакет, в дескриптор пакета добавляется счетчик количества пакетов в сессии, на основе значения которого блок фильтрации выполняет фильтрацию пакета, if the information matches and the packet does not contain the SYN flag in the TCP header, then it is considered that the packet belongs to an already existing session and the counter of the number of packets in the session is increased by 1 packet, the counter of the number of packets in the session is added to the packet descriptor, based on the value of which the block filtering performs packet filtering,

если информация совпадает, но в пакете присутствует флаг SYN в TCP-заголовке, то выполняется присвоение нового идентификатора сессии и в ячейку RAM-памяти заносится информация о текущем пакете, if the information matches, but the packet contains the SYN flag in the TCP header, then a new session identifier is assigned and information about the current packet is entered into the RAM memory cell,

если информация не совпадает, то аналогичным образом проверяются остальные три записи с информацией о сессиях, при этом в случае отсутствия совпадений информации создается новая запись в ячейке RAM-памяти, заменяющая существующую запись, if the information does not match, then the remaining three records with information about sessions are checked in the same way, and if there is no match, a new record is created in the RAM memory cell, replacing the existing record,

для UDP-сессий проверяется временной интервал между двумя пакетами сессии, и если он превышает установленный порог, то считается, что пришедший пакет относится к новой сессии, а информация об устаревшей сессии удаляется, for UDP sessions, the time interval between two session packets is checked, and if it exceeds the set threshold, then it is considered that the incoming packet belongs to a new session, and information about the outdated session is deleted,

если счетчик количества пакетов в сессии превышает заранее установленное значение, определяющее порог фильтрации пакетов в сессии, то в блок фильтрации передается код действия «Передача запрещена»,if the counter of the number of packets in the session exceeds a predetermined value that determines the threshold for filtering packets in the session, then the action code "Transmission denied" is transmitted to the filtering unit,

в противном случае передается код действия «Передача разрешена»,otherwise, the action code "Transfer allowed" is transmitted,

в результате блок фильтрации в зависимости кода действия выполняет чтение пакета из пакетного буфера передачу пакета в выходной интерфейс – «передача разрешена» или удаляет пакет из пакетного буфера – «передача запрещена».as a result, the filtering block, depending on the action code, reads the packet from the packet buffer and transmits the packet to the output interface - "transmission is allowed" or removes the packet from the packet buffer - "transfer is prohibited".

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

фиг. 1 – схема, иллюстрирующая функциональные блоки, участвующие в фильтрации сетевых пакетов по принадлежности к сессии;fig. 1 is a diagram illustrating the functional blocks involved in filtering network packets by belonging to a session;

фиг.2 – блок-схема динамической фильтрации пакетов по принадлежности к сессии;Fig.2 - block diagram of dynamic filtering of packets by belonging to the session;

фиг. 3 – схема, иллюстрирующая состав информации, хранящейся в дескрипторе;fig. 3 is a diagram illustrating the composition of the information stored in the descriptor;

фиг. 4 – схема, иллюстрирующая структуру хранения в RAM- памяти информации о сессиях.fig. 4 is a diagram illustrating the structure of storing information about sessions in RAM memory.

Система фильтрации сетевых пакетов по принадлежности к сессии
(фиг. 1) содержит входной интерфейс (101), блок анализа пакета (102), пакетный буфер (103), буфер дескрипторов (104), блок расчета HASH (105), блок отслеживания сессий (106), RAM-память (107), блок фильтрации (108) и выходной интерфейс (109).
System for filtering network packets by belonging to a session
(Fig. 1) contains an input interface (101), a packet analysis unit (102), a packet buffer (103), a descriptor buffer (104), a HASH calculation unit (105), a session tracking unit (106), a RAM memory (107 ), a filtering unit (108) and an output interface (109).

Входной интерфейс (101) выполняет прием сетевого пакета, проверку на соответствие требованием протокола Ethernet (преамбула, начало пакета, контрольная сумма).The input interface (101) receives the network packet, checks for compliance with the requirements of the Ethernet protocol (preamble, packet start, checksum).

Блок анализа пакета (102) – блок, который выполняет выделение из сетевых заголовков принятого пакета Ethernet, IP и TCP/UDP-заголовков и формирование на их основе специального информационного блока. Размер TCP-заголовка – 20 байт. Размер UDP-заголовка – 8 байт.Packet analysis block (102) is a block that extracts Ethernet, IP and TCP/UDP headers from the network headers of the received packet and generates a special information block on their basis. The size of the TCP header is 20 bytes. The size of the UDP header is 8 bytes.

Различие между протоколами TCP и UDP в том, что протокол TCP имеет механизм контроля полноты переданных данных – если какой-либо пакет был потерян или поврежден, то предусмотрен механизм для проверки этого факта и повторной отправки пакета. В протоколе UDP такого механизма нет.The difference between the TCP and UDP protocols is that the TCP protocol has a mechanism for controlling the completeness of the transmitted data - if any packet was lost or damaged, then a mechanism is provided to check this fact and resend the packet. There is no such mechanism in the UDP protocol.

Пакетный буфер (103) – блок хранения, в котором на время обработки дескриптора пакета в блоках расчета HASH-суммы и блока отслеживания сессий сохраняется весь пакет.Packet buffer (103) is a storage block in which the entire packet is stored in the blocks for calculating the HASH sum and the session tracking block during the processing of the packet descriptor.

Буфер дескрипторов (104) – временное хранилище, где хранятся дескрипторы на время ожидания обработки.Descriptor buffer (104) - temporary storage where descriptors are stored while waiting for processing.

Блок расчета HASH (105) – блок, в котором из дескриптора выделяются поля: IP-адрес получателя, IP-адрес отправителя, код протокола L4, TCP/UDP-порт получателя, TCP/UDP-порт отправителя и на основе этих полей формируется последовательность байт (вектор байт), по которым рассчитывается HASH-сумма по алгоритму счетчика с аутентификацией Галуа (метод расчета HASH-суммы). Это необходимо для того, чтобы дескриптор длиной 13 байт уменьшить до 4 байт и облегчить поиск дескриптора в RAM-памяти по ключу, являющемуся HASH-суммой. HASH calculation block (105) - a block in which the following fields are extracted from the descriptor: recipient IP address, sender IP address, L4 protocol code, recipient TCP / UDP port, sender TCP / UDP port and based on these fields a sequence is formed bytes (vector of bytes) over which the HASH sum is calculated according to the counter algorithm with Galois authentication (HASH sum calculation method). This is necessary in order to reduce the 13-byte descriptor to 4 bytes and facilitate the search for the descriptor in RAM-memory by the key, which is the HASH sum.

Счётчик с аутентификацией Галуа является разновидностью режима работы симметричных блочных шифров. В алгоритме счетчика с аутентификацией Галуа входные блоки вектора байт нумеруются последовательно, номер блока кодируется блочным алгоритмом. Выход функции шифрования используется в операции XOR (исключающее или) с открытым текстом для получения HASH-суммы. Схема представляет собой потоковый шифр, поэтому использование уникального вектора байт гарантирует получение уникальной HASH-суммы. The counter with Galois authentication is a variation of the mode of operation of symmetric block ciphers. In the counter algorithm with Galois authentication, the input blocks of the byte vector are numbered sequentially, the block number is encoded by the block algorithm. The output of the encryption function is used in XOR operation (exclusive or) with the plaintext to get the HASH sum. The scheme is a stream cipher, so using a unique byte vector guarantees a unique HASH sum.

Блок расчета HASH (105) для расчета HASH-суммы может выполнять, например, побитовую логическую операцию XOR над соответствующими битами IP-адреса получателя (32 бит), IP-адреса отправителя (32 бит), кода протокола L4 (8 бит), порта получателя (16 бит), порта отправителя (16 бит) и отправляет результаты операции побитового «исключающее ИЛИ» (XOR) в рандомизатор и генерирует HASH-сумму, имеющую Y-биты, где Y является положительным целым числом, например, для указанного примера 10 бит.The HASH calculation unit (105) for calculating the HASH sum can perform, for example, a bitwise XOR operation on the corresponding bits of the destination IP address (32 bits), the source IP address (32 bits), the L4 protocol code (8 bits), the port destination (16 bits), sender port (16 bits) and sends the results of the bitwise exclusive OR (XOR) operation to the randomizer and generates a HASH sum having Y bits, where Y is a positive integer, for example, for the specified example 10 bit.

Блок отслеживания сессий (106) – блок, который проверяет в ячейке RAM-памяти адрес, которой равен HASH-сумме, наличие информации, состоящей из полей заголовков пакета, по которым выполнялся расчет HASH-суммы, об уже принятом пакете с такой же HASH-суммой, при этом увеличивается счетчик количества пакетов в сессии на 1 пакет.The session tracking block (106) is a block that checks the address in the RAM memory cell, which is equal to the HASH sum, the presence of information consisting of the packet header fields used to calculate the HASH sum, about the already received packet with the same HASH sum. amount, while increasing the counter of the number of packets in the session by 1 packet.

RAM-память (107) – блок, являющийся оперативной памятью. Ширина адреса памяти равная длине HASH-суммы, в каждой ячейке памяти хранится информация о 4 сессиях. Эта информация включает в себя IP-адрес получателя, IP-адрес отправителя, код протокола L4, порт получателя, порт отправителя, время, когда был принят последний пакет сессии и код выполняемого над пакетом действия (счетчик принятых пакетов сессии). Код протокола L4 – код протокола транспортного уровня, определяющий TCP или UDP протокол.RAM-memory (107) - a block that is random access memory. The width of the memory address is equal to the length of the HASH sum, each memory cell stores information about 4 sessions. This information includes the destination IP address, the source IP address, the L4 protocol code, the destination port, the source port, the time the last session packet was received, and the code of the action performed on the packet (session received packet counter). Protocol code L4 – transport layer protocol code that defines TCP or UDP protocol.

Блок фильтрации (108) – блок, который на основе команды от блока отслеживания сессий передает пакет из пакетного буфера в выходной интерфейс или удаляет пакет из пакетного буфера. The filtering block (108) is a block that, based on a command from the session tracking block, transfers a packet from the packet buffer to the output interface or removes the packet from the packet buffer.

Фильтрация осуществляется на основе количества пакетов сессии, все пакеты превышающее заранее заданный порог фильтруются.Filtering is done based on the number of packets in a session, all packets exceeding a predetermined threshold are filtered.

Если «Передача разрешена», то пакет считывается из пакетного буфера и передается в выходной интерфейс (109). Если «Передача запрещена», то пакет удаляется из пакетного буфера.If "Transmission enabled", then the packet is read from the packet buffer and transmitted to the egress interface (109). If "Transmission denied", then the packet is removed from the packet buffer.

Выходной интерфейс (109) – выполняет передачу сетевого пакета в сеть.Output interface (109) - performs the transmission of a network packet to the network.

Код протокола L4 указывает номер протокола в поле «Протокол» заголовка пакета IPv4 (данные какого протокола содержит пакет, например, TCP, UDP, или ICMP) или в поле «Следующий заголовок» пакета IPv6. Формат IP-пакета более подробно описан в спецификации RFC 791 «Internet Protocol DARPA Internet Program Protocol Specification», сентябрь 1981. Протокол TCP, описывается в спецификации RFC 793 «Transmission Control Protocol», сентябрь 1980, протокол UDP, описан в спецификации RFC 768 «User Datagram Protocol», август 1980.The L4 protocol code indicates the protocol number in the "Protocol" field of the IPv4 packet header (what protocol the packet contains, such as TCP, UDP, or ICMP) or in the "Next Header" field of the IPv6 packet. The IP packet format is described in more detail in the RFC 791 "Internet Protocol DARPA Internet Program Protocol Specification", September 1981. The TCP protocol is described in the RFC 793 "Transmission Control Protocol" specification, September 1980, the UDP protocol is described in the RFC 768 specification " User Datagram Protocol, August 1980.

В предпочтительном варианте изобретения вышеуказанные логические блоки, такие как блок анализа пакета (102), блок расчета HASH (105), блок фильтрации (108), блок отслеживания сессий (106) могут быть реализованы или выполнены на базе перепрограммируемой логической интегральной схемы (ПЛИС), сверхбольшой интегральной схемы (СБИС). Специалисту очевидно, что вышеуказанные логические блоки, схемы/алгоритмы обработки могут быть выполнены с помощью элемента памяти, который записывает обрабатываемые данные, и процессора обработки, в качестве которых могут применяться процессор общего назначения, машиночитаемый носитель, конечный автомат или другое аппаратно-программируемое логическое устройство, дискретный логический элемент или транзисторная логика, дискретный компонент аппаратных средств или любого их сочетания чтобы выполнять описанные выше функции. ПЛИС или СБИС может быть запрограммирована для выполнения предложенного способа и размещена в любом месте компьютерной сети центра обработки данных или брокерах сетевых пакетов.In the preferred embodiment of the invention, the above logical blocks, such as the packet analysis block (102), the HASH calculation block (105), the filtering block (108), the session tracking block (106) can be implemented or implemented on the basis of a field-programmable logic integrated circuit (FPGA) , very large integrated circuit (VLSI). It will be obvious to the person skilled in the art that the above logical blocks, processing circuits/algorithms can be implemented using a memory element that records processed data and a processing processor, which can be a general purpose processor, a computer-readable medium, a state machine, or other hardware-programmable logic device. , a discrete logic element or transistor logic, a discrete hardware component, or any combination thereof, to perform the functions described above. An FPGA or VLSI can be programmed to perform the proposed method and placed anywhere on the data center computer network or network packet brokers.

Заявленный способ динамической фильтрации сетевых пакетов по принадлежности к сессии осуществляется следующим образом. The declared method of dynamic filtering of network packets by belonging to the session is carried out as follows.

Входной поток пакетов (фиг. 1, фиг. 2) принимается последовательно через входной интерфейс (101), включающий функции преобразования из электрического сигнала в набор последовательных цифровых значений и выполняющий проверку на соответствие требованием протокола Ethernet. Затем пакеты передаются в блок анализа пакета (102), в котором выполняется выделение из каждого пакета Ethernet, IP и TCP/UDP-заголовков и происходит формирование на их основе специального информационного блока (дескриптора), направляющегося в буфер дескрипторов (104), в котором происходит их сохранение. На время обработки пакеты после блока анализа пакета (102) сохраняются в пакетный буфер (103).The input packet stream (FIG. 1, FIG. 2) is received sequentially through the input interface (101), which includes the functions of converting from an electrical signal to a set of serial digital values and performing a check for compliance with the requirement of the Ethernet protocol. Then the packets are transferred to the packet analysis block (102), in which the Ethernet, IP and TCP / UDP headers are extracted from each packet and a special information block (descriptor) is formed on their basis, sent to the descriptor buffer (104), in which they are being saved. For the duration of processing, the packets after the packet parser (102) are stored in the packet buffer (103).

Из буфера дескрипторов (104) дескрипторы передаются в блок расчета HASH (105), в котором на основе полей заголовков пакета (IP-адресов, кода протокола L4 и TCP/UDP портов получателя и отправителя) рассчитывается HASH-сумма по алгоритму счетчика с аутентификацией Галуа. Для разрешения коллизий, возникающих при отслеживании сессии на основе HASH-суммы, в одной ячейке RAM-памяти содержатся записи с информацией о четырех сессиях. Информация включает в себя IP-адрес получателя, IP-адрес отправителя, код протокола L4, порт получателя, порт отправителя, время, когда был принят последний пакет сессии и код выполняемого над пакетом действия. From the descriptor buffer (104), the descriptors are transferred to the HASH calculation unit (105), in which, based on the packet header fields (IP addresses, L4 protocol code and TCP / UDP ports of the recipient and sender), the HASH sum is calculated using the counter algorithm with Galois authentication . To resolve collisions that occur when tracking a session based on a HASH sum, one RAM cell contains records with information about four sessions. The information includes the destination IP address, the source IP address, the L4 protocol code, the destination port, the source port, the time the last session packet was received, and the code for the action to be performed on the packet.

Далее HASH-сумма передаётся в блок отслеживания сессий (106), который проверяет в ячейке RAM-памяти (107) адрес которой равен HASH-сумме, наличие информации, состоящей из полей заголовков пакета, по которым выполнялся расчет HASH-суммы, об уже принятом пакете с такой же HASH-суммой, при этом увеличивается счетчик количества пакетов (n) в сессии на 1 пакет (фиг.2). Next, the HASH sum is transferred to the session tracking unit (106), which checks in the RAM memory cell (107) the address of which is equal to the HASH sum, the presence of information consisting of the packet header fields used to calculate the HASH sum, about the already received packet with the same HASH sum, while increasing the counter of the number of packets (n) in the session by 1 packet (figure 2).

Решение о том, пропускать или не пропускать сетевые пакеты, принимается на основании количества пакетов сессии, все пакеты превышающее заранее заданный порог фильтруются;The decision on whether or not to skip network packets is made based on the number of session packets, all packets exceeding a predetermined threshold are filtered;

счетчик количества пакетов в сессии хранится в RAM-памяти. the counter of the number of packets in the session is stored in RAM-memory.

Если в ячейке RAM-памяти (107) уже присутствует информация о сессии, то выполняется ее сравнение с данными из дескриптора пакета
(фиг. 2).
If there is already information about the session in the RAM memory cell (107), then it is compared with the data from the packet descriptor
(Fig. 2).

Если информация совпадает и пакет не содержит флага SYN (который означает начало новой сессии) в TCP-заголовке, то считается, что пакет принадлежит к уже существующей сессии и к дескриптору пакета добавляется хранящийся в этой ячейке RAM-памяти идентификатор действия, являющийся 8-битным числом, на основе которого блок фильтрации (108) выполняет фильтрацию пакета.If the information matches and the packet does not contain the SYN flag (which means the beginning of a new session) in the TCP header, then the packet is considered to belong to an already existing session and the action identifier stored in this RAM memory cell, which is 8-bit, is added to the packet descriptor a number based on which the filtering unit (108) performs packet filtering.

Если информация совпадает, но в пакете присутствует флаг SYN в TCP-заголовке, то выполняется присвоение нового идентификатора сессии и в ячейку RAM-памяти (107) заносится информация о текущем пакете.If the information matches, but the packet contains the SYN flag in the TCP header, then a new session identifier is assigned and information about the current packet is entered into the RAM memory cell (107).

Если информация не совпадает, то аналогичным образом проверяются остальные три записи с информацией о сессиях. При этом в случае отсутствия совпадений информации создается новая запись в ячейке RAM-памяти.If the information does not match, then the other three records with information about sessions are checked in the same way. In this case, if the information does not match, a new entry is created in the RAM-memory cell.

Для UDP-сессий проверяется временной интервал между двумя пакетами сессии, и если он превышает установленный порог (например, более 30 секунд), то считается что пришедший пакет относится к новой сессии, а информация об устаревшей сессии удаляется, после чего блок фильтрации (108) получает от блока отслеживания сессий код выполняемого действия.For UDP sessions, the time interval between two session packets is checked, and if it exceeds the set threshold (for example, more than 30 seconds), then the incoming packet is considered to belong to a new session, and information about the outdated session is deleted, after which the filtering block (108) receives from the session tracking block the code of the action to be performed.

Пакеты из пакетного буфера (103) поступают в блок фильтрации (108).Packets from the packet buffer (103) enter the filtering unit (108).

Если в результате анализа удалось определить код действия, то блок фильтрации (108) передает блоку отслеживания сессий (106) код действия для записи в соответствующую данной сессии ячейку RAM-памяти «Передача разрешена» или «Передача запрещена».If, as a result of the analysis, it was possible to determine the action code, then the filtering unit (108) transmits to the session tracking unit (106) the action code for writing to the RAM memory cell corresponding to this session “Transmission allowed” or “Transmission prohibited”.

Если код действия разрешает дальнейшую передачу, то пакет передается в выходной интерфейс (109).If the action code allows further transmission, then the packet is transmitted to the egress interface (109).

Если счетчик превышает заранее заданный порог (пакет n), то считается, что действие с пакетом принимается как «передача запрещена» и удаляется из пакетного буфера.If the counter exceeds a predetermined threshold (packet n), then the packet action is considered to be "transmission denied" and removed from the packet buffer.

Для обработки в случае, когда несколько TCP/UDP-сессий имеют одинаковое значение HASH-суммы, в одной ячейке RAM-памяти (107) может содержатся запись с информацией о четырех сессиях. Информация включает в себя (фиг. 3) IP-адрес получателя (201), IP-адрес отправителя (202), код протокола L4 (203), порт получателя (204), порт отправителя (205), время, когда был принят последний пакет сессии (206) и код выполняемого над пакетом действия (207).To handle the case where multiple TCP/UDP sessions have the same HASH value, one RAM location (107) may contain an entry with information about four sessions. The information includes (FIG. 3) the destination IP address (201), the source IP address (202), the L4 protocol code (203), the destination port (204), the source port (205), the time when the last received the session package (206) and the code for the action to be performed on the package (207).

Пример формата хранения информации о сессиях в RAM-памяти, где в каждой ячейке памяти хранится информация о 4 сессиях представлен на
фиг. 4.
An example of the format for storing information about sessions in RAM memory, where information about 4 sessions is stored in each memory cell is presented in
fig. four.

В данном случае входной поток пакетов принимается последовательно через входной интерфейс (101). Затем пакеты передаются в блок анализа пакета (102), в котором выполняется выделение из каждого пакета Ethernet, IP и TCP/UDP-заголовков и происходит формирование на их основе дескриптора, направляющегося в буфер дескрипторов (104). На время обработки пакеты после блока анализа пакета (102) сохраняются в пакетный буфер (103).In this case, the input stream of packets is received sequentially through the input interface (101). Then the packets are transferred to the packet analysis block (102), in which the Ethernet, IP and TCP / UDP headers are extracted from each packet and a descriptor is formed on their basis, which is sent to the descriptor buffer (104). For the duration of processing, the packets after the packet parser (102) are stored in the packet buffer (103).

Из буфера дескрипторов (104) дескрипторы передаются в блок расчета HASH (105), в котором на основе полей заголовков пакета рассчитывается HASH-сумма. В одной ячейке RAM-памяти содержатся записи с информацией о четырех сессиях (HASH № 1, HASH № 2, HASH № 3, HASH № 4). Информация включает (фиг. 3) в себя IP-адрес получателя, IP-адрес отправителя, код протокола L4, порт получателя, порт отправителя, время, когда был принят последний пакет сессии и код выполняемого над пакетом действия. From the descriptor buffer (104), the descriptors are passed to the HASH calculation block (105), in which the HASH sum is calculated based on the packet header fields. One RAM cell contains records with information about four sessions (HASH No. 1, HASH No. 2, HASH No. 3, HASH No. 4). The information includes (FIG. 3) the destination IP address, the source IP address, the L4 protocol code, the destination port, the source port, the time the last session packet was received, and the code for the action to be performed on the packet.

Далее HASH-сумма передается в блок отслеживания сессий (106), который проверяет в ячейке RAM-памяти (107) адрес которой равен HASH-сумме, наличие информации, состоящей из полей заголовков пакета, по которым выполнялся расчет HASH-суммы, об уже принятом пакете с такой же HASH-суммой, при этом увеличивается счетчик количества пакетов (n) в сессии на 1 пакет. Next, the HASH sum is transferred to the session tracking unit (106), which checks in the RAM memory cell (107) the address of which is equal to the HASH sum, the presence of information consisting of the packet header fields used to calculate the HASH sum, about the already received packet with the same HASH sum, while the counter of the number of packets (n) in the session is increased by 1 packet.

Если информация совпадает (фиг. 2), в пакете TCP присутствует флаг SYN, то выполняется присвоение нового идентификатора сессии и в ячейку RAM-памяти заносится информация о текущем пакете. Пакет UDP и разница между временем из записи и временем пакета < Limit_T= 30 сек, количество пакетов (n) увеличивается на 1 пакет (фиг. 2). Количество пакетов n<N, где N=4. Блок фильтрации получает от блока отслеживания сессий код выполняемого действия «передача разрешена».If the information matches (Fig. 2), the SYN flag is present in the TCP packet, then a new session identifier is assigned and information about the current packet is entered into the RAM memory cell. UDP packet and the difference between the time from the record and the packet time < Limit_T= 30 sec, the number of packets (n) increases by 1 packet (Fig. 2). The number of packages n<N, where N=4. The filtering block receives from the session tracking block the code of the performed action "transfer allowed".

В результате использования заявленного изобретения достигается снижение нагрузки на информационную систему, повышение пропускной способности и производительности, а также независимость от работы программного обеспечения или архитектуры системы.As a result of using the claimed invention, a reduction in the load on the information system, an increase in throughput and performance, as well as independence from the operation of the software or system architecture is achieved.

Описанные варианты осуществления изобретения не являются исчерпывающими и приведены только с целью пояснения и подтверждения промышленной применимости, и специалисты в данной области техники способны создавать альтернативные варианты его осуществления без отрыва от объема формулы, но в пределах сущности изобретения, отраженной в описании.The described embodiments of the invention are not exhaustive and are provided only for the purpose of explaining and confirming industrial applicability, and specialists in the art are able to create alternative embodiments of the invention without departing from the scope of the claims, but within the essence of the invention reflected in the description.

Claims (10)

Способ динамической фильтрации сетевых пакетов по принадлежности к сессии, включающий прием входного потока пакетов через входной интерфейс, передачу его в блок анализа пакетов, в котором выполняется выделение из пакета Ethernet, IP и TCP/UDP-заголовков и формирование на их основе дескриптора, сохранение пакетов в пакетном буфере, а дескрипторов – в буфере дескрипторов, из которого дескрипторы передаются в блок расчета HASH, отличающийся тем, чтоA method for dynamically filtering network packets by belonging to a session, including receiving an input stream of packets through an input interface, passing it to a packet analysis unit, in which the Ethernet, IP and TCP / UDP headers are extracted from the packet and a descriptor is formed on their basis, packets are saved in the packet buffer, and descriptors - in the descriptor buffer, from which the descriptors are transferred to the HASH calculation block, characterized in that в блоке расчета HASH на основе полей заголовков пакета, включающих: IP-адрес получателя, IP-адрес отправителя, код протокола L4 и TCP/UDP портов получателя и отправителя, рассчитывается HASH-сумма по алгоритму счетчика с аутентификацией Галуа;in the HASH calculation block, based on the packet header fields, including: the recipient's IP address, the sender's IP address, the L4 protocol code and TCP / UDP ports of the recipient and sender, the HASH sum is calculated using the counter algorithm with Galois authentication; при этом для разрешения коллизий, возникающих при отслеживании сессии на основе HASH-суммы, в одной ячейке RAM-памяти содержатся записи с информацией о четырех сессиях, включающей IP-адрес получателя, IP-адрес отправителя, код протокола L4, порт получателя, порт отправителя, время, когда был принят последний пакет сессии и код выполняемого над пакетом действия, at the same time, to resolve collisions that occur when tracking a session based on a HASH sum, one RAM cell contains records with information about four sessions, including the recipient's IP address, the sender's IP address, the L4 protocol code, the recipient's port, and the sender's port , the time when the last packet of the session was received and the code of the action to be performed on the packet, далее HASH-сумма передается в блок отслеживания сессий, который проверяет в ячейке RAM-памяти, адрес которой равен HASH-сумме, наличие информации, состоящей из полей заголовков пакета, по которым выполнялся расчет HASH-суммы, об уже принятом пакете с такой же HASH-суммой;then the HASH sum is transferred to the session tracking block, which checks in the RAM cell, the address of which is equal to the HASH sum, the presence of information consisting of the packet header fields used to calculate the HASH sum, about the already received packet with the same HASH -amount; если в ячейке RAM-памяти уже присутствует информация о сессии, то выполняется ее сравнение с данными из дескриптора пакета,if the RAM cell already contains information about the session, then it is compared with the data from the packet descriptor, если информация совпадает и пакет не содержит флага SYN в TCP-заголовке, то считается, что пакет принадлежит к уже существующей сессии и увеличивается счетчик количества пакетов в сессии на 1 пакет, в дескриптор пакета добавляется счетчик количества пакетов в сессии, на основе значения которого блок фильтрации выполняет фильтрацию пакета,if the information matches and the packet does not contain the SYN flag in the TCP header, then it is considered that the packet belongs to an already existing session and the counter of the number of packets in the session is increased by 1 packet, the counter of the number of packets in the session is added to the packet descriptor, based on the value of which the block filtering performs packet filtering, если информация совпадает, но в пакете присутствует флаг SYN в TCP-заголовке, то выполняется присвоение нового идентификатора сессии и в ячейку RAM-памяти заносится информация о текущем пакете,if the information matches, but the packet contains the SYN flag in the TCP header, then a new session identifier is assigned and information about the current packet is entered into the RAM memory cell, если информация не совпадает, то аналогичным образом проверяются остальные три записи с информацией о сессиях, при этом в случае отсутствия совпадений информации создается новая запись в ячейке RAM-памяти, заменяющая существующую запись, для UDP-сессий проверяется временной интервал между двумя пакетами сессии, и если он превышает установленный порог, то считается, что пришедший пакет относится к новой сессии, а информация об устаревшей сессии удаляется,if the information does not match, then the remaining three records with information about sessions are checked in the same way, and if there is no match, a new record is created in the RAM memory cell, replacing the existing record, for UDP sessions the time interval between two session packets is checked, and if it exceeds the set threshold, then it is considered that the incoming packet belongs to a new session, and information about the outdated session is deleted, если счетчик количества пакетов в сессии превышает заранее установленное значение, определяющее порог фильтрации пакетов в сессии, то в блок фильтрации передается код действия «Передача запрещена», в противном случае передается код действия «Передача разрешена»,if the counter of the number of packets in the session exceeds a predetermined value that determines the threshold for filtering packets in the session, then the action code "Transmission is prohibited" is transmitted to the filtering unit, otherwise the action code "Transmission is allowed" is transmitted, в результате блок фильтрации в зависимости кода действия выполняет чтение пакета из пакетного буфера передачу пакета в выходной интерфейс – «передача разрешена» или удаляет пакет из пакетного буфера – «передача запрещена».as a result, the filtering block, depending on the action code, reads the packet from the packet buffer and transmits the packet to the output interface - "transmission is allowed" or removes the packet from the packet buffer - "transfer is prohibited".
RU2022110253A 2022-04-15 Method for dynamic filtering of network packets by sessions RU2779135C1 (en)

Publications (1)

Publication Number Publication Date
RU2779135C1 true RU2779135C1 (en) 2022-09-01

Family

ID=

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6496935B1 (en) * 2000-03-02 2002-12-17 Check Point Software Technologies Ltd System, device and method for rapid packet filtering and processing
EP0910197A3 (en) * 1997-09-12 2003-08-06 Lucent Technologies Inc. Methods and apparatus for a computer network firewall with dynamic rule processing
US6816455B2 (en) * 2001-05-09 2004-11-09 Telecom Italia S.P.A. Dynamic packet filter utilizing session tracking
RU2644537C2 (en) * 2016-07-05 2018-02-12 Общество с ограниченной ответственностью "Айдеко" Method of determination of type of network traffic for filtration and controlling network connections

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0910197A3 (en) * 1997-09-12 2003-08-06 Lucent Technologies Inc. Methods and apparatus for a computer network firewall with dynamic rule processing
US6496935B1 (en) * 2000-03-02 2002-12-17 Check Point Software Technologies Ltd System, device and method for rapid packet filtering and processing
US6816455B2 (en) * 2001-05-09 2004-11-09 Telecom Italia S.P.A. Dynamic packet filter utilizing session tracking
RU2644537C2 (en) * 2016-07-05 2018-02-12 Общество с ограниченной ответственностью "Айдеко" Method of determination of type of network traffic for filtration and controlling network connections

Similar Documents

Publication Publication Date Title
US11032190B2 (en) Methods and systems for network security universal control point
US20050198492A1 (en) System and method for secure data transfer over a network
US10404588B2 (en) Path maximum transmission unit handling for virtual private networks
US8079077B2 (en) System and method for distributed multi-processing security gateway
US8224976B2 (en) Using a server&#39;s capability profile to establish a connection
CN112448918B (en) Message transmission method and device and computer storage medium
US8320249B2 (en) Method and system for controlling network access on a per-flow basis
US10757230B2 (en) Efficient parsing of extended packet headers
US9282038B2 (en) Policy control enforcement at a packet gateway
US20050198498A1 (en) System and method for performing cryptographic operations on network data
US20220393908A1 (en) Message Encapsulation Method and Apparatus, and Message Decapsulation Method and Apparatus
JP4340653B2 (en) Communication processing apparatus and communication processing method
US8365045B2 (en) Flow based data packet processing
US11252184B2 (en) Anti-attack data transmission method and device
US7564976B2 (en) System and method for performing security operations on network data
US9667650B2 (en) Anti-replay checking with multiple sequence number spaces
RU2779135C1 (en) Method for dynamic filtering of network packets by sessions
CN111245858A (en) Network flow interception method, system, device, computer equipment and storage medium
WO2004019561A1 (en) Frame transfer method and node in ethernet(r)
RU2790635C1 (en) Method for filtering a part of packets in a network session
RU2786178C1 (en) Method for tracking sessions in network traffic
RU2778462C1 (en) A way to track fragments of packets in network traffic
RU2807656C1 (en) Balancing method while maintaining integrity of data flows
RU2790617C1 (en) Method for high-speed data field removal in packet switching
RU2786629C1 (en) Method for ensuring balancing identity for bidirectional network session data flow