RU2373654C1 - Method for making peer-to-peer connection and system designed for it - Google Patents

Method for making peer-to-peer connection and system designed for it Download PDF

Info

Publication number
RU2373654C1
RU2373654C1 RU2008109140/09A RU2008109140A RU2373654C1 RU 2373654 C1 RU2373654 C1 RU 2373654C1 RU 2008109140/09 A RU2008109140/09 A RU 2008109140/09A RU 2008109140 A RU2008109140 A RU 2008109140A RU 2373654 C1 RU2373654 C1 RU 2373654C1
Authority
RU
Russia
Prior art keywords
host
data packet
hosts
receiving
address information
Prior art date
Application number
RU2008109140/09A
Other languages
Russian (ru)
Inventor
Е Чжу (Cn)
Е Чжу
Баохэ ЧЖАН (CN)
Баохэ ЧЖАН
Бо У (CN)
Бо У
Хайцзюнь У (CN)
Хайцзюнь У
Original Assignee
Тенсент Текнолоджи (Шеньчжэнь) Компани Лимитед
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Тенсент Текнолоджи (Шеньчжэнь) Компани Лимитед filed Critical Тенсент Текнолоджи (Шеньчжэнь) Компани Лимитед
Application granted granted Critical
Publication of RU2373654C1 publication Critical patent/RU2373654C1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]

Abstract

FIELD: information technologies. ^ SUBSTANCE: invention is related to technology of communication between units of computer network. Method for making a peer-to-peer connection (P2P connection) includes transfer by server, after reception of synchronisation query from the first host, to each of the first and second hosts of synchronisation data packets, comprising at least information about address of another host from specified first and second hosts; and transfer of UDP protocol data packet, after reception of specified synchronisation data packet, by the first and second hosts to each other. Besides system is suggested for making of P2P connection. According to the present invention, P2P connection between two hosts may be successfully made in most cases, because data packet has already been transferred by each host from specified first and second hosts, when each of them receives data packet sent by another host from specified first and second hosts. ^ EFFECT: improved extent of P2P connection making successfulness. ^ 12 cl, 6 dwg

Description

Область техникиTechnical field

Настоящее изобретение относится к технологии связи между узлами компьютерной сети. Более конкретно изобретение относится к способу установления однорангового соединения (соединения Р2Р) и к предназначенной для этого системе.The present invention relates to communication technology between nodes of a computer network. More specifically, the invention relates to a method for establishing a peer-to-peer connection (P2P connection) and to an intended system.

Уровень техникиState of the art

Соединения между двумя узлами сети обычно выполняются в двух режимах. Первый режим - "клиент-сервер", согласно которому клиент запрашивает услугу, а сервер эту услугу предоставляет, как правило, по схеме "один ко многим". Как показано на фиг.1, сервер может принимать запросы от многих клиентов и предоставлять им услуги, при этом связь между ними не является одноранговой. Второй режим - одноранговый (режим Р2Р), при котором любые два узла компьютерной сети связаны непосредственно друг с другом (см. фиг.2), т.е. каждые два узла образуют одноранговую пару.Connections between two network nodes are usually made in two modes. The first mode is “client-server”, according to which the client requests a service, and the server provides this service, as a rule, according to the “one to many” scheme. As shown in figure 1, the server can receive requests from many clients and provide them with services, while the connection between them is not peer-to-peer. The second mode is peer-to-peer (P2P mode), in which any two nodes of the computer network are connected directly to each other (see figure 2), i.e. every two nodes form a peer-to-peer pair.

Поскольку в режиме "клиент-сервер" серверы отвечают за предоставление услуг множеству клиентов, то в качестве серверов обычно используются высокопроизводительные и, как следствие, дорогостоящие компьютеры. В режиме Р2Р два коммуникационных терминала являются одноранговыми и предоставляют услуги друг другу, что обеспечивает режиму Р2Р заметные преимущества, поскольку для совместного использования ресурсов и связи друг с другом можно объединять множество ПК средней производительности, при этом затраты заметно снижаются. Эта и другие причины повлияли на то, что при разработке сетей стали использовать режим Р2Р. В настоящее время к приложениям, использующим данный режим, относятся, например, приложения обмена файлов, приложения распределенных вычислений, электронной торговли и т.д.Since in the "client-server" mode the servers are responsible for providing services to many clients, high-performance and, as a result, expensive computers are usually used as servers. In P2P mode, the two communication terminals are peer-to-peer and provide services to each other, which provides the P2P mode with noticeable advantages, since multiple PCs of average performance can be combined for sharing resources and communicating with each other, while the costs are significantly reduced. This and other reasons influenced the fact that when developing networks began to use the P2P mode. Currently, applications using this mode include, for example, file sharing applications, distributed computing applications, electronic commerce, etc.

Несмотря на упомянутые преимущества дальнейшее развитие режима Р2Р в некоторой степени ограничено тем обстоятельством, что все больше и больше компьютеров работают с использованием транслятора сетевых адресов (транслятора NAT), защищающего компьютеры от сетевых вирусных атак. Транслятор NAT - это механизм, обычно используемый в маршрутизаторах, который отвечает за проверку и пересылку пакетов между частной сетью и сетью общего доступа. Поскольку трансляторы NAT могут изменять информацию IP-адреса и порта хоста частной сети, они ограничивают возможности прямого соединения между любыми двумя компьютерами и позволяют организовать связь только в соответствии с определенными правилами. Следовательно, при реализации режима Р2Р основной задачей становится преодоление ограничений трансляторов NAT.Despite these advantages, the further development of the P2P mode is to some extent limited by the fact that more and more computers operate using a network address translator (NAT translator) that protects computers from network virus attacks. A NAT translator is a mechanism commonly used in routers that is responsible for checking and forwarding packets between a private network and a public network. Since NAT translators can change the IP address and host port information of a private network, they limit the direct connection between any two computers and allow you to establish communication only in accordance with certain rules. Therefore, when implementing the P2P mode, the main task is to overcome the limitations of NAT translators.

Трансляторы NAT можно в общих чертах разделить на три категории: Basic NAT (Базовый NAT), Cone NAT (Конусный NAT) и Symmetric NAT (Симметричный NAT).NAT translators can be broadly divided into three categories: Basic NAT, Cone NAT, and Symmetric NAT.

Транслятор Basic NAT обычно ассоциирует пару {локальный IP-адрес, локальный порт} с парой {глобальный IP-адрес, глобальный порт} и транслирует адреса между этими ассоциированными портами.The Basic NAT translator usually associates a pair {local IP address, local port} with a pair {global IP address, global port} and translates the addresses between these associated ports.

Транслятор Cone NAT обычно ассоциирует пару {локальный IP-адрес, локальный порт} с парой {глобальный IP-адрес, глобальный порт} и использует этот ассоциированный порт повторно для обслуживания соединений с одного и того же сочетания локального IP-адреса и номера порта. Транслятор Cone NAT поддерживает ассоциированный порт в активном состоянии до тех пор, пока остается действующим хотя бы одно такое соединение.The Cone NAT translator typically associates a pair {local IP address, local port} with a pair {global IP address, global port} and reuses this associated port to service connections from the same combination of local IP address and port number. The Cone NAT translator keeps the associated port active as long as at least one such connection remains active.

