CN107547621B - Message forwarding method and device - Google Patents

Message forwarding method and device Download PDF

Info

Publication number
CN107547621B
CN107547621B CN201710501288.4A CN201710501288A CN107547621B CN 107547621 B CN107547621 B CN 107547621B CN 201710501288 A CN201710501288 A CN 201710501288A CN 107547621 B CN107547621 B CN 107547621B
Authority
CN
China
Prior art keywords
forwarding
terminal
management server
message
forwarding table
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201710501288.4A
Other languages
Chinese (zh)
Other versions
CN107547621A (en
Inventor
傅嘉嘉
王振
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201710501288.4A priority Critical patent/CN107547621B/en
Publication of CN107547621A publication Critical patent/CN107547621A/en
Application granted granted Critical
Publication of CN107547621B publication Critical patent/CN107547621B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a message forwarding method and a device, wherein the method is applied to a gateway in an LoRa network, and comprises the following steps: receiving an LoRa protocol message sent by a first terminal in the LoRa network; forwarding the loRa protocol message to a designated management server in the loRa network; receiving a first forwarding table item issued by the management server, and forwarding a data message according to the first forwarding table item; the first forwarding table entry is used to instruct the gateway to forward the data packet from the first terminal to the service server in the LoRa network allocated by the management server for the first terminal. Therefore, the invention can separate the forwarding table item managed by the management server to the gateway management, so that the gateway can directly forward the message according to the forwarding table item, thereby reducing the burden of the management server.

Description

Message forwarding method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for forwarding a packet.
Background
LoRaWAN (Long Range Area Network) is a protocol dedicated to low power clients and can be used for both mobile and fixed devices. The LoRaWAN network uses a star topology networking in which a gateway is responsible for forwarding data between a terminal and a server. All connections are generally bi-directional, but uplink communication from the terminal to the server is generally considered the primary data flow.
In a traditional LoRa network, only one gateway is deployed in the same area, according to the LoRa protocol, data messages reported by different tenant terminals can carry application identifiers (APP EUI) or device addresses (DevAddr) corresponding to the APP EUI to uniquely identify service servers associated with the terminals, and after receiving related data messages from the terminals transferred by the gateway, the servers distribute the related data messages to the corresponding service servers according to the APP EUI or the device addresses.
Therefore, all data messages in the LoRa network need to be processed and transferred by the same server, which results in higher performance pressure of the server; if the service server function is integrated on the server, adaptive development is carried out according to an operating system, a running environment and the like of the server, and the performance pressure of the server is still large.
Disclosure of Invention
In view of this, the present invention provides a message forwarding method and apparatus to solve the problem of excessive server load when the LoRa network is multiplexed.
Specifically, the invention is realized by the following technical scheme:
the invention provides a message forwarding method, which is applied to a gateway in an LoRa network and comprises the following steps:
receiving an LoRa protocol message sent by a first terminal in the LoRa network;
forwarding the loRa protocol message to a designated management server in the loRa network;
receiving a first forwarding table item issued by the management server, and forwarding a data message according to the first forwarding table item;
the first forwarding table entry is used to instruct the gateway to forward the data packet from the first terminal to the service server in the LoRa network allocated by the management server for the first terminal.
As an embodiment, the method further comprises:
when receiving a data message sent by a second terminal in the LoRa network, checking whether a second forwarding table entry for forwarding the data message from the second terminal exists locally;
if yes, forwarding the data message from the second terminal according to the second forwarding table item;
if not, forwarding the data message from the second terminal to the management server, and forwarding the data message to a service server in the LoRa network distributed by the management server for the second terminal by the management server for processing; receiving the second forwarding table item issued by the management server, and forwarding the data message according to the second forwarding table item;
the second forwarding table entry is used for instructing the gateway to forward the data packet from the second terminal to the service server allocated by the management server for the second terminal.
Based on the same conception, the invention also provides a message forwarding method, which is applied to a gateway in the LoRa network and comprises the following steps:
when receiving a data message sent by a terminal in the LoRa network, checking whether a forwarding table entry for forwarding the data message exists locally;
if yes, forwarding the data message according to the forwarding table entry;
if not, forwarding the data message to a designated management server in the LoRa network, and forwarding the data message to a service server in the LoRa network distributed by the management server for the terminal by the management server to be processed; receiving the forwarding table item issued by the management server, and forwarding a data message according to the forwarding table item;
the forwarding table entry is used for instructing the gateway to forward the data packet from the terminal to the service server allocated by the management server for the terminal.
Based on the same conception, the invention also provides a message forwarding method, which is applied to a management server in the LoRa network and comprises the following steps:
receiving a message from a terminal in the LoRa network, wherein the message is forwarded by a gateway in the LoRa network;
when the message is an LoRa protocol message, allocating an equipment address for the terminal, generating a forwarding table according to the equipment address and issuing the forwarding table to a gateway, wherein the forwarding table is used for indicating the gateway to forward the data message from the terminal to a service server in the LoRa network allocated to the terminal by the management server;
when the message is a data message, forwarding the data message to a service server in the LoRa network distributed by the management server for the terminal to process; and issuing the forwarding table entry to the gateway.
Based on the same conception, the invention also provides a message forwarding device, which is applied to a gateway in the LoRa network, and the device comprises:
a message receiving unit, configured to receive an LoRa protocol message sent by a first terminal in the LoRa network;
a message forwarding unit, configured to forward the LoRa protocol message to a specified management server in the LoRa network;
the table item receiving unit is used for receiving a first forwarding table item issued by the management server and forwarding a data message according to the first forwarding table item; the first forwarding table entry is used to instruct the gateway to forward the data packet from the first terminal to the service server in the LoRa network allocated by the management server for the first terminal.
As an embodiment, the message receiving unit is further configured to, when receiving a data message sent by a second terminal in the LoRa network, check whether a second forwarding table entry for forwarding the data message from the second terminal exists locally; if yes, forwarding the data message from the second terminal according to the second forwarding table item; if not, forwarding the data message from the second terminal to the management server, and forwarding the data message to a service server in the LoRa network distributed by the management server for the second terminal by the management server for processing; receiving the second forwarding table item issued by the management server, and forwarding the data message according to the second forwarding table item; the second forwarding table entry is used for instructing the gateway to forward the data packet from the second terminal to the service server allocated by the management server for the second terminal.
Based on the same conception, the invention also provides a message forwarding device, which is applied to a gateway in the LoRa network, and the device comprises:
a message receiving unit, configured to, when receiving a data message sent by a terminal in the LoRa network, check whether a forwarding entry for forwarding the data message exists locally;
the first forwarding unit is used for forwarding the data message according to a forwarding table entry when the forwarding table entry for forwarding the data message is checked to exist locally;
a second forwarding unit, configured to forward the data packet to a specified management server in the LoRa network when it is checked that a forwarding entry for forwarding the data packet does not exist locally, and forward the data packet to a service server in the LoRa network, where the service server is allocated by the management server for the terminal, for processing; receiving the forwarding table item issued by the management server, and forwarding a data message according to the forwarding table item; the forwarding table entry is used for instructing the gateway to forward the data packet from the terminal to the service server allocated by the management server for the terminal.
Based on the same conception, the invention also provides a message forwarding device, which is applied to a management server in the LoRa network, and comprises:
a message receiving unit, configured to receive a message from a terminal in the LoRa network, where the message is forwarded by a gateway in the LoRa network;
a first forwarding unit, configured to, when the packet is an LoRa protocol packet, allocate an equipment address to the terminal, generate a forwarding entry according to the equipment address, and issue the forwarding entry to a gateway, where the forwarding entry is used to instruct the gateway to forward a data packet from the terminal to a service server in the LoRa network allocated by the management server to the terminal;
a second issuing unit, configured to forward the data packet to a service server in the LoRa network allocated by the management server for the terminal to process when the packet is a data packet; and issuing the forwarding table entry to the gateway.
Therefore, the invention can make the gateway forward the LoRa protocol message to the designated management server in the LoRa network when receiving the LoRa protocol message sent by the terminal in the LoRa network under the wireless activation condition or the first packet data message sent by the terminal under the manual activation condition, and then forward the subsequent data message from the terminal to the service server in the LoRa network distributed by the management server for the terminal by receiving the forwarding table item sent by the management server. The invention can separate the forwarding table item which is managed by the management server and used for guiding the message forwarding to the gateway for management, so that the gateway can directly forward the message to the corresponding service server according to the forwarding table item, thereby reducing the burden of the management server. Therefore, the invention realizes the multi-tenant multiplexing of one LoRa network deployment and has higher processing performance.
Drawings
Fig. 1 is a schematic diagram of an LoRa network in an exemplary embodiment of the invention;
fig. 2 is a processing flow diagram of a message forwarding method in an exemplary embodiment of the invention;
fig. 3 is a flowchart illustrating another method for forwarding packets according to an exemplary embodiment of the present invention;
fig. 4 is a processing flow diagram of another message forwarding method in an exemplary embodiment of the invention;
FIG. 5 is a flow diagram of a message forwarding interaction in an exemplary embodiment of the invention;
FIG. 6 is another interactive flow diagram for message forwarding in an exemplary embodiment of the invention;
fig. 7a is a hardware structure diagram of a gateway where an instruction of a message forwarding apparatus is located in an exemplary embodiment of the present invention;
fig. 7b is a logical structure diagram of a message forwarding apparatus according to an exemplary embodiment of the present invention;
fig. 8a is a hardware structure diagram of a gateway where an instruction of another message forwarding apparatus is located in an exemplary embodiment of the present invention;
fig. 8b is a logical structure diagram of another message forwarding device according to an exemplary embodiment of the present invention;
fig. 9a is a hardware structure diagram of a management server where an instruction of a message forwarding apparatus is located in an exemplary embodiment of the present invention;
fig. 9b is a logic structure diagram of another message forwarding device in an exemplary embodiment of the present invention.
Detailed Description
In order to solve the problems in the prior art, the present invention provides a method and an apparatus for forwarding a packet, which enable a gateway to forward an LoRa protocol packet to a designated management server in an LoRa network when receiving the LoRa protocol packet sent by a terminal in the LoRa network under a wireless activation condition or the first packet data packet sent by the terminal under a manual activation condition, and then forward the subsequent data packet from the terminal to a service server in the LoRa network allocated by the management server for the terminal by receiving a forwarding entry issued by the management server. The invention can separate the forwarding table item which is managed by the management server and used for guiding the message forwarding to the gateway for management, so that the gateway can directly forward the message to the corresponding service server according to the forwarding table item, thereby reducing the burden of the management server. Therefore, the invention realizes the multi-tenant multiplexing of one LoRa network deployment and has higher processing performance.
Before explaining the embodiments of the present invention in detail, an application scenario of the embodiments of the present invention will be described. As shown in fig. 1, the major devices in the LoRa network environment to which the message forwarding method of the present invention is applied include: the system comprises an LoRa terminal (hereinafter referred to as a terminal), an LoRa gateway (hereinafter referred to as a gateway), a management server (designated in advance), and one or more service servers, such as a service server 1 and a service server 2, wherein the management server and the service server are deployed in parallel in the network and are respectively connected with the gateway, and the LoRa terminal and the LoRa gateway are configured to:
the management server is responsible for maintaining the mapping relation between the service server identifier and the service server port and the mapping relation between the equipment address of the terminal and the service server identifier; the service server is responsible for realizing application services;
the gateway is a LoRa network access device shared by multiple tenants;
the management server allocates the service server 1 to the terminal 1 and the service server 2 to the terminal 2.
Generally, the activation mode of the terminal includes two cases of wireless activation and manual activation, that is, the mode of accessing the LoRa network by the terminal includes wireless access of the LoRa network and manual access of the LoRa network. The following describes a specific implementation manner of the packet forwarding method in the gateway in the LoRa network, under two conditions of wireless activation and manual activation, respectively.
In the first case:
referring to fig. 2, a processing flow diagram of a packet forwarding method in an exemplary embodiment of the present invention is shown, where the method is applied to a gateway in an LoRa network, and the method includes:
step 201, receiving an LoRa protocol message sent by a first terminal in the LoRa network;
when the LoRa network of the present invention is in a wireless activation mode, a first packet of message sent by a terminal to a gateway is usually a protocol message, and the protocol message is used for performing access authentication on one hand, and for acquiring a device address, a random number and an APP-KEY of the terminal on the other hand, wherein the device address of the terminal is distributed by a management server and used as a source address for the terminal to communicate with other network elements in the LoRa network; the random number and the APP-KEY are used for generating a session KEY communicated with the service server, and when the terminal and the service server perform a session, the message is encrypted according to the session KEY, so that the network security is improved. After the terminal sends the protocol message and accesses successfully, the subsequent sent messages are all data messages interacted with the service server.
Step 202, forwarding the LoRa protocol packet to a designated management server in the LoRa network;
the gateway may forward the LoRa protocol packet to a designated management server in the LoRa network, where the management server is an LoRa server that is disposed in the LoRa network and used to authenticate the terminal and instruct packet forwarding. The management server can allocate the equipment address to the first terminal when the first terminal passes the authentication; and generating a first forwarding table entry according to the device address, where the first forwarding table entry is used to instruct the gateway to forward the data packet from the first terminal to a service server in the LoRa network allocated by the management server for the first terminal. The first forwarding table entry may include a device address of the first terminal and a service server identifier in the LoRa network, where the service server identifier is allocated by the management server to the first terminal. And then the management server issues the first forwarding table item to the gateway.
As an embodiment, when receiving the LoRa protocol packet, the management server may further authenticate the first terminal according to the LoRa protocol packet, and after the authentication is passed, further allocate a corresponding device address to the first terminal, carry the device address in a response packet, and send the response packet to the gateway, where the response packet further carries a random number and an APP-KEY for generating a session KEY; when the gateway receives the response packet, the gateway may forward the response packet to the first terminal, so that the first terminal obtains the device address allocated by the management server, and the random number and APP-KEY used for generating the session KEY.
Step 203, receiving a first forwarding table item issued by the management server, and forwarding a data message according to the first forwarding table item; the first forwarding table entry is used to instruct the gateway to forward the data packet from the first terminal to the service server in the LoRa network allocated by the management server for the first terminal.
And the gateway receives a first forwarding table item issued by the management server, wherein the first forwarding table item is used for indicating the gateway to forward the data message from the first terminal to a service server in the LoRa network, which is distributed by the management server for the first terminal. Since the gateway has recorded the forwarding table entry corresponding to the first terminal, when receiving the data packet subsequently sent by the first terminal, the gateway can forward the data packet to the service server in the LoRa network allocated by the management server for the first terminal according to the first forwarding table entry.
As an embodiment, when the gateway receives a data packet sent by a second terminal in the LoRa network, it may check whether a second forwarding table for forwarding the data packet from the second terminal exists locally, considering that a forwarding table recorded in the gateway may set an aging mechanism, may also be lost for some reason, and the like. If the second forwarding table entry exists, the gateway can forward the data message from the second terminal according to the second forwarding table entry; if a second forwarding table entry does not exist, for example, a second forwarding table entry corresponding to a second terminal recorded in the gateway is aged, the gateway needs to forward a data packet from the second terminal to the management server, and the management server forwards the data packet to a service server in the LoRa network allocated by the management server for the second terminal to process the data packet; receiving the second forwarding table item issued by the management server, and forwarding the data message according to the second forwarding table item; the second forwarding table entry is used for instructing the gateway to forward the data packet from the second terminal to the service server allocated by the management server for the second terminal.
By the method, under the condition of wireless activation, the gateway only needs to forward the loRa protocol message to the management server when receiving the loRa protocol message of the first terminal, so that the forwarding table item issued by the management server can be obtained, and the gateway is used for guiding the gateway to forward the data message of the first terminal, thereby greatly reducing the burden of the management server and improving the message forwarding efficiency.
In the second case:
referring to fig. 3, it is a processing flow chart of another packet forwarding method in an exemplary embodiment of the present invention, where the method is applied to a gateway in an LoRa network, and the method includes:
step 301, when receiving a data packet sent by a terminal in the LoRa network, checking whether a forwarding table entry for forwarding the data packet exists locally; if yes, go to step 302; if not, go to step 303;
when the LoRa network is in a manual activation mode, the terminal is not required to send a protocol message to the gateway and directly sends a data message to interact with the service server because the equipment address, the APP-KEY and the session KEY are preset at the terminal, so that the first packet message of the terminal is the data message, and the source address is the equipment address.
When the gateway receives a data message sent by a terminal in the LoRa network, checking whether a forwarding table entry for forwarding the data message exists locally, and if so, turning to step 302; if not, go to step 303;
step 302, forwarding the data message according to the forwarding table entry;
when a forwarding table entry exists, it is indicated that the data message is not a first packet data message sent by the terminal, so that the gateway can forward the data message to a service server according to the forwarding table entry, thereby avoiding the management server from processing the data message.
Step 303, forwarding the data packet to a designated management server in the LoRa network, and forwarding the data packet to a service server in the LoRa network allocated by the management server for the terminal by the management server to be processed; receiving the forwarding table item issued by the management server, and forwarding a data message according to the forwarding table item; the forwarding table entry is used for instructing the gateway to forward the data packet from the terminal to the service server allocated by the management server for the terminal.
If no forwarding table entry exists, it indicates that the data packet is a head packet data packet sent by the terminal, and the gateway may forward the data packet to a specified management server in the LoRa network. The management server may match the service server allocated to the terminal, and then forward the data packet to the service server in the LoRa network allocated to the terminal by the management server for processing, so that transmission delay of the data packet may be reduced.
In addition, the management server may also issue a forwarding entry to the gateway, where the forwarding entry is used to instruct the gateway to forward the data packet from the terminal to a service server allocated to the terminal by the management server. After receiving the forwarding table item issued by the management server, the gateway can forward the data message sent by the terminal according to the forwarding table item.
In addition, the forwarding table recorded on the gateway in the invention can also be used for safety purpose, that is, the gateway can increase the blacklist identifier in the forwarding table to limit a specific terminal when the terminal frequently sends messages, and discard the messages when receiving the messages of the terminal with the blacklist identifier, thereby increasing the robustness of the network.
Referring to fig. 4, it is a processing flow chart of another packet forwarding method in an exemplary embodiment of the present invention, where the method is applied to a management server in an LoRa network, and includes:
step 401, receiving a message from a terminal in the LoRa network, which is forwarded by a gateway in the LoRa network;
when the management server receives a message from a terminal in the LoRa network forwarded by the gateway, it indicates that the gateway does not have a forwarding table item for guiding the message. In this embodiment, the message may be a protocol message in a wireless activation mode, or may be a first packet data message in a manual activation mode.
Step 402, when the message is an LoRa protocol message, allocating an equipment address to the terminal, generating a forwarding table according to the equipment address, and issuing the forwarding table to a gateway, where the forwarding table is used to instruct the gateway to forward a data message from the terminal to a service server in the LoRa network allocated to the terminal by the management server;
when the message is an LoRa protocol message, the management server may allocate an equipment address to the terminal when the terminal passes authentication; sending a response message carrying the equipment address to the gateway so that the gateway forwards the response message to the terminal and the terminal takes the equipment address as a source address of a subsequent data message; and then the management server generates a forwarding table according to the equipment address allocated to the terminal and issues the forwarding table to the gateway, wherein the forwarding table is used for indicating the gateway to forward the data message from the terminal to a service server in the LoRa network allocated to the terminal by the management server. Specifically, since the management server is preset with a corresponding relationship between a service identifier (APP EUI) and a service server identifier, and a corresponding relationship between a device address of a terminal and the service identifier (APP EUI), the management server can search the service server identifier corresponding to the device address of the terminal, so as to generate a forwarding table entry including a corresponding relationship between the device address of the packet and the service server identifier, so that when the gateway receives a data packet sent by the terminal, the gateway searches the service server identifier corresponding to the device address in the data packet in the forwarding table entry, and forwards the data packet to the service server.
Step 403, when the packet is a data packet, forwarding the data packet to a service server in the LoRa network allocated by the management server for the terminal to process; and issuing the forwarding table entry to the gateway.
When the message is a data message, forwarding the data message to a service server in the LoRa network distributed by the management server for the terminal to process, so as to reduce transmission delay of the data message; the management server also issues the forwarding table to the gateway, where the forwarding table is used to instruct the gateway to forward the data packet from the terminal to the service server in the LoRa network allocated by the management server to the terminal.
Compared with the prior art, on one hand, the management server only processes the first packet data message or the protocol message as a server for addressing and flow table management, and all subsequent messages are directly delivered to the service server for processing, so that the management server does not become a performance bottleneck any more. On the other hand, the data message is not transferred to the service server from the management server, but is transferred through the gateway, so that the transfer link of the management server is reduced, and the transfer delay is reduced. In addition, the service server can run on an independent platform, does not depend on an operating system and a running environment of the management server any more, and does not need to be adapted and developed for a specific environment. Therefore, the invention realizes the multi-tenant multiplexing of one LoRa network deployment and has higher processing performance.
In order to make the objects, technical solutions and advantages of the present invention more clearly understood, the following describes in detail the packet forwarding schemes of the present invention in the wireless activation mode and the manual activation mode with reference to fig. 5 and 6, respectively.
Please refer to fig. 5, which is an interaction flowchart of a message forwarding method in a wireless activation mode in an exemplary embodiment of the present invention, where the interaction flowchart includes:
step 501, an IP address and a port number of a management server are configured on a gateway in advance;
step 502, when receiving an access request message (i.e. a LoRa protocol message) sent by a terminal, a gateway forwards the access request message to a management server according to an IP address and a port number of the management server;
in this embodiment, when the gateway receives an access request message sent by the terminal, it indicates that the terminal has not performed access authentication at this time, and therefore the terminal has not obtained the LoRa device address of the terminal and has not received the forwarding table item issued by the management server; therefore, the gateway needs to forward the access request packet to the management server;
step 503, when receiving the access request message, the management server performs access authentication according to the terminal information carried in the access request message, and when the authentication passes, allocates a device address for the terminal;
the data message sent by the subsequent terminal can take the equipment address as the source address of the data message;
step 504, the management server generates a forwarding table and issues the forwarding table to the gateway;
after the management server allocates an equipment address to the terminal, the management server allocates a corresponding service server identifier to the equipment address, namely a port and an IP (Internet protocol) of the service server, generates a forwarding table item containing a corresponding relation between the equipment address and the service server identifier, and issues the forwarding table item to the gateway;
step 505, when the gateway receives the forwarding table item issued by the management server, the gateway records the forwarding table item in the local;
step 506, the gateway receives an access response message sent by the management server to the terminal, wherein the access response message carries the device address corresponding to the terminal, the random number used for generating the session KEY and the APP-KEY;
step 507, the gateway forwards the access response message to the terminal;
step 508, after receiving the access response message, the terminal generates a session KEY through a random number and an APP-KEY according to a rule agreed with the service server; encrypting the data message according to the session key, and forwarding the encrypted data message to the gateway; the equipment address is used as a source address of a subsequent data message;
step 509, when the gateway receives the data packet, searching a forwarding table entry according to the device address of the data packet;
step 510, finding out a service server identifier corresponding to the equipment address recorded in the forwarding table entry according to the equipment address of the data packet, and forwarding the data packet to a corresponding service server through the service server identifier;
step 511, after receiving the data message, the service server decrypts the data message according to the rule agreed with the terminal, and then performs corresponding processing on the data message.
Please refer to fig. 6, which is an interaction flowchart of a message forwarding method in a manual activation manner in an exemplary embodiment of the present invention, where the interaction flowchart includes:
step 601, pre-configuring an IP address and a port number of a management server on a gateway;
step 602, pre-configuring an equipment address and a session key agreed with a service server on a terminal; encrypting the data message according to the session key, and forwarding the encrypted data message to the gateway
Step 603, when the gateway receives the first packet data message, searching a matched forwarding table item according to the equipment address of the first packet data message;
step 604, when the gateway does not find the forwarding table entry, forwarding the header packet data message to the management server according to the pre-configured IP address and port number of the management server;
step 605, when receiving the data packet, the management server allocates a service server identifier, i.e. a port and an IP of the service server, to the device address of the first packet of data packet, generates a forwarding table entry including a correspondence between the device address and the service server identifier, and issues the forwarding table entry to the gateway;
step 606, forwarding the first packet data message to the corresponding service server according to the service server identifier in the forwarding table entry;
step 607, after receiving the first packet data message, the service server decrypts the first packet data message according to the session key appointed by the terminal, and then correspondingly processes the first packet data message;
step 608, the management server issues the forwarding table to the gateway;
step 609, the gateway receives the forwarding table item issued by the management server and records the forwarding table item in the local;
step 610, when the gateway receives a subsequent data message sent by the terminal, searching a matched forwarding table item according to the equipment address of the subsequent data message;
step 611, searching a corresponding service server identifier from the forwarding table entry according to the device address of the data packet, and forwarding the data packet to the corresponding service server according to the service server identifier, so that after the service server receives the data packet, the data packet is decrypted and then correspondingly processed.
Based on the same conception, the invention also provides a message forwarding device, which can be realized by software, or by hardware or a combination of the software and the hardware. Taking software implementation as an example, the message forwarding device of the present invention is a device in a logical sense, and is operated after a CPU of a device in which the message forwarding device is located reads a corresponding computer program instruction in a memory.
Referring to fig. 7a, it is a hardware structure diagram of an apparatus where a message forwarding device is located in an exemplary embodiment of the present invention, where the device is applied to a gateway in an LoRa network, and a basic operating environment of the device includes a CPU, a memory, and other hardware, and from a logic level, a logic structure of the device is as shown in fig. 7b, and the device 700 includes:
a message receiving unit 701, configured to receive an LoRa protocol message sent by a first terminal in the LoRa network;
a packet forwarding unit 702, configured to forward the LoRa protocol packet to a specified management server in the LoRa network;
a table entry receiving unit 703, configured to receive a first forwarding table entry issued by the management server, and forward a data packet according to the first forwarding table entry; the first forwarding table entry is used to instruct the gateway to forward the data packet from the first terminal to the service server in the LoRa network allocated by the management server for the first terminal.
As an embodiment, the message receiving unit 701 is further configured to, when receiving a data message sent by a second terminal in the LoRa network, check whether a second forwarding table entry for forwarding the data message from the second terminal exists locally; if yes, forwarding the data message from the second terminal according to the second forwarding table item; if not, forwarding the data message from the second terminal to the management server, and forwarding the data message to a service server in the LoRa network distributed by the management server for the second terminal by the management server for processing; receiving the second forwarding table item issued by the management server, and forwarding the data message according to the second forwarding table item; the second forwarding table entry is used for instructing the gateway to forward the data packet from the second terminal to the service server allocated by the management server for the second terminal.
Referring to fig. 8a, it is a hardware structure diagram of an apparatus where another packet forwarding device in an exemplary embodiment of the present invention is located, where the device is applied to a gateway in an LoRa network, and a basic operating environment of the device includes a CPU, a memory, and other hardware, and from a logic level, a logic structure of the device is as shown in fig. 8b, and the device 800 includes:
a message receiving unit 801, configured to, when receiving a data message sent by a terminal in the LoRa network, check whether a forwarding entry for forwarding the data message exists locally;
a first forwarding unit 802, configured to forward the data packet according to a forwarding table entry when it is checked that the forwarding table entry for forwarding the data packet exists locally;
a second forwarding unit 803, configured to forward the data packet to a specified management server in the LoRa network when it is checked that a forwarding entry for forwarding the data packet does not exist locally, and forward the data packet to a service server in the LoRa network, where the service server is allocated by the management server for the terminal, for processing; receiving the forwarding table item issued by the management server, and forwarding a data message according to the forwarding table item; the forwarding table entry is used for instructing the gateway to forward the data packet from the terminal to the service server allocated by the management server for the terminal.
Referring to fig. 9a, it is a hardware structure diagram of an apparatus where a message forwarding device according to another exemplary embodiment of the present invention is located, where the device is applied to a management server in an LoRa network, and a basic operating environment of the device includes a CPU, a memory, and other hardware, and from a logic level, a logic structure of the device is as shown in fig. 9b, and the device 900 includes:
a message receiving unit 901, configured to receive a message from a terminal in the LoRa network, where the message is forwarded by a gateway in the LoRa network;
a first forwarding unit 902, configured to, when the packet is an LoRa protocol packet, allocate an equipment address to the terminal, generate a forwarding entry according to the equipment address, and issue the forwarding entry to a gateway, where the forwarding entry is used to instruct the gateway to forward a data packet from the terminal to a service server in the LoRa network, where the service server is allocated to the terminal by the management server;
a second issuing unit 903, configured to forward the data packet to a service server in the LoRa network allocated by the management server for the terminal to process when the packet is a data packet; and issuing the forwarding table entry to the gateway.
Therefore, the invention can make the gateway forward the LoRa protocol message to the designated management server in the LoRa network when receiving the LoRa protocol message sent by the terminal in the LoRa network under the wireless activation condition or the first packet data message sent by the terminal under the manual activation condition, and then forward the subsequent data message from the terminal to the service server in the LoRa network distributed by the management server for the terminal by receiving the forwarding table item sent by the management server. The invention can separate the forwarding table item which is managed by the management server and used for guiding the message forwarding to the gateway for management, so that the gateway can directly forward the message to the corresponding service server according to the forwarding table item, thereby reducing the burden of the management server. Therefore, the invention realizes the multi-tenant multiplexing of one LoRa network deployment and has higher processing performance.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (8)

1. A message forwarding method is applied to a gateway in an LoRa network, and is characterized by comprising the following steps:
receiving an LoRa protocol message sent by a first terminal in the LoRa network;
forwarding the loRa protocol message to a designated management server in the loRa network;
receiving a first forwarding table item issued by the management server, and forwarding a data message according to the first forwarding table item;
the first forwarding table entry is used for instructing the gateway to forward the data packet from the first terminal to a service server in the LoRa network, where the service server is allocated by the management server to the first terminal;
the first forwarding table entry includes the device address of the first terminal and a service server identifier in the LoRa network allocated by the management server for the first terminal.
2. The method of claim 1, further comprising:
when receiving a data message sent by a second terminal in the LoRa network, checking whether a second forwarding table entry for forwarding the data message from the second terminal exists locally;
if yes, forwarding the data message from the second terminal according to the second forwarding table item;
if not, forwarding the data message from the second terminal to the management server, and forwarding the data message to a service server in the LoRa network distributed by the management server for the second terminal by the management server for processing; receiving the second forwarding table item issued by the management server, and forwarding the data message according to the second forwarding table item;
the second forwarding table entry is used for instructing the gateway to forward the data packet from the second terminal to the service server allocated by the management server for the second terminal.
3. A message forwarding method is applied to a gateway in an LoRa network, and is characterized by comprising the following steps:
when receiving a data message sent by a terminal in the LoRa network, checking whether a forwarding table entry for forwarding the data message exists locally;
if yes, forwarding the data message according to the forwarding table entry;
if not, forwarding the data message to a designated management server in the LoRa network, and forwarding the data message to a service server in the LoRa network distributed by the management server for the terminal by the management server to be processed; receiving the forwarding table item issued by the management server, and forwarding a data message according to the forwarding table item;
the forwarding table entry is used for instructing the gateway to forward the data packet from the terminal to a service server which is allocated to the terminal by the management server;
the forwarding table entry includes the device address of the terminal and the service server identifier in the LoRa network allocated by the management server to the terminal.
4. A message forwarding method is applied to a management server in an LoRa network, and the method comprises the following steps:
receiving a message from a terminal in the LoRa network, wherein the message is forwarded by a gateway in the LoRa network;
when the message is an LoRa protocol message, allocating an equipment address for the terminal, generating a forwarding table according to the equipment address and issuing the forwarding table to a gateway, wherein the forwarding table is used for indicating the gateway to forward the data message from the terminal to a service server in the LoRa network allocated to the terminal by the management server;
when the message is a data message, forwarding the data message to a service server in the LoRa network distributed by the management server for the terminal to process; and issuing the forwarding table item to the gateway;
the forwarding table entry includes an equipment address of the terminal and a service server identifier in the LoRa network allocated to the terminal by the management server.
5. A message forwarding apparatus, wherein the apparatus is applied to a gateway in an LoRa network, and the apparatus comprises:
a message receiving unit, configured to receive an LoRa protocol message sent by a first terminal in the LoRa network;
a message forwarding unit, configured to forward the LoRa protocol message to a specified management server in the LoRa network;
the table item receiving unit is used for receiving a first forwarding table item issued by the management server and forwarding a data message according to the first forwarding table item; the first forwarding table entry is used for instructing the gateway to forward the data packet from the first terminal to a service server in the LoRa network, where the service server is allocated by the management server to the first terminal;
the first forwarding table entry includes the device address of the first terminal and a service server identifier in the LoRa network allocated by the management server for the first terminal.
6. The apparatus of claim 5,
the message receiving unit is further configured to, when receiving a data message sent by a second terminal in the LoRa network, check whether a second forwarding table entry for forwarding the data message from the second terminal exists locally; if yes, forwarding the data message from the second terminal according to the second forwarding table item; if not, forwarding the data message from the second terminal to the management server, and forwarding the data message to a service server in the LoRa network distributed by the management server for the second terminal by the management server for processing; receiving the second forwarding table item issued by the management server, and forwarding the data message according to the second forwarding table item; the second forwarding table entry is used for instructing the gateway to forward the data packet from the second terminal to the service server allocated by the management server for the second terminal.
7. A message forwarding apparatus, wherein the apparatus is applied to a gateway in an LoRa network, and the apparatus comprises:
a message receiving unit, configured to, when receiving a data message sent by a terminal in the LoRa network, check whether a forwarding entry for forwarding the data message exists locally;
the first forwarding unit is used for forwarding the data message according to a forwarding table entry when the forwarding table entry for forwarding the data message is checked to exist locally;
a second forwarding unit, configured to forward the data packet to a specified management server in the LoRa network when it is checked that a forwarding entry for forwarding the data packet does not exist locally, and forward the data packet to a service server in the LoRa network, where the service server is allocated by the management server for the terminal, for processing; receiving the forwarding table item issued by the management server, and forwarding a data message according to the forwarding table item; the forwarding table entry is used for instructing the gateway to forward the data packet from the terminal to a service server which is allocated to the terminal by the management server;
the forwarding table entry includes the device address of the terminal and the service server identifier in the LoRa network allocated by the management server to the terminal.
8. A message forwarding apparatus, wherein the apparatus is applied to a management server in an LoRa network, and the apparatus comprises:
a message receiving unit, configured to receive a message from a terminal in the LoRa network, where the message is forwarded by a gateway in the LoRa network;
a first forwarding unit, configured to, when the packet is an LoRa protocol packet, allocate an equipment address to the terminal, generate a forwarding entry according to the equipment address, and issue the forwarding entry to a gateway, where the forwarding entry is used to instruct the gateway to forward a data packet from the terminal to a service server in the LoRa network allocated by the management server to the terminal;
a second issuing unit, configured to forward the data packet to a service server in the LoRa network allocated by the management server for the terminal to process when the packet is a data packet; and issuing the forwarding table item to the gateway;
the forwarding table entry includes an equipment address of the terminal and a service server identifier in the LoRa network allocated to the terminal by the management server.
CN201710501288.4A 2017-06-27 2017-06-27 Message forwarding method and device Active CN107547621B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710501288.4A CN107547621B (en) 2017-06-27 2017-06-27 Message forwarding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710501288.4A CN107547621B (en) 2017-06-27 2017-06-27 Message forwarding method and device

Publications (2)

Publication Number Publication Date
CN107547621A CN107547621A (en) 2018-01-05
CN107547621B true CN107547621B (en) 2020-11-06

Family

ID=60970325

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710501288.4A Active CN107547621B (en) 2017-06-27 2017-06-27 Message forwarding method and device

Country Status (1)

Country Link
CN (1) CN107547621B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108521656B (en) * 2018-03-23 2021-03-02 深圳市信锐网科技术有限公司 Lora communication method and system
CN111465013A (en) * 2019-01-22 2020-07-28 阿里巴巴集团控股有限公司 Communication method of gateway and gateway
CN111600812B (en) * 2020-05-13 2022-10-25 优刻得科技股份有限公司 Message processing method, processing device, readable medium and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101414998A (en) * 2007-10-15 2009-04-22 华为技术有限公司 Communication method, system and equipment based on authentication mechanism conversion
CN104168202A (en) * 2014-08-26 2014-11-26 华为技术有限公司 Method and device for forwarding Open Flow messages
CN105959223A (en) * 2016-04-26 2016-09-21 杭州华三通信技术有限公司 Message forwarding method and apparatus
CN106101617A (en) * 2016-06-08 2016-11-09 浙江宇视科技有限公司 A kind of message transmitting method, Apparatus and system
US9652955B1 (en) * 2016-06-21 2017-05-16 Link Labs, Inc. Real-time asset location system and method with long-range wireless backhaul
CN106789259A (en) * 2016-12-26 2017-05-31 中国科学院信息工程研究所 A kind of LoRa core network systems and implementation method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10726510B2 (en) * 2015-08-07 2020-07-28 Fairwayiq, Inc. System and method for managing and interacting with patrons at an activity venue

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101414998A (en) * 2007-10-15 2009-04-22 华为技术有限公司 Communication method, system and equipment based on authentication mechanism conversion
CN104168202A (en) * 2014-08-26 2014-11-26 华为技术有限公司 Method and device for forwarding Open Flow messages
CN105959223A (en) * 2016-04-26 2016-09-21 杭州华三通信技术有限公司 Message forwarding method and apparatus
CN106101617A (en) * 2016-06-08 2016-11-09 浙江宇视科技有限公司 A kind of message transmitting method, Apparatus and system
US9652955B1 (en) * 2016-06-21 2017-05-16 Link Labs, Inc. Real-time asset location system and method with long-range wireless backhaul
CN106789259A (en) * 2016-12-26 2017-05-31 中国科学院信息工程研究所 A kind of LoRa core network systems and implementation method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
A Study of LoRa: Long Range & Low Power Networks for the Internet of Things;Thomas Clausen等;《sensor》;20160909;4.3小节 *
LoRa无线网络技术分析;赵静等;《移动通信》;20161115;第4.2小节,图1 *

Also Published As

Publication number Publication date
CN107547621A (en) 2018-01-05

Similar Documents

Publication Publication Date Title
CN110191031B (en) Network resource access method and device and electronic equipment
US9967738B2 (en) Methods and arrangements for enabling data transmission between a mobile device and a static destination address
US10320788B2 (en) Method for transferring authorization information, relay device, and server
JP2018528679A (en) Device and method for establishing a connection in a load balancing system
US8400943B2 (en) IPv6 addressing over non-IPv6 systems
US20130182651A1 (en) Virtual Private Network Client Internet Protocol Conflict Detection
CN109525684B (en) Message forwarding method and device
WO2011059770A2 (en) Smart client routing
US11265244B2 (en) Data transmission method, PNF SDN controller, VNF SDN controller, and data transmission system
CN108259632B (en) CGN implementation method and device
CN107547621B (en) Message forwarding method and device
WO2021008591A1 (en) Data transmission method, device, and system
CN112583618B (en) Method, device and computing equipment for providing network service for business
CN110012118B (en) Method and controller for providing Network Address Translation (NAT) service
JP2015532053A (en) Layer-2 address management at an access point that can accommodate only three addresses in a network having a relay device
CN104601566A (en) Authentication method and device
WO2014142258A1 (en) Communication system, control device, address allocation method, and program
CN114556868B (en) Private subnetworks for virtual private network VPN clients
CN113364660A (en) Data packet processing method and device in LVS load balancing
US9413590B2 (en) Method for management of a secured transfer session through an address translation device, corresponding server and computer program
US10044672B2 (en) IPv6 address assignment method and apparatus
CN112968965A (en) Metadata service method, server and storage medium for NFV network node
EP3364624A1 (en) A method of distributing a sub-flow associated with a session and a network apparatus
CN104052717A (en) Message sending method and apparatus
CN104518937B (en) The method and device of the more communication between devices of virtual LAN VLAN

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant