CN116686273A - Message forwarding method and device, electronic equipment and medium - Google Patents

Message forwarding method and device, electronic equipment and medium Download PDF

Info

Publication number
CN116686273A
CN116686273A CN202180004368.3A CN202180004368A CN116686273A CN 116686273 A CN116686273 A CN 116686273A CN 202180004368 A CN202180004368 A CN 202180004368A CN 116686273 A CN116686273 A CN 116686273A
Authority
CN
China
Prior art keywords
address
request message
service
local
host
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.)
Pending
Application number
CN202180004368.3A
Other languages
Chinese (zh)
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.)
New H3C Technologies Co Ltd
Original Assignee
New 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 New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Publication of CN116686273A publication Critical patent/CN116686273A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/10Packet switching elements characterised by the switching fabric construction
    • H04L49/113Arrangements for redundant switching, e.g. using parallel planes
    • H04L49/118Address processing within a device, e.g. using internal ID or tags for routing within a switch
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/02Communication route or path selection, e.g. power-based or shortest path routing

Landscapes

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

Abstract

The application provides a message forwarding method, a message forwarding device, electronic equipment and a message forwarding medium, and relates to the technical field of communication, wherein the message forwarding method comprises the following steps: receiving a first request message, wherein a host address segment of a destination IP address of the first request message is used for representing a service identifier of a service requested by the first request message; if the service identifier which is the same as the address field of the host exists in the local service identifier list, forwarding a first request message to a local server; the local service identification list comprises service identifications of services which can be provided by the local server cluster; if the service identification which is the same as the address segment of the host exists in the local service identification list, the first request message is forwarded to other routers based on the destination IP address of the first request message. The access delay of the terminal can be reduced.

Description