Трансляторы Cone NAT подразделяются, в свою очередь, на несколько подкатегорий: Full Cone NAT (Полный Конусный NAT), Restricted Cone NAT (Ограниченный Конусный NAT) и Port-Restricted Cone NAT (Ограниченный по Портам Конусный NAT). Транслятор Full Cone NAT ассоциирует глобальный порт с локальным портом при установлении нового сеанса связи с внешним терминалом и затем принимает коммуникационные данные от любого внешнего терминала сети общего доступа через глобальный порт. Транслятор Restricted Cone NAT не принимает любые пакеты данных от внешнего хоста с внешним IP-адресом, пока локальный хост не отправит один или несколько пакетов данных по IP-адресу внешнего хоста. Транслятор Port-Restricted Cone NAT не принимает любые пакеты данных от внешнего хоста с заданным сочетанием IP-адреса и порта, пока локальный хост не отправит один или несколько пакетов данных по IP-адресу и номеру порта внешнего хоста. Нетрудно заметить, что трансляторы Restricted Cone NAT и Port-Restricted Cone NAT могут эффективно защищать локальные хосты от получения нежелательных пакетов данных.Cone NAT translators, in turn, are divided into several subcategories: Full Cone NAT, Restricted Cone NAT, and Port-Restricted Cone NAT. The Full Cone NAT translator associates a global port with a local port when establishing a new communication session with an external terminal and then receives communication data from any external terminal on the public network through the global port. The Restricted Cone NAT translator does not accept any data packets from an external host with an external IP address until the local host sends one or more data packets to the IP address of the external host. The Port-Restricted Cone NAT translator does not accept any data packets from an external host with a given combination of IP address and port until the local host sends one or more data packets to the IP address and port number of the external host. It is easy to see that the Restricted Cone NAT and Port-Restricted Cone NAT translators can effectively protect local hosts from receiving unwanted data packets.

Транслятор Symmetric NAT не поддерживает ассоциативное отношение между парой {локальный IP-адрес, локальный номер порта} и парой {глобальный IP-адрес, глобальный номер порта}, неизменное для всех сеансов связи. Вместо этого для каждого нового сеанса он использует новый глобальный порт или глобальный IP-адрес.The Symmetric NAT translator does not support the association between the {local IP address, local port number} pair and the {global IP address, global port number} pair, which is unchanged for all communication sessions. Instead, for each new session, it uses a new global port or global IP address.

Поскольку на практике используются все типы трансляторов NAT и в каждом из них применяется собственный специфический режим связи, то при установлении соединения Р2Р между двумя узлами с разными типами трансляторов NAT прежде всего необходимо определить используемые типы трансляторов NAT, а затем установить соединение Р2Р, использующее разные режимы связи в соответствии с этими типами трансляторов NAT.Since in practice all types of NAT translators are used and each of them has its own specific communication mode, when establishing a P2P connection between two nodes with different types of NAT translators, it is first necessary to determine the types of NAT translators used and then establish a P2P connection using different modes communications according to these types of NAT translators.

Далее описывается способ установления соединения Р2Р, соответствующий известному уровню техники.The following describes a method for establishing a P2P connection according to the prior art.

Когда хост А некоторой сети пытается установить соединение Р2Р с хостом В, то для определения типа транслятора NAT его сети и последующей передачи данных об этом типе на сервер обычно используется внешний сервер с двумя IP-адресами. Соответственно этот сервер сохраняет тип транслятора NAT, переданный хостом В. Хост А получает с сервера информацию о типе транслятора NAT, используемом в сети, где расположен хост В. Если хост В расположен в сети общего доступа или в сети, где используется тип транслятора Full Cone NAT, то хост А должен использовать активный режим (см. фиг.3). Как показано на фиг.3, хост А посылает пакет данных непосредственно хосту В, а хост В возвращает ответный пакет хосту А. Таким образом устанавливается соединение Р2Р. В противном случае хост А использует пассивный режим (см. фиг.4). Как показано на фиг.4, хост А сначала посылает через сервер на хост В команду передавать пакет данных на хост А, затем хост А возвращает ответный пакет на хост В, устанавливая таким образом соединение Р2Р.When host A of a network tries to establish a P2P connection with host B, an external server with two IP addresses is usually used to determine the type of NAT translator of its network and then transfer data about this type to the server. Accordingly, this server saves the type of NAT translator transmitted by host B. Host A receives from the server information about the type of NAT translator used in the network where host B is located. If host B is located in a public network or in a network where the type of translator is Full Cone NAT, then host A must use active mode (see FIG. 3). As shown in FIG. 3, host A sends a data packet directly to host B, and host B returns a response packet to host A. Thus, a P2P connection is established. Otherwise, host A uses passive mode (see FIG. 4). As shown in FIG. 4, host A first sends a command through the server to host B to transmit a data packet to host A, then host A returns a response packet to host B, thus establishing a P2P connection.

Если при описанном пассивном режиме хост А расположен в сети общего доступа или в сети, где используется тип транслятора Full Cone NAT, то соединение Р2Р устанавливается успешно. Однако если в сети, где расположен хост А, используется один из типов Restricted Cone NAT, Port-Restricted Cone NAT или Symmetric NAT, то трансляторы NAT этих типов будут отвергать нежелательные пакеты данных или даже отбрасывать в течение некоторого периода времени пакеты, направляемые с определенной комбинации IP-адреса и номера порта, из-за того что они будут определяться как имеющие признаки атаки. Все это делает невозможным установление соединений Р2Р. Нетрудно заметить, что техническое решение известного уровня техники обеспечивает низкую степень успеха в установлении соединений Р2Р.If in the described passive mode host A is located in a public network or in a network where the type of translator Full Cone NAT is used, then the P2P connection is established successfully. However, if the network where host A is located uses one of the types Restricted Cone NAT, Port-Restricted Cone NAT, or Symmetric NAT, then NAT translators of these types will reject unwanted data packets or even drop packets sent from a certain period of time combinations of IP address and port number, due to the fact that they will be identified as having signs of attack. All this makes it impossible to establish P2P connections. It is easy to see that the technical solution of the prior art provides a low degree of success in establishing P2P connections.

Сущность изобретенияSUMMARY OF THE INVENTION

Задача данного изобретения заключается в создании способа и системы установления соединений Р2Р, которые позволяют повысить процент успеха при установлении таких соединений.The objective of the invention is to provide a method and system for establishing connections P2P, which can increase the percentage of success in establishing such connections.

Изобретение представлено следующими вариантами выполнения.The invention is represented by the following embodiments.

Заявленный способ установления соединения Р2Р включает следующие этапы:The claimed method of establishing a connection P2P includes the following steps:

передачу сервером после получения запроса синхронизации от первого хоста каждому из первого и второго хостов пакета данных синхронизации, содержащего по меньшей мере адресную информацию другого хоста из указанных первого и второго хостов;transmitting by the server after receiving a synchronization request from the first host to each of the first and second hosts a synchronization data packet containing at least address information of another host from said first and second hosts;

и передачу после получения указанного пакета данных синхронизации первым и вторым хостами друг другу пакета данных протокола UDP (протокола пользовательских дейтаграмм) в соответствии с полученной адресной информацией другого хоста из указанных первого и второго хостов.and transmitting, upon receipt of the specified packet of synchronization data, by the first and second hosts to each other, a UDP protocol data packet (User Datagram Protocol) in accordance with the received address information of another host from said first and second hosts.

Кроме того, способ содержит:In addition, the method comprises:

регистрацию первого и второго хостов на сервере перед передачей первым хостом запроса синхронизации серверу,registering the first and second hosts on the server before sending the synchronization request to the server by the first host,

и сохранение сервером сетевых идентификаторов и адресной информации первого и второго хостов соответственно.and storing the server network identifiers and address information of the first and second hosts, respectively.

Запрос синхронизации от первого хоста содержит по меньшей мере сетевой идентификатор и адресную информацию второго хоста. Кроме того, способ содержит:The synchronization request from the first host contains at least a network identifier and address information of the second host. In addition, the method comprises:

определение вторым хостом, устанавливать ли соединение Р2Р с первым хостом после получения пакета данных синхронизации, и направление пакета данных протокола UDP первому хосту, если принято решение устанавливать соединение Р2Р с первым хостом, или завершение процесса, если принято решение не устанавливать соединение Р2Р с первым хостом.determining by the second host whether to establish a P2P connection with the first host after receiving the synchronization data packet, and sending the UDP protocol data packet to the first host, if a decision was made to establish a P2P connection to the first host, or completion of the process if it was decided not to establish a P2P connection to the first host .

Кроме того, способ содержит:In addition, the method comprises:

передачу первым и вторым хостами друг другу ответного пакета данных после получения пакета данных протокола UDP, переданного другим хостом из указанных первого и второго хостов.the first and second hosts transmitting a response data packet to each other after receiving a UDP protocol data packet transmitted by another host from said first and second hosts.

Если первый хост расположен в домене, использующем транслятор Restricted Cone NAT (Ограниченный Конусный Транслятор Сетевых Адресов), Port-Restricted Cone NAT (Ограниченный по Портам Конусный NAT) или Symmetric NAT (Симметричный NAT), а второй хост расположен в сети общего доступа или в домене, использующем транслятор Full Cone NAT, то передача первым и вторым хостами друг другу пакета данных протокола UDP после получения пакета данных синхронизации содержит:If the first host is located in a domain that uses the Restricted Cone NAT translator, Port-Restricted Cone NAT or Symmetric NAT, and the second host is located on a public network or in If the domain uses the Full Cone NAT translator, then the transfer of the UDP protocol data packet to each other by the first and second hosts after receiving the synchronization data packet contains:

передачу первым хостом после получения пакета данных синхронизации пакета данных протокола UDP второму хосту в соответствии с полученной адресной информацией второго хоста;transmitting by the first host after receiving the synchronization data packet a UDP protocol data packet to the second host in accordance with the received address information of the second host;

и передачу вторым хостом после получения пакета данных синхронизации пакета данных протокола UDP первому хосту в соответствии с полученной адресной информацией первого хоста.and transmitting by the second host after receiving the synchronization data packet a UDP protocol data packet to the first host in accordance with the obtained address information of the first host.

Если первый хост расположен в сети общего доступа или в домене, использующем транслятор Full Cone NAT, а второй хост расположен в домене, использующем трансляторы Restricted Cone NAT, Port-Restricted Cone NAT или Symmetric NAT, то передача первым и вторым хостами друг другу пакета данных протокола UDP после получения пакета данных синхронизации содержит:If the first host is located in a public network or in a domain using the Full Cone NAT translator, and the second host is located in a domain using the Restricted Cone NAT, Port-Restricted Cone NAT, or Symmetric NAT translators, the data packet is transmitted by the first and second hosts to each other UDP protocol after receiving a synchronization data packet contains:

передачу вторым хостом после получения пакета данных синхронизации пакета данных протокола UDP первому хосту в соответствии с полученной адресной информацией первого хоста;transmitting by the second host after receiving the synchronization data packet a UDP protocol data packet to the first host in accordance with the received address information of the first host;

и передачу первым хостом после получения пакета данных синхронизации пакета данных протокола UDP второму хосту в соответствии с полученной адресной информацией второго хоста.and transmitting by the first host after receiving the synchronization data packet a UDP protocol data packet to the second host in accordance with the obtained address information of the second host.

Если первый хост расположен в домене, использующем транслятор Restricted Cone NAT или транслятор Port-Restricted Cone NAT, и второй хост расположен в домене, использующем транслятор Restricted Cone NAT или транслятор Port-Restricted Cone NAT, то передача первым и вторым хостами друг другу пакета данных протокола UDP после получения пакета данных синхронизации содержит:If the first host is located in a domain that uses the Restricted Cone NAT translator or Port-Restricted Cone NAT translator, and the second host is located in a domain that uses the Restricted Cone NAT translator or Port-Restricted Cone NAT translator, the data packet is transmitted by the first and second hosts to each other UDP protocol after receiving a synchronization data packet contains:

передачу первым хостом после получения пакета данных синхронизации пакета данных протокола UDP второму хосту в соответствии с полученной адресной информацией второго хоста;transmitting by the first host after receiving the synchronization data packet a UDP protocol data packet to the second host in accordance with the received address information of the second host;

и передачу вторым хостом после получения пакета данных синхронизации пакета данных протокола UDP первому хосту в соответствии с полученной адресной информацией первого хоста.and transmitting by the second host after receiving the synchronization data packet a UDP protocol data packet to the first host in accordance with the obtained address information of the first host.

Если первый хост расположен в домене, использующем транслятор Restricted Cone NAT или транслятор Port-Restricted Cone NAT, и второй хост расположен в домене, использующем транслятор Restricted Cone NAT или транслятор Port-Restricted Cone NAT, то передача первым и вторым хостами друг другу пакета данных протокола UDP после получения пакета данных синхронизации содержит:If the first host is located in a domain that uses the Restricted Cone NAT translator or Port-Restricted Cone NAT translator, and the second host is located in a domain that uses the Restricted Cone NAT translator or Port-Restricted Cone NAT translator, the data packet is transmitted by the first and second hosts to each other UDP protocol after receiving a synchronization data packet contains:

передачу вторым хостом после получения пакета данных синхронизации пакета данных протокола UDP первому хосту в соответствии с полученной адресной информацией первого хоста;transmitting by the second host after receiving the synchronization data packet a UDP protocol data packet to the first host in accordance with the received address information of the first host;

и передачу первым хостом после получения пакета данных синхронизации пакета данных протокола UDP второму хосту в соответствии с полученной адресной информацией второго хоста.and transmitting by the first host after receiving the synchronization data packet a UDP protocol data packet to the second host in accordance with the obtained address information of the second host.

Адресная информация содержит по меньшей мере IP-адрес в сети общего доступа и номер порта.The address information contains at least an IP address in the public network and a port number.

Кроме того, адресная информация включает локальный IP-адрес и номер порта.In addition, the address information includes the local IP address and port number.

Заявленная система установления соединения Р2Р содержит сервер, первый хост и второй хост;The claimed P2P connection establishment system comprises a server, a first host and a second host;

причем сервер после получения запроса синхронизации, переданного первым хостом, передает каждому из указанных первого и второго хостов пакет данных синхронизации, содержащий по меньшей мере адресную информацию другого хоста из указанных первого и второго хостов;moreover, the server after receiving a synchronization request transmitted by the first host, transmits to each of said first and second hosts a synchronization data packet containing at least address information of another host from said first and second hosts;

и первый и второй хосты после получения пакета данных синхронизации передают друг другу пакет данных протокола UDP (протокола пользовательских дейтафамм) в соответствии с полученной адресной информацией другого хоста из указанных первого и второго хостов.and the first and second hosts, after receiving the synchronization data packet, transmit to each other a UDP protocol data packet (User Datagram Protocol) in accordance with the received address information of another host from the indicated first and second hosts.

Заявленный способ установления соединения Р2Р содержит:The claimed method of establishing a connection P2P contains:

прием первым хостом от сервера адресной информации второго хоста и информации о трансляторе NAT (трансляторе сетевых адресов), используемом в сети, где расположен второй хост;receiving the first host from the server address information of the second host and information about the NAT translator (network address translator) used in the network where the second host is located;