Message forwarding method and device, electronic equipment and medium Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, an electronic device, and a medium for forwarding a message.
Background
In a mobile communication network, when a terminal needs to access a uniform resource locator (Uniform Resource Locator, URL), domain name resolution is required to obtain a destination internet protocol (Internet Protocol, IP) address corresponding to the URL, and then an access request is sent to a server corresponding to the destination IP address. With the development of technology, for some services with strong mobility, one URL may be served by multiple servers distributed over multiple places.
After the terminal queries an IP address corresponding to a URL through a domain name resolution service (Domain Name Server, DNS) server, the corresponding relationship between the URL and the IP address is cached, and subsequent access requests for the URL are sent to the server corresponding to the IP address. However, the terminal may move, and as the terminal moves, the server most suitable for serving the terminal may change, and the terminal still sends an access request to the server corresponding to the IP address based on the corresponding relationship between the cached URL and the IP address, which results in higher access delay of the terminal.
Disclosure of Invention
The embodiment of the application aims to provide a message forwarding method, a message forwarding device, electronic equipment and a medium, so as to reduce terminal access time delay. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a method for forwarding a packet, where the method is applied to a router, and the method includes:
receiving a first request message, wherein a host address segment of a destination IP address of the first request message is used for representing a service identifier of a service requested by the first request message;
if the service identifier which is the same as the address segment of the host exists in the local service identifier list, forwarding the first request message to a local server; the local service identification list comprises service identifications of services which can be provided by the local server cluster;
and if the service identification which is the same as the address segment of the host computer does not exist in the local service identification list, forwarding the first request message to other routers based on the destination IP address of the first request message.
In one possible implementation manner, before the receiving the first request packet, the method further includes:
acquiring a corresponding relation between a Uniform Resource Locator (URL) and a public network IP address of a service which can be provided by a local server cluster from a name server of the local server cluster;
extracting a host address of each public network IP address from the obtained public network IP addresses included in the corresponding relation;
and generating the local service identifier list by taking the extracted host address as a service identifier.
In one possible implementation manner, if the service identifier identical to the host address segment exists in the local service identifier list, forwarding the first request message to a local server includes:
if the service identification which is the same as the address segment of the host exists in the local service identification list, the destination IP address of the first request message is converted into the IP address of load balancing equipment, a second request message is obtained, and the second request message is sent to a local server through the load balancing equipment.
In one possible implementation manner, the service identifier included in the local service identifier list belongs to a preset host address network segment, where the preset host address network segment is an IPv6 address network segment that is applied for mobile service in advance, and the preset host address network segment is dedicated for the mobile service.
In one possible implementation manner, the receiving the first request packet includes:
receiving a first request message sent by a terminal; or alternatively, the process may be performed,
and receiving a first request message forwarded by the router.
In a second aspect, an embodiment of the present application provides a packet forwarding device, where the device is applied to a router, and the device includes:
the receiving module is used for receiving a first request message, and a host address segment of a destination IP address of the first request message is used for representing a service identifier of a service requested by the first request message;
the first forwarding module is configured to forward the first request packet to a local server if a service identifier identical to the address field of the host exists in the local service identifier list; the local service identification list comprises service identifications of services which can be provided by the local server cluster;
and the second forwarding module is used for forwarding the first request message to other routers based on the destination IP address of the first request message if the service identifier which is the same as the host address segment does not exist in the local service identifier list.
In one possible implementation, the apparatus further includes:
the acquisition module is used for acquiring the corresponding relation between the URL of the service which can be provided by the local server cluster and the public network IP address from the name server of the local server cluster;
the extraction module is used for extracting the host address of each public network IP address from the obtained public network IP addresses included in the corresponding relation;
and the generation module is used for generating the local service identifier list by taking the extracted host address as the service identifier.
In one possible implementation manner, the first forwarding module is specifically configured to:
if the service identification which is the same as the address segment of the host exists in the local service identification list, the destination IP address of the first request message is converted into the IP address of load balancing equipment, a second request message is obtained, and the second request is sent to a local server through the load balancing equipment.
In one possible implementation manner, the service identifier included in the local service identifier list belongs to a preset host address network segment, where the preset host address network segment is an IPv6 address network segment that is applied for mobile service in advance, and the preset host address network segment is dedicated for the mobile service.
In one possible implementation manner, the receiving module is specifically configured to:
receiving a first request message sent by a terminal; or alternatively, the process may be performed,
and receiving a first request message forwarded by the router.
In a third aspect, an embodiment of the present application further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and a processor, configured to implement the method steps described in the first aspect when executing the program stored in the memory.
In a fourth aspect, embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, which when executed by a processor implements the method of the first aspect.
In a fifth aspect, embodiments of the present application also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of the first aspect described above.
By adopting the technical scheme, the host address segment of the destination IP address is used for representing the service identifier requested by the first request message, and after the first request message is received, if the service identifier which is the same as the host address segment exists in the local service identifier list, the local server is indicated to be capable of providing the service requested by the first request message, and then the first request message is forwarded to the local server. That is, no matter whether the destination address of the first request message is the IP address of the local server, the local server may process the first request message as long as the host address segment of the destination address of the first request message belongs to the local service identifier list, so that it is unnecessary to forward the first request message to other routers continuously, the response speed of the first request message may be improved, and the access delay of the terminal may be reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application and the technical solutions of the prior art, the following description will briefly explain the embodiments and the drawings needed in the prior art, and it is obvious that the drawings in the following description are only some embodiments of the present application and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a block diagram of a power network system according to an embodiment of the present application;
fig. 2 is a schematic diagram of an edge cloud according to an embodiment of the present application;
fig. 3 is a flowchart of a message forwarding method according to an embodiment of the present application;
fig. 4 is a flowchart of another message forwarding method according to an embodiment of the present application;
fig. 5 is a flowchart of another message forwarding method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a message forwarding device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail below by referring to the accompanying drawings and examples. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The technical scheme of the application can be applied to various communication systems, such as: a long term evolution (Long Time Evolution, LTE) time division duplex (Time Division Duplex, TDD) system, a universal mobile telecommunications system (Universal Mobile Telecommunication System, UMTS), a worldwide interoperability for microwave access (Worldwide Interoperability for Microwave Access, wiMAX) communication system, a public land mobile network (Public Land Mobile Network, PLMN) system, an LTE system, a New air interface (NR) system, a 4.5G communication system, a 5G communication system, and various future wireless communication systems, and the like. The network architecture and the service scenario described in the embodiments of the present application are for more clearly describing the technical solution of the embodiments of the present application, and do not constitute a limitation on the technical solution provided by the embodiments of the present application, and those skilled in the art can know that, with the evolution of the network architecture and the appearance of the new service scenario, the technical solution provided by the embodiments of the present application is applicable to similar technical problems.
The embodiment of the application can be particularly applied to a scene of edge calculation, wherein the edge calculation refers to an open platform integrating network, calculation, storage and application core capabilities on one side close to a data source in a communication system, and the open platform can provide service for a terminal nearby.
As shown in fig. 1, fig. 1 is a schematic diagram of a computing power network system according to an embodiment of the present application, where the computing power network system includes a center cloud, a city cloud, and an edge cloud. Edge clouds 1, 2, 3 are exemplarily shown in fig. 1, and the number of edge clouds in practical implementation is not limited thereto.
The edge cloud is communicated with the edge cloud, the edge cloud is communicated with the city cloud, and the city cloud is communicated with the center cloud through a router. The edge cloud, the city cloud and the center cloud all comprise server clusters, the server clusters can provide services for the terminal, service request messages of the terminal are forwarded to the edge cloud, if the edge cloud cannot be processed, the service request messages are forwarded to the city cloud for processing, and if the city cloud cannot be processed, the service request messages are forwarded to the center cloud for processing.
Wherein each edge cloud is connected to a router, e.g., edge cloud 1 is connected to router 1, edge cloud 2 is connected to router 2, and edge cloud 3 is connected to router 3.
The router is used for supporting the communication between the edge cloud and the outside, and is connected with a user plane function (User Plane Function, UPF) unit and a base station. For example, router 1 is connected to base station 1 through a UPF, router 2 is connected to base station 2 through a UPF, and router 3 is connected to base station 3 through a UPF.
The Base station may be a distributed Base station, where the distributed Base station includes a remote radio Unit (Remote Radio Unit, RRU) and a baseband Unit (BBU), referring to fig. 1, the upf is connected to the BBU, the BBU is connected to the RRU, and the terminal device may access the edge cloud through the RRU.
The base station in the embodiment of the present application may also be an evolved base station (NodeB or eNB or e-NodeB, evolutional Node B) in an LTE system or Advanced (Long Termevolution-Advanced, LTE-a), or may also include an evolved packet core network (Evolved Packet Core, EPC), a fifth generation communication technology (the 5th Generation,5G), a next generation node B (next generation Node B, gNB) in an NR system, or include a Centralized Unit (CU) and a Distributed Unit (DU) in a Cloud access network (Cloud Radio Access Network, cloud RAN) system, which is not limited.
The terminals in the embodiments of the present application are wireless terminal devices that can communicate with one or more Core Networks (CNs) via a radio access Network (Radio Access Network, RAN), which can be mobile terminal devices, such as mobile phones (or "cellular" phones) and computers with mobile terminal devices, for example, portable, pocket, hand-held, computer-built-in or vehicle-mounted mobile devices, such as cell phones, pad, notebook, wearable devices, etc., that exchange voice and/or data with the radio access Network.
As shown in fig. 2, the edge cloud in fig. 1 may include a load balancing device and a local server cluster, where the local server cluster includes a plurality of servers, and each server may provide one or more services.
The load balancing device is connected with the router, and after receiving the request message forwarded by the router, the load balancing device can select a server from the local server cluster based on the load balancing strategy and forward the request message to the server.
When the terminal needs to acquire network service, the terminal can send a service request to the base station, the base station forwards the service request to the UPF, then the UPF forwards the service request to the router, if the router identifies that the destination IP address of the service request message is the IP address of the local server, the service request message is forwarded to the server in the local edge cloud, and if the router identifies that the destination IP address of the service request message is not the IP address of the local server, the service request message is forwarded according to the routing table.
In order to reduce access delay of a terminal by combining the system architecture, an embodiment of the present application provides a method for forwarding a message, which is applied to a router, and the method includes:
receiving a first request message, wherein a host address segment of a destination IP address of the first request message is used for representing a service identifier of a service requested by the first request message;
if the service identifier which is the same as the address field of the host exists in the local service identifier list, forwarding a first request message to a local server; the local service identification list comprises service identifications of services which can be provided by the local server cluster;
if the service identification which is the same as the address segment of the host exists in the local service identification list, the first request message is forwarded to other routers based on the destination IP address of the first request message.
By adopting the method, the host address segment of the destination IP address is used for representing the service identifier requested by the first request message, and when the first request message is received, if the service identifier which is the same as the host address segment exists in the local service list, the local server is indicated to be capable of providing the service requested by the first request message, and then the first request message is forwarded to the local server. That is, no matter whether the destination address of the first request message is the IP address of the local server, as long as the host address segment of the destination address of the first request message belongs to the local service list, the local server can process the first request message, so that the first request message does not need to be forwarded to other routers continuously, the responding speed of the first request message can be improved, and the access delay of the terminal can be reduced.
The following describes the message forwarding method provided by the embodiment of the present application in detail with reference to the accompanying drawings.
The embodiment of the application provides a message forwarding method, which is applied to a router, such as a router connected to an edge cloud in fig. 1, as shown in fig. 3, and comprises the following steps:
s301, receiving a first request message, wherein a host address segment of a destination IP address of the first request message is used for representing a service identifier of a service requested by the request message.
The first request message may be a hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP) request message.
The destination IP address of the first request message is a public network IP address of a server providing service for the terminal, the destination IP address comprises a network address segment and a host address segment, wherein the network address segment represents the network position of the server, and the host address segment is used for representing the service identifier of the server. The encoding rule of the public network IP address of the server in the embodiment of the application is' network address: service identification). As an example, the first 64 bits of a 128bit public network IP address may be a network address field and the last 64 bits may be a host address field.
In the embodiment of the application, the service identifiers used are the same for the same service in different servers, i.e. one service has one unique identifier.
For example, if server a, server B, and server C at different locations can provide the same service, the IP addresses of the three servers include the same host address segment and include different network address segments.
S302, if the service identification which is the same as the address field of the host exists in the local service identification list, forwarding a first request message to the local server.
The local service identification list comprises service identifications of services which can be provided by the local server cluster. For example, the local service cluster may provide service a, service B, and service C, where service identifiers corresponding to service a, service B, and service C are 1100:0000:0000: 0001. 1100:0000:0000: 0011. 1100:0000:0000:0111, the local service identifier list includes 1100:0000:0000: 0001. 1100:0000:0000: 0011. 1100:0000:0000:0111.
optionally, the service identifier included in the local service identifier list may be a service identifier of a mobile service, where the mobile service is a service with strong mobility, such as an internet of vehicles service.
S303, if the service identification which is the same as the address field of the host is not present in the local service identification list, forwarding the first request message to other routers based on the destination IP address of the first request message.
If the service identifier identical to the host address segment does not exist in the local service identifier list, which indicates that the local server cluster cannot provide the service identified by the service identifier, the router may forward the first request message to other routers based on the routing table.
The router can match the destination IP address of the first request message with the forwarding table items in the routing table, and forward the first request message based on the outgoing interface and the next hop included in the matched forwarding table items.
For example, if the local service identifier list of the router 1 in fig. 1 does not have the service identifier identical to the host address field, the destination IP address of the first request packet is matched with the routing table, and if the next hop matched is the IP address of the router 2, the router 1 forwards the first request packet to the router 2.
By adopting the method, the host address segment of the destination IP address is used for representing the service identifier requested by the first request message, and when the first request message is received, if the service identifier which is the same as the host address segment exists in the local service identifier list, the local server is indicated to be capable of providing the service requested by the first request message, and then the first request message is forwarded to the local server. That is, no matter whether the destination address of the first request message is the IP address of the local server, the local server may process the first request message as long as the host address segment of the destination address of the first request message belongs to the local service identifier list, so that it is unnecessary to forward the first request message to other routers continuously, the response speed of the first request message may be improved, and the access delay of the terminal may be reduced.
In an embodiment of the present application, the step S301 of receiving the first request packet specifically includes the following two implementation manners.
And receiving a first request message sent by the client.
The router receives a first request message sent by the terminal, namely, the edge cloud connected by the router is the edge cloud closest to the terminal currently, after receiving the first request message, the router can acquire a host address segment included in a destination IP address of the first request message, and if a service identifier which is the same as the host address segment exists in a local service identifier list, the local server can process the first request message.
The local service identifier list has two conditions that the service identifier which is the same as the address field of the host exists.
The first case is: the destination IP address of the first request message is the same as the public IP address of the local server.
Describing the scenario corresponding to the first case with reference to fig. 1, it is assumed that the terminal 1 accesses URL1 in the coverage area of the base station 1, and the terminal obtains the correspondence between URL1 and IP address 1 by querying the DNS server, where the IP address 1 is the public network IP address of the server 1 (not shown in fig. 1) in the edge cloud 1. Then, the terminal 1 sends a first request message, the destination IP address of the first request message is the public network IP address of the server 1, and then the router 1 can receive the first request message and forward the first request message to the server 1. In this scenario, the destination IP address of the first request message is the same as the public IP address of the local server.
The second case is: the destination IP address of the first request packet is different from the public network IP address of the local server, specifically, the network address field of the destination IP address is different from the network address field of the public network IP address, and the host address field of the destination IP address is the same as the host address field of the public network IP address.
The second scenario will be described with reference to fig. 1, assuming that the server 2 (not shown in fig. 1) in the edge cloud 2 can provide the same service as the server 1, the terminal 1 moves from the coverage of the base station 1 to the coverage of the base station 2, and at this time, the correspondence between URL1 and IP address 1 is still stored in the terminal 1.
The destination address of the first request message sent by the terminal 1 is still the IP address 1, and the first request message is sent to the router 2 because the terminal 1 is within the coverage area of the base station 2. After receiving the first request message, the router 2 obtains a host address field of the IP address 1 included in the first request message, determines that the local service identifier list includes the service identifier identical to the host address field, and forwards the first request message to the server 2 without forwarding the first request message to the router 1 according to the routing table.
In this scenario, the public network IP address of server 1 and server 2 comprise different network address segments, and the host address segments are the same.
For example, the public IP address of the server 1 is 1:1:1:1:1:0:0:0, and the public IP address of the server 2 is 1:1:1:2:1:0:0:0. It can be seen that the network address segment 1:1:1:1 of the public network IP address of the server 1 is different from the network address segment 1:1:1:2 of the public network IP address of the server 2, but the host address segments of the public network IP of the server 1 and the server 2 are the same, and are 1:0:0:0:0.
Although the destination IP address of the first request packet is the public network IP address of the server 1, the first request packet is forwarded to the server 2 nearby, so that the delay caused by forwarding the first request packet to the router 1 by the router 2 and forwarding the first packet to the server 1 by the router 1 is reduced, the first request packet can be responded more quickly, and the access delay of the terminal 1 can be reduced.
And secondly, receiving a first request message sent by the router.
That is, the first request message is forwarded by another router, and the first request message forwarded by another router may also be processed according to the flow of fig. 3.
In the embodiment of the application, the public network IP address of the server can be an IPv6 address, the network address resource of the IPv6 address is sufficient, the length of the host address segment of the current IPv6 address is 64 bits, a huge address space can be provided, and the address space can be utilized to allocate service identifiers for all services of the whole network.
Optionally, an IPv6 address network segment may be applied for the mobile service in advance, and the applied IPv6 address network segment is used as a host address network segment dedicated for the mobile service, that is, a host address in the host address network segment is used as a service identifier of the mobile service.
The IPv6 address network segment applied for the mobile service may be a network segment that is not currently used temporarily, for example, the IPv6 address network segment is 1100:0000:0000:0000, of course, but other unused network segments may be used, which is not limited in this embodiment of the present application.
By applying for the mobile service for the unused IPv6 address network segment as the host address network segment special for the mobile service, the network segment applied at present can be prevented from being influenced, and further collision with the existing IP address is avoided, other host address network segments can be continuously used by other service applications, and the influence of the special host address network segment in the embodiment of the application is avoided.
Correspondingly, the service identifier in the local service identifier list in the embodiment of the present application belongs to a preset host address network segment, where the preset host network segment is the IPv6 address network segment previously applied for mobile services, and the preset host address network segment is dedicated for mobile services.
To implement the method flow shown in fig. 1, the router needs to generate the local service identifier list in advance, and before S301, as shown in fig. 4, the method further includes the following steps:
s401, acquiring a corresponding relation between a URL of a service which can be provided by the local server cluster and a public network IP address from a name server of the local server cluster.
Each edge cloud further comprises a Name Server (Name Server), the Name Server stores a corresponding relation between the URL and the IP address of each service provided by the local Server cluster, and the router can call an application program interface (Application Programming Interface, API) of the Name Server, so that the corresponding relation between the URL and the public network IP address of the service provided by the local Server cluster is obtained from the Name Server.
S402, extracting the host address of each public network IP address from the public network IP addresses included in the acquired corresponding relation.
S403, the extracted host address is used as a service identifier to generate a local service identifier list.
It can be understood that in the embodiment of the present application, the host address in the public network IP address is the service identifier, so that the extracted host address is the service identifier that can be provided by the local server cluster.
By adopting the method, the host address included in the public network IP address is the service identifier, the router can acquire the corresponding relation between the URL of the local server cluster and the public network IP address from the name server of the local server cluster, and the service identifiers of all the services which can be provided by the local server can be extracted from the public network IP address included in the acquired corresponding relation, so that a service identifier list is generated, and the service can be provided for the terminal based on the service identifier list, thereby reducing the access delay of the terminal.
In another embodiment of the present disclosure, on the basis of the embodiment shown in fig. 4, the embodiment of the present application may further update the local service identifier list in real time, as shown in fig. 5, where the method includes:
s501, acquiring the corresponding relation between the URL of the service which can be provided by the local server cluster and the public network IP address from the name server of the local server cluster in real time.
The router can acquire the corresponding relationship between the URL of the service provided by the latest local server cluster and the public network IP address in real time.
S502, extracting the host address of each public network IP address from the public network IP addresses included in the acquired corresponding relation.
S503, updating the local service identification list based on the host address of each extracted public network IP address.
If the extracted host address comprises a host address which does not exist in the local service list, the host address is added into the local service identification list, and if the host address except the host address extracted at the time exists in the local service list, the host address is deleted from the local service list.
By adopting the method, the corresponding relation between the URL and the public network IP address of the service which can be provided by the local server cluster can be obtained from the name server in real time, the host address is extracted from the public network IP address of the obtained corresponding relation, and the local service identification list is updated based on the extracted host address, so that the router can timely obtain the latest corresponding relation, the service identification in the local service identification list is consistent with the service which can be provided by the current local server cluster, and the accuracy of the router for forwarding the message based on the local service identification list is improved.
In one possible implementation manner, the router may also periodically obtain, from the name server, a correspondence between URLs of services that can be provided by the local server cluster and public network IP addresses, extract host addresses of the public network IP addresses from the URLs, and update the local service identifier list based on the host addresses from which the public network IP addresses are extracted. Under the condition that the service change frequency provided by the local service cluster is low, the processing cost of the router can be reduced by adopting the method, the service identifier in the local service identifier list can be kept consistent with the service provided by the current local server cluster, and the accuracy of the router for forwarding the message based on the local service identifier list is improved.
In another embodiment of the present application, S302, if the service identifier identical to the address field of the host exists in the local service identifier list, forwards the first request packet to the local server, which may be specifically implemented as:
if the service identification which is the same as the address segment of the host exists in the local service identification list, the destination IP address of the first request message is converted into the IP address of the load balancing device, a second request message is obtained, and the second request message is sent to the local server through the load balancing device.
The router may send the second request packet to the load balancing device, so that the load balancing device converts the destination IP address of the second request packet into the IP address of the local server based on the load balancing policy, and then forwards the second request packet to the local server.
The load balancing policy may be set based on practical situations, and a load balancing policy in a related technology may be adopted, which is not limited in the embodiment of the present application.
The load balancing device may determine a local server for processing the second request message based on the load balancing policy, and further convert the destination IP address of the second request message to a private IP address of the local server.
After processing the received second request message, the local server can generate a response message aiming at the second request message, and the local server can forward the response message to the terminal through the router.
It should be noted that, in the embodiment of the present application, the local server provides a short-connection stateless service for the terminal. Such as information query services, data computing services, etc.
The first request message sent by the terminal is processed by different servers to obtain the same response content.
By adopting the method, after the router receives the first request message, the router does not directly transmit the first request message through the routing table, but judges whether the local server can process the first request message, if so, the local server processes the first request message without transmitting the first request message to a server corresponding to a destination IP address of the first request message, so that the access time delay can be reduced.
Corresponding to the above method embodiment, the embodiment of the present application further provides a packet forwarding device, where the device is applied to a router, as shown in fig. 6, and the device includes:
a receiving module 601, configured to receive a first request packet, where a host address field of a destination IP address of the first request packet is used to represent a service identifier of a service requested by the first request packet;
a first forwarding module 602, configured to forward the first request packet to a local server if a service identifier that is the same as the address field of the host exists in the local service identifier list; the local service identification list comprises service identifications of services which can be provided by the local server cluster;
and the second forwarding module 603 is configured to forward the first request packet to other routers based on the destination IP address of the first request packet if the service identifier identical to the host address field does not exist in the local service identifier list.
In another embodiment of the present application, the apparatus further comprises:
the acquisition module is used for acquiring the corresponding relation between the URL of the service which can be provided by the local server cluster and the public network IP address from the name server of the local server;
the extraction module is used for extracting the host address of each public network IP address from the obtained public network IP addresses included in the corresponding relation;
and the generation module is used for generating the local service identifier list by taking the extracted host address as the service identifier.
In another embodiment of the present application, the first forwarding module 602 is specifically configured to:
if the service identification which is the same as the address segment of the host exists in the local service identification list, the destination IP address of the first request message is converted into the IP address of load balancing equipment, a second request message is obtained, and the second request message is sent to a local server through the load balancing equipment.
In another embodiment of the present application, the service identifier included in the local service identifier list belongs to a preset host address network segment, where the preset host address network segment is an IPv6 address network segment that is applied for mobile service in advance, and the preset host address network segment is dedicated for mobile service.
In another embodiment of the present application, the receiving module 601 is specifically configured to:
receiving a first request message sent by a terminal; or alternatively, the process may be performed,
and receiving a first request message forwarded by the router.
The embodiment of the present application further provides an electronic device, which may be a router, as shown in fig. 7, including a processor 701, a communication interface 702, a memory 703, and a communication bus 704, where the processor 701, the communication interface 702, and the memory 703 complete communication with each other through the communication bus 704,
a memory 703 for storing a computer program;
the processor 701 is configured to implement the method steps in the above-described method embodiment when executing the program stored in the memory 703.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present application, a computer readable storage medium is provided, in which a computer program is stored, the computer program implementing the steps of any one of the above-mentioned message forwarding methods when executed by a processor.
In yet another embodiment of the present application, a computer program product comprising instructions that, when executed on a computer, cause the computer to perform any of the message forwarding methods of the embodiments described above is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments in part.
The foregoing description of the preferred embodiments of the application is not intended to limit the application to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the application are intended to be included within the scope of the application.