и если второй хост расположен в сети общего доступа или в домене, использующем транслятор Full Cone NAT (Полный Конусный Транслятор NAT), то передачу первым хостом пакета данных протокола UDP второму хосту в соответствии с принятой адресной информацией второго хоста;and if the second host is located on a shared network or in a domain using the Full Cone NAT translator, then the first host transmits a UDP protocol data packet to the second host in accordance with the received address information of the second host;

и если второй хост не расположен ни в сети общего доступа, ни в домене, использующем транслятор Full Cone NAT, то определение первым хостом информации о трансляторе NAT, используемом в сети, где расположен первый хост;and if the second host is neither located in the public network nor in the domain using the Full Cone NAT translator, then the first host determines the information about the NAT translator used in the network where the first host is located;

если первый хост расположен в сети общего доступа или в домене, использующем транслятор Full Cone NAT, то подачу через сервер первым хостом второму хосту команды на передачу пакета данных протокола UDP первому хосту;if the first host is located on a public network or in a domain using the Full Cone NAT translator, then the first host sends a command to the second host to transmit the UDP protocol data packet to the first host through the server;

и если первый хост не расположен ни в сети общего доступа, ни в домене, использующем транслятор Full Cone NAT, то выполнение следующих действий:and if the first host is neither located in the public network, nor in the domain using the Full Cone NAT translator, then the following steps:

передачу первым хостом запроса синхронизации на сервер после получения этого запроса синхронизации;the first host transmits a synchronization request to the server after receiving this synchronization request;

передачу сервером на каждый из указанных первого и второго хостов пакета данных синхронизации, содержащего по меньшей мере адресную информацию другого хоста из указанных первого и второго хостов;a server transmitting to each of said first and second hosts a synchronization data packet containing at least address information of another host from said first and second hosts;

и передачу после получения пакета данных синхронизации первым и вторым хостами друг другу пакета данных протокола UDP в соответствии с полученной адресной информацией другого хоста из указанных первого и второго хостов.and transmitting after receiving the synchronization data packet by the first and second hosts to each other, a UDP protocol data packet in accordance with the received address information of another host from the indicated first and second hosts.

Из приведенной схемы видно, что согласно заявленному способу оба хоста посылают друг другу пакет данных протокола UDP, поэтому транслятором NAT принятый пакет данных рассматривается как допустимый, потому что пакет данных передан другому хосту от указанных первого и второго хостов во время приема пакета данных от этого другого хоста. Следовательно, между двумя хостами может быть успешно установлено соединение Р2Р. Таким образом решается проблема известного уровня техники, связанная с невозможностью успешного установления соединения Р2Р, если какой-либо хост расположен в домене с использованием трансляторов Restricted Cone NAT или Port-Restricted Cone NAT, отвергающих нежелательные пакеты данных. Кроме того, когда один хост расположен в домене с использованием транслятора Symmetric NAT с заменой портов, а другой хост расположен в домене с использованием транслятора Restricted Cone NAT, то соединение Р2Р также может быть успешно установлено. В результате степень успеха установления соединений Р2Р значительно возрастает.It can be seen from the above diagram that according to the claimed method, both hosts send each other a UDP protocol data packet, therefore, the NAT translator considers the received data packet to be valid, because the data packet was transferred to another host from the indicated first and second hosts while receiving the data packet from this other the host. Therefore, a P2P connection can be successfully established between the two hosts. This solves the problem of the prior art related to the impossibility of successfully establishing a P2P connection if a host is located in a domain using Restricted Cone NAT or Port-Restricted Cone NAT translators that reject unwanted data packets. In addition, when one host is located in a domain using a Symmetric NAT translator with port replacement, and another host is located in a domain using a Restricted Cone NAT translator, a P2P connection can also be successfully established. As a result, the degree of success of establishing P2P compounds increases significantly.

Краткое описание чертежейBrief Description of the Drawings

Фиг.1 иллюстрирует схему соединения хостов сети в режиме клиент/сервер.Figure 1 illustrates the connection diagram of the network hosts in the client / server mode.

Фиг.2 иллюстрирует схему соединения хостов сети в режиме Р2Р.Figure 2 illustrates a connection diagram of network hosts in P2P mode.

Фиг.3 иллюстрирует схему установления соединения Р2Р в активном режиме в соответствии с известным уровнем техники.Figure 3 illustrates a connection diagram of a P2P connection in the active mode in accordance with the prior art.

Фиг.4 иллюстрирует схему установления соединения Р2Р в пассивном режиме в соответствии с известным уровнем техники.Figure 4 illustrates a P2P connection establishment scheme in a passive mode in accordance with the prior art.

Фиг.5 иллюстрирует схему установления соединения Р2Р в синхронном режиме в соответствии с настоящим изобретением.Figure 5 illustrates a P2P connection establishment scheme in synchronous mode in accordance with the present invention.

Фиг.6 изображает алгоритм установления соединения Р2Р в синхронном режиме в соответствии с настоящим изобретением.6 depicts an algorithm for establishing a P2P connection in synchronous mode in accordance with the present invention.

Описание вариантов выполнения изобретенияDescription of embodiments of the invention

Далее изобретение описано более подробно на примере некоторых вариантов его выполнения, которые раскрыты со ссылкой на приложенные чертежи и позволяют полнее понять цели, техническую сущность и преимущества данного изобретения. Необходимо иметь в виду, что предложенные варианты выполнения использованы только для пояснения сути изобретения и не должны расцениваться как ограничение объема его правовой охраны.Further, the invention is described in more detail by the example of some variants of its implementation, which are disclosed with reference to the attached drawings and allow a more complete understanding of the objectives, technical essence and advantages of this invention. It must be borne in mind that the proposed embodiments are used only to explain the essence of the invention and should not be construed as limiting the scope of its legal protection.

В изобретении предложен способ установления соединения Р2Р в синхронном режиме (см. фиг.5). Если требуется установить соединение Р2Р с хостом В, то хост А сначала передает на сервер пакет данных запроса синхронизации. При получении пакета данных запроса синхронизации сервер передает каждому из хостов А и В пакет данных синхронизации, содержащий сетевую информацию другого хоста. И после получения этих пакетов данных синхронизации хосты А и В передают друг другу пакет данных протокола UDP (протокола пользовательских дейтаграмм). После получения пакета данных протокола UDP, переданного другой стороной, хосты А и В передают друг другу ответный пакет данных протокола UDP.The invention provides a method for establishing a P2P connection in synchronous mode (see FIG. 5). If you want to establish a P2P connection with host B, then host A first sends a synchronization request data packet to the server. Upon receipt of the synchronization request data packet, the server transmits to each of the hosts A and B a synchronization data packet containing the network information of the other host. And after receiving these synchronization data packets, hosts A and B transmit to each other a UDP protocol data packet (User Datagram Protocol). After receiving the UDP protocol data packet transmitted by the other side, hosts A and B transmit to each other a UDP protocol response data packet.

Фиг.6 изображает алгоритм установления соединения Р2Р в синхронном режиме в соответствии с настоящим изобретением. Как следует из фиг.6, способ включает в себя следующие этапы.6 depicts an algorithm for establishing a P2P connection in synchronous mode in accordance with the present invention. As follows from Fig.6, the method includes the following steps.

На этапе 601 хост А и хост В регистрируются на сервере, который сохраняет глобальные IP-адреса и глобальные номера портов, локальные IP-адреса и локальные номера портов и сетевые идентификаторы хоста А и хоста В.At step 601, host A and host B are registered on a server that stores global IP addresses and global port numbers, local IP addresses and local port numbers, and network identifiers of host A and host B.

На этапе 602 при попытке установить соединение Р2Р с хостом В хост А передает на сервер пакет данных запроса синхронизации, содержащий по меньшей мере локальные IP-адрес и номер порта хоста А, глобальные IP-адрес и номер порта хоста А и сетевой идентификатор хоста В.At 602, when attempting to establish a P2P connection with host B, host A transmits to the server a synchronization request data packet containing at least the local IP address and port number of host A, the global IP address and port number of host A, and the network identifier of host B.

На этапе 603 после получения пакета данных запроса синхронизации от хоста А сервер направляет каждому из хостов А и В пакет данных синхронизации. Пакет данных синхронизации, переданный хосту А, содержит по меньшей мере глобальные IP-адрес и номер порта хоста В и локальные IP-адрес и номер порта хоста В, тогда как пакет данных синхронизации, переданный хосту В, содержит по меньшей мере глобальные IP-адрес и номер порта хоста А и локальные IP-адрес и номер порта хоста А. Далее выполняются этапы 604 и 606.At 603, after receiving the synchronization request data packet from host A, the server sends each of the hosts A and B a synchronization data packet. The synchronization data packet transmitted to host A contains at least a global IP address and port number of host B and the local IP address and port number of host B, while the synchronization data packet transmitted to host B contains at least a global IP address and port number of host A and the local IP address and port number of host A. Next, steps 604 and 606 are performed.

На этапе 604 после получения пакета данных синхронизации, переданного сервером, хост А направляет хосту В пакет данных протокола UDP, используя IP-адреса и номера портов хоста В в сети общего доступа и в частной сети.At 604, after receiving the synchronization data packet transmitted by the server, host A sends UDP protocol data packet to host B using the IP addresses and port numbers of host B on the public network and on the private network.

На этапе 605 после получения пакета данных протокола UDP, переданного хостом А, хост В возвращает хосту А ответный пакет данных, принимаемый транслятором NAT той сети, где расположен хост А, поскольку хост А уже передал пакет данных протокола UDP хосту В. Затем хост А завершает процесс.In step 605, after receiving the UDP protocol data packet transmitted by host A, host B returns to host A a response data packet received by the NAT translator of the network where host A is located, since host A has already transmitted the UDP protocol data packet to host B. Then, host A completes process.

На этапе 606 при получении пакета данных синхронизации, переданного сервером, хост В принимает решение, устанавливать ли соединение Р2Р с хостом А, и выполняет этап 607 при положительном решении, в противном случае завершает процесс и соединение Р2Р не устанавливается.At step 606, upon receipt of the synchronization data packet transmitted by the server, host B decides whether to establish a P2P connection with host A, and performs step 607 if a positive decision is made, otherwise the process ends and the P2P connection is not established.

На этапе 607 хост В направляет пакет данных протокола UDP хосту А, используя IP-адреса и номера портов сети общего доступа и частной сети хоста А.At step 607, host B sends the UDP protocol data packet to host A using the IP addresses and port numbers of the public network and private network of host A.

На этапе 608 после получения пакета данных протокола UDP, переданного хостом В, хост А возвращает хосту В ответный пакет данных, принимаемый также транслятором NAT той сети, где расположен хост В, потому что хост В уже передал пакет данных протокола UDP хосту А.At 608, after receiving the UDP protocol data packet transmitted by host B, host A returns to host B a response data packet, also received by the NAT translator of the network where host B is located, because host B has already transmitted the UDP protocol data packet to host A.

Таким образом, процесс установления соединения Р2Р между хостами А и В завершается.Thus, the process of establishing a P2P connection between hosts A and B is completed.

Далее анализируется результаты, обеспечиваемые описанной выше схемой.Next, the results provided by the above scheme are analyzed.

Если хосты А и В расположены в сети общего доступа или в доменах, использующих транслятор Full Cone NAT, то в соответствии с настоящим изобретением соединение Р2Р может быть успешно установлено в синхронном режиме установления соединения Р2Р.If hosts A and B are located on a public network or in domains using a Full Cone NAT translator, then in accordance with the present invention, a P2P connection can be successfully established in a synchronous P2P connection establishment mode.

Если хост А расположен в домене, использующем трансляторы Restricted Cone NAT, Port-Restricted Cone NAT или Symmetric NAT, а хост В расположен в сети общего доступа или в домене, использующем транслятор Full Cone NAT, то соединение Р2Р может быть успешно установлено, если этап 604 выполняется перед этапом 608, т.е. до того, как хост А получит пакет данных протокола UDP, переданный хостом В, хост А должен уже передать пакет данных протокола UDP хосту В. На практике для обеспечения передачи хостом А пакета данных протокола UDP хосту В до получения хостом А пакета данных протокола UDP от хоста В необходимо запретить хосту В передавать пакет данных протокола UDP хосту А, пока хост А не передаст пакет данных протокола UDP хосту В.If host A is located in a domain using Restricted Cone NAT, Port-Restricted Cone NAT, or Symmetric NAT translators, and host B is located on a public network or in a domain using Full Cone NAT translator, then a P2P connection can be successfully established if the step 604 is performed before step 608, i.e. before host A receives the UDP protocol data packet transmitted by host B, host A should already transmit the UDP protocol data packet to host B. In practice, to ensure that host A transmits the UDP protocol data packet to host B before host A receives the UDP protocol data packet host B needs to prevent host B from transmitting the UDP protocol data packet to host A until host A sends the UDP protocol data packet to host B.

Если хост А расположен в сети общего доступа или в домене, использующем транслятор Full Cone NAT, а хост В расположен в домене, использующем трансляторы Restricted Cone NAT, Port-Restricted Cone NAT или Symmetric NAT, то соединение Р2Р может быть успешно установлено, если этап 607 выполняется перед этапом 605, т.е. хост В уже должен передать пакет данных протокола UDP хосту А до того, как хост В получит пакет данных протокола UDP, переданный хостом А. На практике для обеспечения передачи хостом В пакета данных протокола UDP хосту А до получения пакета данных протокола UDP от хоста А необходимо запретить хосту А передачу пакета данных протокола UDP хосту В, пока хост В не передаст пакет данных протокола UDP хосту А.If host A is located on a public network or in a domain using the Full Cone NAT translator, and host B is located in a domain using the Restricted Cone NAT, Port-Restricted Cone NAT, or Symmetric NAT translators, then a P2P connection can be successfully established if the step 607 is performed before step 605, i.e. host B should already transmit the UDP protocol data packet to host A before host B receives the UDP protocol data packet transmitted by host A. In practice, to ensure that host B transmits the UDP protocol data packet to host A before receiving the UDP protocol data packet from host A prevent host A from transmitting the UDP protocol data packet to host B until host B sends the UDP protocol data packet to host A.

Если хост А расположен в домене, использующем трансляторы Restricted Cone NAT или Port-Restricted Cone NAT, и хост В расположен в домене, использующем трансляторы Restricted Cone NAT или Port-Restricted Cone NAT, то соединение Р2Р может быть успешно установлено, если этап 607 выполняется перед этапом 605 или этап 604 выполняется перед этапом 608. На практике можно запретить хосту В передачу пакета данных протокола UDP хосту А до передачи хостом А пакета данных протокола UDP хосту В или запретить хосту А передачу пакета данных протокола UDP хосту В до передачи хостом В пакета данных протокола UDP хосту А.If host A is located in a domain using Restricted Cone NAT or Port-Restricted Cone NAT translators, and host B is located in a domain using Restricted Cone NAT or Port-Restricted Cone NAT translators, then a P2P connection can be successfully established if step 607 is performed before step 605 or step 604 is performed before step 608. In practice, you can prevent host B from transmitting a UDP protocol data packet to host A before host A sends a UDP protocol data packet to host B or block host A from transmitting a UDP protocol data packet to host B before packet B sends protocol data UDP to host A.