Claims (12)

  1. A method for forwarding a message, wherein the method is applied to a router, and the method comprises:
    receiving a first request message, wherein a host address segment of a destination IP address of the first request message is used for representing a service identifier of a service requested by the first request message;
    if the service identifier which is the same as the address segment of the host exists in the local service identifier list, forwarding the first request message to a local server; the local service identification list comprises service identifications of services which can be provided by the local server cluster;
    and if the service identification which is the same as the address segment of the host computer does not exist in the local service identification list, forwarding the first request message to other routers based on the destination IP address of the first request message.
  2. The method of claim 1, wherein prior to said receiving the first request message, the method further comprises:
    acquiring a corresponding relation between a Uniform Resource Locator (URL) and a public network IP address of a service which can be provided by a local server cluster from a name server of the local server cluster;
    extracting a host address of each public network IP address from the obtained public network IP addresses included in the corresponding relation;
    and generating the local service identifier list by taking the extracted host address as a service identifier.
  3. The method according to claim 1 or 2, wherein forwarding the first request message to a local server if the same service identifier as the host address field exists in the local service identifier list comprises:
    if the service identification which is the same as the address segment of the host exists in the local service identification list, the destination IP address of the first request message is converted into the IP address of load balancing equipment, a second request message is obtained, and the second request message is sent to a local server through the load balancing equipment.
  4. The method of claim 1, wherein the service identifier included in the local service identifier list belongs to a preset host address network segment, the preset host address network segment being an IPv6 address network segment that is previously applied for mobile class services, and the preset host address network segment being dedicated for the mobile class services.
  5. The method of claim 1, wherein the receiving the first request message comprises:
    receiving a first request message sent by a terminal; or alternatively, the process may be performed,
    and receiving a first request message forwarded by the router.
  6. A message forwarding apparatus, wherein the apparatus is applied to a router, the apparatus comprising:
    the receiving module is used for receiving a first request message, and a host address segment of a destination IP address of the first request message is used for representing a service identifier of a service requested by the first request message;
    the first forwarding module is configured to forward the first request packet to a local server if a service identifier identical to the address field of the host exists in the local service identifier list; the local service identification list comprises service identifications of services which can be provided by the local server cluster;
    and the second forwarding module is used for forwarding the first request message to other routers based on the destination IP address of the first request message if the service identifier which is the same as the host address segment does not exist in the local service identifier list.
  7. The apparatus of claim 6, wherein the apparatus further comprises:
    the acquisition module is used for acquiring the corresponding relation between the URL of the service which can be provided by the local server cluster and the public network IP address from the name server of the local server cluster;
    the extraction module is used for extracting the host address of each public network IP address from the obtained public network IP addresses included in the corresponding relation;
    and the generation module is used for generating the local service identifier list by taking the extracted host address as the service identifier.
  8. The device according to claim 6 or 7, characterized in that said first forwarding module is specifically configured to:
    if the service identification which is the same as the address segment of the host exists in the local service identification list, the destination IP address of the first request message is converted into the IP address of load balancing equipment, a second request message is obtained, and the second request message is sent to a local server through the load balancing equipment.
  9. The apparatus of claim 6, wherein the service identities included in the local service identity list belong to a pre-set host address network segment, the pre-set host address network segment being an IPv6 address network segment that was previously applied for mobile class services, the pre-set host address network segment being specific to the mobile class services.
  10. The apparatus of claim 6, wherein the receiving module is specifically configured to:
    receiving a first request message sent by a terminal; or alternatively, the process may be performed,
    and receiving a first request message forwarded by the router.
  11. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
    a memory for storing a computer program;
    a processor for carrying out the method steps of any one of claims 1-5 when executing a program stored on a memory.
  12. A machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: method steps of any of claims 1-5 are achieved.