Если любой их хостов А или В расположен в домене, использующем транслятор Symmetric NAT, то соединение Р2Р также может быть успешно установлено в следующих двух случаях.If any of their hosts A or B is located in a domain using the Symmetric NAT translator, then a P2P connection can also be successfully established in the following two cases.

Случай 1. Если один из хостов А или В расположен в домене с использованием транслятора Symmetric NAT с заменой портов, а другой хост - в домене с использованием транслятора Restricted NAT, то соединение Р2Р между этими хостами может быть установлено, потому что транслятор Symmetric NAT не меняет глобальный IP-адрес источника, с которого передаются пакеты данных, и следовательно, транслятор Restricted NAT как противоположная сторона примет пакеты данных.Case 1. If one of the hosts A or B is located in the domain using the Symmetric NAT translator with port replacement, and the other host is in the domain using the Restricted NAT translator, then the P2P connection between these hosts can be established because the Symmetric NAT translator is not changes the global IP address of the source from which data packets are transmitted, and therefore, the Restricted NAT translator will accept data packets as the opposite side.

Случай 2. Соединение Р2Р между хостами может быть установлено в тех системах, которые отображают IP-адрес и номер порта в режиме транслятора Port-Restricted Cone NAT, предпочтительно в случае обнаружения транслятора Symmetric NAT, и в которых режимы Symmetric, например iptables, используются только при вероятности возникновения конфликта.Case 2: A P2P connection between hosts can be established on systems that display the IP address and port number in the Port-Restricted Cone NAT translator mode, preferably in the case of a Symmetric NAT translator, and in which Symmetric modes, such as iptables, are used only with the likelihood of a conflict.

Из проведенного анализа видно, что установление соединения Р2Р в синхронном режиме согласно настоящему изобретению позволяет решить по меньшей мере проблему невозможности установления соединения Р2Р при расположении двух хостов в доменах с использованием трансляторов Restricted Cone NAT или Port-Restricted Cone NAT, если каждый из обоих хостов уже послал пакет данных другому хосту во время приема пакета данных от этого другого хоста. Как следует из фиг.5, условие заключается в том, чтобы сумма времени, необходимого серверу для передачи пакета данных синхронизации хосту А, и времени, необходимого хосту А для передачи пакета данных протокола UDP хосту В, превышала время, необходимое серверу для передачи пакета данных синхронизации хосту В. На практике это условие реализовать легко, поэтому настоящее изобретение обеспечивает более часто успешное установление соединений Р2Р, т.е.увеличивает степень успешности установления соединений Р2Р.The analysis shows that the establishment of a P2P connection in synchronous mode according to the present invention allows to solve at least the problem of the impossibility of establishing a P2P connection when two hosts are located in domains using Restricted Cone NAT or Port-Restricted Cone NAT translators, if each of both hosts is already sent a data packet to another host while receiving a data packet from this other host. As follows from figure 5, the condition is that the sum of the time required by the server to transmit the synchronization data packet to host A, and the time required by host A to transmit the UDP protocol data packet to host B, should exceed the time required by the server to transmit the data packet synchronization to host B. In practice, this condition is easy to implement, therefore, the present invention provides more frequently successful establishment of P2P connections, i.e., increases the degree of success of establishing P2P connections.

Кроме того, в изобретении предложена комбинированная схема, объединяющая описанную выше схему одновременной передачи пакетов со схемой установления соединений Р2Р, соответствующей предыдущему уровню техники. Эта схема подробно описана далее.In addition, the invention provides a combined circuit combining the above-described simultaneous packet transmission scheme with a P2P connection setup scheme according to the prior art. This scheme is described in detail below.

Хост А получает от сервера адресную информацию хоста В и тип транслятора NAT, используемого в сети, где расположен хост В. Если хост В расположен в сети общего доступа или в сети, использующей тип транслятора Full Cone NAT, то хост А использует активный режим (см. фиг.3). Как показано на фиг.3, хост А посылает пакет данных непосредственно хосту В, используя адресную информацию хоста В. Хост В возвращает ответный пакет хосту А. Таким образом, устанавливается соединение Р2Р.Host A receives from the server the address information of host B and the type of NAT translator used in the network where host B is located. If host B is located in a public network or in a network using the Full Cone NAT translator type, then host A uses active mode (see Fig. 3). As shown in FIG. 3, host A sends a data packet directly to host B using the address information of host B. Host B returns a response packet to host A. Thus, a P2P connection is established.

Если хост В не расположен ни в сети общего доступа, ни в домене, использующем транслятор Full Cone NAT, то хост А определяет, расположен ли хост А в сети общего доступа или в домене, использующем транслятор Full Cone NAT.If host B is located neither in the public network nor in the domain using the Full Cone NAT translator, then host A determines whether host A is located in the public network or in the domain using the Full Cone NAT translator.

Если хост А расположен в сети общего пользования, но не в домене, использующем транслятор Full Cone NAT, то хост А применяет пассивный режим (см. фиг.4). Как показано на фиг.4, хост А через сервер предписывает хосту В сначала передать пакет данных хосту А. Хост А возвращает ответный пакет хосту В, устанавливая таким образом соединение Р2Р.If host A is located in a public network, but not in a domain using the Full Cone NAT translator, then host A uses passive mode (see FIG. 4). As shown in FIG. 4, host A through the server instructs host B to first transmit the data packet to host A. Host A returns a response packet to host B, thus establishing a P2P connection.

Если хост А не находится ни в сети общего доступа, ни в домене, использующем транслятор Full Cone NAT, то применяется описанная выше схема одновременной передачи пакетов данных. В соответствии с этой схемой хост А передает запрос синхронизации на сервер, затем сервер одновременно передает каждому из хостов А и В пакет данных синхронизации, содержащий по меньшей мере адресную информацию другого хоста. При получении пакета данных синхронизации хосты А и В передают друг другу пакет данных.If host A is neither in the public network nor in the domain using the Full Cone NAT translator, then the above-described scheme of simultaneous transmission of data packets is applied. In accordance with this scheme, host A transmits a synchronization request to the server, then the server simultaneously transmits to each of the hosts A and B a synchronization data packet containing at least the address information of the other host. Upon receipt of the synchronization data packet, hosts A and B transmit each other a data packet.

В данной заявке описаны только предпочтительные варианты изобретения, однако объем правовой охраны изобретения не ограничивается только этими вариантами. Все изменения, равноценные замены или усовершенствования, не выходящие за рамки принципов настоящего изобретения, должны рассматриваться как подпадающие под объем его правовой охраны.Only preferred embodiments of the invention are described in this application, however, the scope of legal protection of the invention is not limited to these options only. All changes, equivalent replacements or improvements, not going beyond the principles of the present invention, should be construed as falling within the scope of its legal protection.

Список используемых обозначенийList of symbols used

basic NAT - Базовый NATbasic NAT - Basic NAT

Cone NAT - Конусный NATCone NAT - Cone NAT

Full Cone NAT - Полный Конусный NATFull Cone NAT - Full Cone NAT

NAT - транслятор сетевых адресов (Network Address Translator)NAT - Network Address Translator

P2P - одноранговый (Peer to Peer)P2P - Peer to Peer

Port-Restricted Cone NAT - Ограниченный по Портам Конусный NATPort-Restricted Cone NAT - Port-Restricted Cone NAT

Restricted Cone NAT - Ограниченный Конусный NATRestricted Cone NAT - Limited Cone NAT

Symmetric NAT - Симметричный NATSymmetric NAT - Symmetric NAT

UDP - протокол пользовательских дейтаграмм (User Data Protocol)UDP - User Data Protocol

Claims (12)

1. Способ установления однорангового соединения (соединения Р2Р), включающий следующие этапы:
передачу сервером, после получения запроса синхронизации от первого хоста, каждому из первого и второго хостов пакета данных синхронизации, содержащего, по меньшей мере, адресную информацию другого хоста из указанных первого и второго хостов;
и передачу, после получения указанного пакета данных синхронизации, первым и вторым хостами друг другу пакета данных протокола UDP (протокола пользовательских дейтаграмм) в соответствии с полученной адресной информацией другого хоста из указанных первого и второго хостов.
1. A method for establishing a peer-to-peer connection (P2P connection), comprising the following steps:
transmitting by the server, after receiving a synchronization request from the first host, to each of the first and second hosts a synchronization data packet containing at least the address information of another host from said first and second hosts;
and transmitting, after receiving said synchronization data packet, the first and second hosts to each other a UDP protocol data packet (User Datagram Protocol) in accordance with the received address information of another host from said first and second hosts.
2. Способ по п.1, дополнительно содержащий:
регистрацию первого и второго хостов на сервере перед передачей с первого хоста на сервер запроса синхронизации,
и сохранение сервером сетевых идентификаторов и адресной информации первого и второго хостов, соответственно.
2. The method according to claim 1, additionally containing:
registering the first and second hosts on the server before transferring the synchronization request from the first host to the server,
and storing the server network identifiers and address information of the first and second hosts, respectively.
3. Способ по п.1, в котором запрос синхронизации от первого хоста содержит, по меньшей мере, сетевой идентификатор и адресную информацию второго хоста.3. The method according to claim 1, wherein the synchronization request from the first host comprises at least a network identifier and address information of the second host. 4. Способ по п.1, дополнительно содержащий:
определение вторым хостом, устанавливать ли соединение Р2Р с первым хостом после получения пакета данных синхронизации, и направление пакета данных протокола UDP первому хосту, если принято решение устанавливать соединение Р2Р с первым хостом, или завершение процесса, если принято решение не устанавливать соединение Р2Р с первым хостом.
4. The method according to claim 1, additionally containing:
determining by the second host whether to establish a P2P connection with the first host after receiving the synchronization data packet, and sending the UDP protocol data packet to the first host, if it was decided to establish a P2P connection to the first host, or to end the process if it was decided not to establish a P2P connection to the first host .
5. Способ по п.1, дополнительно содержащий:
передачу первым и вторым хостами друг другу ответного пакета данных после получения пакета данных протокола UDP, переданного другим хостом из указанных первого и второго хостов.
5. The method according to claim 1, additionally containing:
the first and second hosts transmitting a response data packet to each other after receiving a UDP protocol data packet transmitted by another host from said first and second hosts.
6. Способ по п.1, в котором, если первый хост расположен в домене, использующем транслятор Restricted Cone NAT (Ограниченный Конусный Транслятор Сетевых Адресов), Port-Restricted Cone NAT (Ограниченный по Портам Конусный NAT) или Symmetric NAT (Симметричный NAT), а второй хост расположен в сети общего доступа или в домене, использующем транслятор Full Cone NAT, то передача первым и вторым хостами друг другу пакета данных протокола UDP, после получения пакета данных синхронизации, содержит:
передачу первым хостом, после получения пакета данных синхронизации, пакета данных протокола UDP второму хосту в соответствии с полученной адресной информацией второго хоста;
и передачу вторым хостом, после получения пакета данных синхронизации, пакета данных протокола UDP первому хосту в соответствии с полученной адресной информацией первого хоста.
6. The method according to claim 1, in which if the first host is located in a domain using the Restricted Cone NAT translator, Port-Restricted Cone NAT (Port Cone NAT limited) or Symmetric NAT (Symmetric NAT) , and the second host is located in a public network or in a domain using the Full Cone NAT translator, then the transmission of the UDP protocol data packet to each other by the first and second hosts, after receiving the synchronization data packet, contains:
transmitting, by the first host, after receiving the synchronization data packet, a UDP protocol data packet to the second host in accordance with the received address information of the second host;
and transmitting by the second host, after receiving the synchronization data packet, the UDP protocol data packet to the first host in accordance with the received address information of the first host.
7. Способ по п.1, в котором, если первый хост расположен в сети общего доступа или в домене, использующем транслятор Full Cone NAT, а второй хост расположен в домене, использующем трансляторы Restricted Cone NAT или Port-Restricted Cone NAT или Symmetric NAT, то передача первым и вторым хостами друг другу пакета данных протокола UDP, после получения пакета данных синхронизации, содержит:
передачу вторым хостом, после получения пакета данных синхронизации, пакета данных протокола UDP первому хосту в соответствии с полученной адресной информацией первого хоста;
и передачу первым хостом, после получения пакета данных синхронизации, пакета данных протокола UDP второму хосту в соответствии с полученной адресной информацией второго хоста.
7. The method according to claim 1, wherein if the first host is located in a public network or in a domain using a Full Cone NAT translator, and the second host is located in a domain using a Restricted Cone NAT or Port-Restricted Cone NAT or Symmetric NAT translator , the transmission of the UDP protocol data packet by the first and second hosts to each other, after receiving the synchronization data packet, contains:
transmitting by the second host, after receiving the synchronization data packet, a UDP protocol data packet to the first host in accordance with the received address information of the first host;
and transmitting by the first host, upon receipt of the synchronization data packet, a UDP protocol data packet to the second host in accordance with the obtained address information of the second host.
8. Способ по п.1, в котором, если первый хост расположен в домене, использующем транслятор Restricted Cone NAT или транслятор Port-Restricted Cone NAT, и второй хост расположен в домене, использующем транслятор Restricted Cone NAT или транслятор Port-Restricted Cone NAT, то передача первым и вторым хостами друг другу пакета данных протокола UDP, после получения пакета данных синхронизации, содержит:
передачу первым хостом, после получения пакета данных синхронизации, пакета данных протокола UDP второму хосту в соответствии с полученной адресной информацией второго хоста;
и передачу вторым хостом, после получения пакета данных синхронизации, пакета данных протокола UDP первому хосту в соответствии с полученной адресной информацией первого хоста.
8. The method according to claim 1, wherein if the first host is located in a domain using a Restricted Cone NAT translator or Port-Restricted Cone NAT translator, and the second host is located in a domain using a Restricted Cone NAT translator or Port-Restricted Cone NAT translator , the transmission of the UDP protocol data packet by the first and second hosts to each other, after receiving the synchronization data packet, contains:
transmitting, by the first host, after receiving the synchronization data packet, a UDP protocol data packet to the second host in accordance with the received address information of the second host;
and transmitting by the second host, after receiving the synchronization data packet, the UDP protocol data packet to the first host in accordance with the received address information of the first host.
9. Способ по любому из пп.1-8, в котором указанная адресная информация содержит, по меньшей мере, IP-адрес в сети общего доступа и номер порта.9. The method according to any one of claims 1 to 8, wherein said address information comprises at least an IP address in a public network and a port number. 10. Способ по п.9, в котором адресная информация дополнительно содержит локальный IP-адрес и номер порта.10. The method according to claim 9, in which the address information further comprises a local IP address and port number. 11. Система установления однорангового соединения (соединения Р2Р), содержащая сервер, первый хост и второй хост;
причем сервер после получения запроса синхронизации, переданного первым хостом, передает каждому из указанных первого и второго хостов пакет данных синхронизации, содержащий, по меньшей мере, адресную информацию другого хоста из указанных первого и второго хостов;
и первый и второй хосты после получения пакета данных синхронизации передают друг другу пакет данных протокола UDP (протокола пользовательских дейтаграмм) в соответствии с полученной адресной информацией другого хоста из указанных второго и первого хостов.
11. A system for establishing a peer-to-peer connection (P2P connection), comprising a server, a first host and a second host;
moreover, the server after receiving a synchronization request transmitted by the first host, transmits to each of said first and second hosts a synchronization data packet containing at least the address information of another host from said first and second hosts;
and the first and second hosts, after receiving the synchronization data packet, transmit to each other a UDP protocol data packet (User Datagram Protocol) in accordance with the received address information of the other host from the indicated second and first hosts.
12. Способ установления однорангового соединения (соединения Р2Р), содержащий:
прием первым хостом от сервера адресной информации второго хоста и информации о трансляторе NAT (трансляторе сетевых адресов), используемом в сети, где расположен второй хост;
и если второй хост расположен в сети общего доступа или в домене, использующем транслятор Full Cone NAT (Полный Конусный Транслятор NAT), то передачу первым хостом пакета данных протокола UDP второму хосту в соответствии с принятой адресной информацией второго хоста;
но если второй хост не расположен ни в сети общего доступа, ни в домене, использующем транслятор Full Cone NAT, то определение первым хостом информации о трансляторе NAT, используемом в сети, где расположен первый хост;
если первый хост расположен в сети общего доступа или в домене, использующем транслятор Full Cone NAT, то подачу через сервер первым хостом второму хосту команды на передачу пакета данных протокола UDP первому хосту;
но если первый хост не расположен ни в сети общего доступа, ни в домене, использующем транслятор Full Cone NAT, то выполнение следующих действий:
передачу первым хостом запроса синхронизации на сервер после получения этого запроса синхронизации;
передачу сервером на каждый из указанных первого и второго хостов пакета данных синхронизации, содержащего, по меньшей мере, адресную информацию другого хоста из указанных первого и второго хостов;
и передачу, после получения пакета данных синхронизации, первым и вторым хостами друг другу пакета данных протокола UDP в соответствии с полученной адресной информацией другого хоста из указанных первого и второго хостов.
12. A method for establishing a peer-to-peer connection (P2P connection), comprising:
receiving the first host from the server address information of the second host and information about the NAT translator (network address translator) used in the network where the second host is located;
and if the second host is located on a shared network or in a domain using the Full Cone NAT translator, then the first host transmits a UDP protocol data packet to the second host in accordance with the received address information of the second host;
but if the second host is neither located on the public network nor in the domain using the Full Cone NAT translator, then the first host determines the information about the NAT translator used in the network where the first host is located;
if the first host is located on a public network or in a domain using the Full Cone NAT translator, then the first host sends a command to the second host to transmit the UDP protocol data packet to the first host through the server;
but if the first host is located neither in the public network, nor in the domain using the Full Cone NAT translator, then perform the following actions:
the first host transmits a synchronization request to the server after receiving this synchronization request;
a server transmitting to each of said first and second hosts a synchronization data packet containing at least address information of another host from said first and second hosts;
and transmitting, after receiving the synchronization data packet, the first and second hosts to each other the UDP protocol data packet in accordance with the received address information of the other host from said first and second hosts.
RU2008109140/09A 2005-08-18 2006-08-18 Method for making peer-to-peer connection and system designed for it RU2373654C1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200510092810.5A CN1917512B (en) 2005-08-18 2005-08-18 Method for establishing direct connected peer-to-peer channel
CN200510092810.5 2005-08-18