CN202180004368.3A 2021-12-31 2021-12-31 Message forwarding method and device, electronic equipment and medium Pending CN116686273A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/143521 WO2023123308A1 (en) 2021-12-31 2021-12-31 Packet forwarding method, device, electronic equipment, and medium

Publications (1)

Publication Number Publication Date
CN116686273A true CN116686273A (en) 2023-09-01

Family

ID=86997154

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202180004368.3A Pending CN116686273A (en) 2021-12-31 2021-12-31 Message forwarding method and device, electronic equipment and medium

Country Status (2)

Country Link
CN (1) CN116686273A (en)
WO (1) WO2023123308A1 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5169859B2 (en) * 2009-01-16 2013-03-27 日本電気株式会社 Network system, network terminal address selection method, network terminal address selection device
CN105812261B (en) * 2016-03-07 2019-02-26 北京交通大学 Message forwarding method and system in information centre's network
CN107277882B (en) * 2016-04-07 2020-07-07 中国移动通信有限公司研究院 Data routing method, device and base station
CN112398801A (en) * 2019-08-19 2021-02-23 华为技术有限公司 Data processing method and device

Also Published As

Publication number Publication date
WO2023123308A1 (en) 2023-07-06

Similar Documents

Publication Publication Date Title
EP3993347A1 (en) Method and device for application migration
CN109842906B (en) Communication method, device and system
EP4167625A1 (en) Communication method and apparatus
KR102217145B1 (en) Method and device for network function
US11729137B2 (en) Method and device for edge application server discovery
US20130238782A1 (en) Method and apparatus for identifying an application associated with an ip flow using dns data
US20150172436A1 (en) Application Service Platform with Access to Context Data of Remote Access Node
EP3668058B1 (en) Content distribution method and system
US11895083B2 (en) Address obtaining method and an address obtaining apparatus
CN109644335B (en) Identification information processing method, database control system and related equipment
CN113285827B (en) Data transmission method, system and related device
CN112217856A (en) Address acquisition method, device, equipment and storage medium of application example
US20220248321A1 (en) Methods and Apparatus for Transport Context Translation
CN113692753B (en) Network device and method for searching edge service implemented in network device
CN116686273A (en) Message forwarding method and device, electronic equipment and medium
US10111081B2 (en) Local communication wireless network system and method thereof
CN113973098A (en) Method and device for sending domain name system request
CN114945016B (en) Information processing method, device and equipment
CN104580397B (en) Page access method and the network equipment
CN113766040B (en) Communication method, device and computer readable storage medium
CN113422772B (en) Private network terminal access processing method and device and electronic equipment
US20230025344A1 (en) Application Discovery Method, Apparatus, and System, and Computer Storage Medium
KR20180004142A (en) Aggregation of targeted and search queries
CN118283003A (en) Communication method and device
CN117062019A (en) Policy coordination method, network function and computer readable storage medium

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