Publications (1)

Publication Number Publication Date
RU2373654C1 true RU2373654C1 (en) 2009-11-20

Family

ID=37738407

Family Applications (1)

Application Number Title Priority Date Filing Date
RU2008109140/09A RU2373654C1 (en) 2005-08-18 2006-08-18 Method for making peer-to-peer connection and system designed for it

Country Status (4)

Country Link
CN (1) CN1917512B (en)
BR (1) BRPI0616599A2 (en)
RU (1) RU2373654C1 (en)
WO (1) WO2007019809A1 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8060626B2 (en) * 2008-09-22 2011-11-15 Sony Computer Entertainment America Llc. Method for host selection based on discovered NAT type
CN101217536B (en) * 2007-12-28 2011-11-09 腾讯科技(深圳)有限公司 A method, system and client to traverse network address transferring device/firewall
CN101980508B (en) * 2010-11-01 2013-05-15 深圳市鼎盛威电子有限公司 Network adaptive operation mode on network monitoring system
CN103516795B (en) * 2013-09-26 2015-06-10 传线网络科技(上海)有限公司 Distributed network connectivity improving method and distributed network utilizing method
CN104660722A (en) * 2013-11-21 2015-05-27 倚强科技股份有限公司 Network connection method and network system thereof
CN110661860B (en) * 2019-09-18 2021-08-20 华为技术有限公司 Method for establishing call and call equipment
CN111506013A (en) * 2020-04-08 2020-08-07 上海汉枫电子科技有限公司 P L C device remote data communication implementation method based on virtual serial port
CN112804285B (en) * 2020-11-08 2023-08-04 北京明瑞之光科技有限公司 Landscape lighting system and file transmission method thereof
CN112468610B (en) * 2020-11-17 2023-06-06 杭州安恒信息安全技术有限公司 Data transmission method, monitoring node, monitoring server and monitoring network system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3917076B2 (en) * 2001-02-20 2007-05-23 アイボール ネットワークス インコーポレイテッド Method and apparatus for enabling data transmission through a firewall
CN1166124C (en) * 2002-09-16 2004-09-08 联想(北京)有限公司 Equipment peer-to-peer connection method in realizing dynamic network connection in home network
JP2004180003A (en) * 2002-11-27 2004-06-24 Kitt Peak:Kk Communication network system and communication connection method
US7899932B2 (en) * 2003-01-15 2011-03-01 Panasonic Corporation Relayed network address translator (NAT) traversal

Also Published As

Publication number Publication date
BRPI0616599A2 (en) 2011-06-28
WO2007019809A1 (en) 2007-02-22
CN1917512B (en) 2010-09-29
CN1917512A (en) 2007-02-21

Similar Documents

Publication Publication Date Title
RU2373654C1 (en) Method for making peer-to-peer connection and system designed for it
CN112911027B (en) Method and apparatus for establishing a media session
US10079803B2 (en) Peer-to-peer connection establishment using TURN
KR101099382B1 (en) Endpoint address change in a packet network
KR101727234B1 (en) Custodian routing with network address translation in content-centric networks
US8572172B2 (en) NAT traversal for media conferencing
EP3225014B1 (en) Source ip address transparency systems and methods
US8224985B2 (en) Peer-to-peer communication traversing symmetric network address translators
RU2543304C2 (en) Packet relay method and device
EP3720100A1 (en) Service request processing method and device
US20060056420A1 (en) Communication apparatus selecting a source address
KR20040107420A (en) Peep-to-peer name resolution wire protocol and message format data structure for use therein
US20080205388A1 (en) Discovery of network devices logically located between a client and a service
JP2013506358A (en) End-to-end call implementation method, end-to-end call terminal and system
JP2013506358A5 (en)
KR101727233B1 (en) Sip-based custodian routing in content-centric networks
US20190068694A1 (en) Load balancer for multipath-capable clients and servers
US11716222B2 (en) Communications bridge
Komu et al. Basic host identity protocol (HIP) extensions for traversal of network address translators
CN114866521B (en) Conference server
Komu et al. RFC 5770: Basic Host Identity Protocol (HIP) Extensions for Traversal of Network Address Translators