WO2023123308A1 - 一种报文转发方法、装置、电子设备及介质 - Google Patents

一种报文转发方法、装置、电子设备及介质 Download PDF

Info

Publication number
WO2023123308A1
WO2023123308A1 PCT/CN2021/143521 CN2021143521W WO2023123308A1 WO 2023123308 A1 WO2023123308 A1 WO 2023123308A1 CN 2021143521 W CN2021143521 W CN 2021143521W WO 2023123308 A1 WO2023123308 A1 WO 2023123308A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
request message
service identifier
local
service
Prior art date
Application number
PCT/CN2021/143521
Other languages
English (en)
French (fr)
Inventor
王玮
Original Assignee
新华三技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 新华三技术有限公司 filed Critical 新华三技术有限公司
Priority to PCT/CN2021/143521 priority Critical patent/WO2023123308A1/zh
Priority to CN202180004368.3A priority patent/CN116686273A/zh
Publication of WO2023123308A1 publication Critical patent/WO2023123308A1/zh

Links

Images

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

Definitions

  • the present application relates to the technical field of communications, and in particular to a message forwarding method, device, electronic equipment and media.
  • the terminal After the terminal queries the IP address corresponding to a URL through the domain name resolution service (Domain Name Server, DNS) server, it will cache the corresponding relationship between the URL and the IP address, and subsequent access requests for the URL will be sent to the corresponding URL of the IP address. server.
  • DNS Domain Name Server
  • the terminal may move, and as the terminal moves, the server most suitable for serving the terminal will change, and the terminal will still send an access request to the server corresponding to the IP address based on the cached URL-IP address correspondence , resulting in a higher terminal access delay.
  • the purpose of the embodiment of the present application is to provide a message forwarding method, device, electronic equipment and medium, so as to reduce terminal access delay.
  • the specific technical scheme is as follows:
  • the embodiment of the present application provides a message forwarding method, the method is applied to a router, and the method includes:
  • the local service identifier list includes services that can be provided by the local server cluster logo;
  • the method before receiving the first request message, the method further includes:
  • the extracted host address is used as the service identifier to generate the local service identifier list.
  • forwarding the first request message to the local server includes:
  • the service identifier included in the local service identifier list belongs to a preset host address network segment, and the preset host address network segment is an IPv6 address network segment pre-applied for mobile services, so The network segment of the preset host address is dedicated to the mobile service.
  • the receiving the first request message includes:
  • the embodiment of the present application provides a message forwarding device, the device is applied to a router, and the device includes:
  • a receiving module configured to receive a first request message, where the host address segment of the destination IP address of the first request message is used to represent the service identifier of the service requested by the first request message;
  • a first forwarding module configured to forward the first request message to a local server if there is a service identifier identical to the host address segment in the local service identifier list; wherein the local server is included in the local service identifier list The service ID of the service that the cluster can provide;
  • a second forwarding module configured to forward the first request message to other routers based on the destination IP address of the first request message if there is no service identifier identical to the host address segment in the local service identifier list .
  • the device further includes:
  • the acquisition module is used to obtain the correspondence between the URL of the service that the local server cluster can provide and the public network IP address from the name server of the local server cluster;
  • An extraction module configured to extract the host address of each public network IP address from the public network IP addresses included in the obtained correspondence
  • a generating module configured to use the extracted host address as a service identifier to generate the local service identifier list.
  • the first forwarding module is specifically configured to:
  • the service identifier included in the local service identifier list belongs to a preset host address network segment, and the preset host address network segment is an IPv6 address network segment pre-applied for mobile services, so The network segment of the preset host address is dedicated to the mobile service.
  • the receiving module is specifically configured to:
  • the embodiment of the present application further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication with each other through the communication bus;
  • the processor is configured to implement the method steps described in the first aspect above when executing the program stored in the memory.
  • the embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
  • the embodiment of the present application further provides a computer program product containing instructions, which, when run on a computer, causes the computer to execute the method described in the first aspect above.
  • the host address segment of the destination IP address is used to represent the service identifier requested by the first request message.
  • the service identifier indicates that the local server can provide the service requested by the first request message, and then forward the first request message to the local server. That is to say, no matter whether the destination address of the first request message is the IP address of the local server or not, as long as the host address segment of the destination address of the first request message belongs to the local service identifier list, the first request message can be processed by the local server. In this way, there is no need to continue forwarding the first request message to other routers, which can increase the response speed of the first request message and reduce the access delay of the terminal.
  • FIG. 1 is an architecture diagram of a computing power network system provided by an embodiment of the present application
  • FIG. 2 is an architecture diagram of an edge cloud provided by an embodiment of the present application
  • FIG. 3 is a flow chart of a message forwarding method provided in an embodiment of the present application.
  • FIG. 4 is a flow chart of another message forwarding method provided by the embodiment of the present application.
  • FIG. 5 is a flowchart of another message forwarding method provided by the embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a message forwarding device provided in an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the technical solution of the present application can be applied to various communication systems, such as: Long Time Evolution (Long Time Evolution, LTE) Time Division Duplex (Time Division Duplex, TDD) system, Universal Mobile Telecommunication System (Universal Mobile Telecommunication System, UMTS), global Interoperability for Microwave Access (WiMAX) communication system, Public Land Mobile Network (PLMN) system, LTE system, New Radio (NR) system, 4.5G communication system, 5G communication system, and various wireless communication systems in the future.
  • LTE Long Time Evolution
  • TDD Time Division Duplex
  • Universal Mobile Telecommunication System Universal Mobile Telecommunication System
  • UMTS Universal Mobile Telecommunication System
  • WiMAX global Interoperability for Microwave Access
  • PLMN Public Land Mobile Network
  • LTE system Long Radio (LTE) system
  • LTE system Long Radio (LTE) Time Division Duplex
  • UMTS Universal Mobile Telecommunication System
  • WiMAX global Interoperability for Microwave Access
  • PLMN Public Land Mobile Network
  • LTE Long Radio
  • NR New Radio
  • Edge computing refers to an open platform that integrates network, computing, storage, and application core capabilities on the side of the communication system close to the data source.
  • the open platform can be The terminal provides services nearby.
  • FIG. 1 is an architecture diagram of a computing power network system provided by an embodiment of the present application.
  • the computing power network system includes a central cloud, a city cloud, and an edge cloud.
  • FIG. 1 exemplarily shows an edge cloud 1 , an edge cloud 2 , and an edge cloud 3 , and the number of edge clouds in actual implementation is not limited thereto.
  • the edge cloud, city cloud, and central cloud all include server clusters, which can provide services for terminals, and the service request packets of terminals are first forwarded to the edge cloud. If the edge cloud cannot handle them, they will be forwarded to the city cloud for processing. If the cloud cannot handle it, it will be forwarded to the central cloud for processing.
  • edge cloud 1 is connected to router 1
  • edge cloud 2 is connected to router 2
  • edge cloud 3 is connected to router 3.
  • the router is used to support the communication between the edge cloud and the outside world, the router is connected to the user plane function (User Plane Function, UPF) unit, and the UPF is connected to the base station.
  • UPF User Plane Function
  • router 1 is connected to base station 1 through UPF
  • router 2 is connected to base station 2 through UPF
  • router 3 is connected to base station 3 through UPF.
  • the base station can be a distributed base station.
  • the distributed base station includes a remote radio unit (Remote Radio Unit, RRU) and a base band unit (Base Band Unit, BBU). See Figure 1.
  • RRU Remote Radio Unit
  • BBU Base Band Unit
  • the base station in the embodiment of the present application can also be an evolved base station (NodeB or eNB or e-NodeB, evolutional Node B) in the LTE system or Advanced Long-Term Evolution (Long Termevolution-Advanced, LTE-A), or it can also include an evolved The packet core network (Evolved Packet Core, EPC), the fifth generation communication technology (the 5th Generation, 5G), the next generation Node B (next generation Node B, gNB) in the NR system or including the cloud access network (Cloud Radio The centralized unit (Centralized Unit, CU) and the distributed unit (Distributed Unit, DU) in the Access Network (Cloud RAN) system are not limited in this embodiment of the application.
  • EPC evolved Packet Core
  • 5G Fifth Generation
  • 5G next generation Node B
  • gNB next generation Node B
  • cloud access network Cloud Radio
  • the terminal in the embodiment of the present application is a wireless terminal device, and the wireless terminal device can communicate with one or more core networks (Core Network, CN) via a radio access network (Radio Access Network, RAN), and the wireless terminal device can be a mobile Terminal equipment, such as mobile phones (or "cellular" phones) and computers with mobile terminal equipment, for example, can be portable, pocket, handheld, computer built-in or vehicle-mounted mobile devices, such as mobile phones, pads, notebooks Computers, wearable devices, etc., which exchange language and/or data with the radio access network.
  • Core Network Core Network
  • RAN Radio Access Network
  • the edge cloud in FIG. 1 may include a load balancing device and a local server cluster.
  • the local server cluster includes multiple servers, and each server may provide one or more services.
  • the load balancing device is connected to the router. 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 policy and forward the request message to the server.
  • the terminal can send a service request to the base station, the base station forwards the service request to the UPF, and then the UPF forwards the service request to the router. If the router recognizes that the destination IP address of the service request message is the IP address of the local server address, the service request message is forwarded to the server in the local edge cloud, if it is recognized 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.
  • the embodiment of the present application provides a message forwarding method, which is applied to a router, and the method includes:
  • the host address segment of the destination IP address of the first request message is used to indicate the service identifier of the service requested by the first request message;
  • the first request message is forwarded to the local server; wherein, the local service identifier list includes service identifiers of services that the local server cluster can provide;
  • the first request packet is forwarded to other routers based on the destination IP address of the first request packet.
  • the host address segment of the destination IP address is used to represent the service identifier requested by the first request message.
  • the local server After receiving the first request message, if there is a service identifier identical to the above-mentioned host address segment in the local service list , it means that the local server can provide the service requested by the first request message, and then forward the first request message to the local server.
  • the first request message can be processed by the local server In this way, there is no need to continue forwarding the first request message to other routers, which can increase the response speed of the first request message and reduce the access delay of the terminal.
  • the embodiment of the present application provides a message forwarding method, which is applied to a router, such as the router connected to the edge cloud in Figure 1, as shown in Figure 3, the method includes:
  • S301 Receive a first request message, where the host address segment of the destination IP address of the first request message is used to indicate the service identifier of the service requested by the request message.
  • the first request message may be a Hyper Text Transfer Protocol (Hyper Text Transfer Protocol, HTTP) request message.
  • HTTP Hyper Text Transfer Protocol
  • the destination IP address of the first request message is the public network IP address of the server that provides services to the terminal, and the destination IP address includes a network address segment and a host address segment, wherein the network address segment indicates the network location of the server, and the host address segment is used to indicate The service ID of the server.
  • the encoding rule of the public network IP address of the server in the embodiment of the present application is "network address: service identification".
  • the first 64 bits of a 128-bit public network IP address may be a network address segment, and the last 64 bits may be a host address segment.
  • the same service identifier is used, that is, a service has a unique identifier.
  • the IP addresses of the three servers include the same host address segment and different network address segments.
  • the local service identification list includes service identifications of services that the local server cluster can provide.
  • the local service cluster can provide service A, service B, and service C.
  • the service IDs corresponding to service A, service B, and service C are 1100:0000:0000:0001, 1100:0000:0000:0011, and 1100:0000: 0000:0111
  • the local service identification list includes 1100:0000:0000:0001, 1100:0000:0000:0011, 1100:0000:0000:0111.
  • the service identifiers included in the local service identifier list may be service identifiers of mobile services, and the mobile services are highly mobile services, such as Internet of Vehicles services.
  • the router may forward the first request message to other routers based on the routing table.
  • the routing table includes a plurality of forwarding table entries, and each forwarding table entry includes at least an IP address, an outgoing interface and a next hop, and the router can match the destination IP address of the first request message with the forwarding table entry in the routing table, The first request packet is forwarded based on the outbound interface and the next hop included in the matched forwarding entry.
  • router 1 forwards the first request packet to router 2.
  • the host address segment of the destination IP address is used to represent the service identifier requested by the first request message.
  • ID it means that the local server can provide the service requested by the first request message, and then forward the first request message to the local server. That is to say, no matter whether the destination address of the first request message is the IP address of the local server or not, as long as the host address segment of the destination address of the first request message belongs to the local service identifier list, the first request message can be processed by the local server. In this way, there is no need to continue forwarding the first request message to other routers, which can increase the response speed of the first request message and reduce the access delay of the terminal.
  • the above S301, receiving the first request message specifically includes the following two implementation manners.
  • Manner 1 Receive the first request message sent by the client.
  • the router can obtain the purpose of the first request message
  • the host address segment included in the IP address if the same service identifier as the host address segment exists in the local service identifier list, the first request message can be processed by the local server.
  • the first case is: the destination IP address of the first request message is the same as the public network IP address of the local server.
  • the scene corresponding to the first case is described in conjunction with Figure 1.
  • terminal 1 accesses URL1 within the coverage of base station 1
  • the terminal obtains the correspondence between URL1 and IP address 1 by querying the DNS server.
  • This IP address 1 is the edge Public network IP address of server 1 (not shown in FIG. 1 ) in cloud 1.
  • terminal 1 sends the first request message
  • the destination IP address of the first request message is the public network IP address of server 1
  • router 1 can receive the first request message, and send the first request message Forward to server 1.
  • the destination IP address of the first request message is the same as the public network IP address of the local server.
  • the second situation is: the destination IP address of the first request message is different from the public network IP address of the local server. Specifically, the network address segment of the above-mentioned destination IP address is different from the network address segment of the above-mentioned public network IP address.
  • the host address segment of the IP address is the same as the host address segment of the above-mentioned public network IP address.
  • server 2 (not shown in FIG. 1 ) in edge cloud 2 can provide the same service as server 1, and terminal 1 moves from the coverage area of base station 1 to base station 2, at this time, the corresponding relationship between URL1 and IP address 1 is still stored in terminal 1.
  • the destination address of the first request message sent by terminal 1 is still IP address 1, and because terminal 1 is within the coverage of base station 2, the first request message will be sent to router 2.
  • router 2 After router 2 receives the first request message, it obtains the host address segment of IP address 1 included in the first request message, and determines that the local service identifier list includes the same service identifier as the host address segment, and then uses the first The request packet is forwarded to the server 2 without forwarding the first request packet to the router 1 according to the routing table.
  • the public IP addresses of server 1 and server 2 include different network address segments, but the host address segments are the same.
  • the public IP address of Server 1 is 1:1:1:1:1:0:0
  • the public IP address of 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 server 1 is different from the network address segment 1:1:1:2 of the public network IP address of server 2, but the public networks of server 1 and server 2
  • the host address segment of IP is the same, both are 1:0:0:0.
  • the destination IP address of the first request message is the public network IP address of server 1
  • the first request message is forwarded to server 2 nearby, reducing the need for router 2 to forward the first request message to router 1, and then router 1
  • the time delay caused by forwarding the first message to the server 1 can make the first request message be responded faster, and can reduce the access time delay of the terminal 1 .
  • Method 2 Receive the first request message sent by the router.
  • the first request message is forwarded by other routers, and the first request message forwarded by other routers can also be processed according to the above-mentioned flow in FIG. 3 .
  • the public network IP address of the server can be an IPv6 address, and the network address resources of the IPv6 address are sufficient.
  • the length of the host address segment of the current IPv6 address is 64 bits, which can provide a huge address space, and use this address space , service identifiers can be assigned to all services on the entire network.
  • the service ID of the service is not limited to the IPv6 address network segment.
  • the IPv6 address network segment applied for mobile services can be a network segment that is not currently in use.
  • the IPv6 address network segment is 1100:0000:0000:0000.
  • it can also be other unused network segments.
  • the embodiment of the application does not limit this.
  • IPv6 address network segment for mobile services By applying for an unused IPv6 address network segment for mobile services as a dedicated host address network segment for mobile services, it can avoid affecting the currently applied network segment, thereby avoiding conflicts with existing IP addresses.
  • Other host address networks The segment can continue to be used by other service applications without being affected by the dedicated host address network segment in the embodiment of the present application.
  • the service identifiers in the local service identifier list in the embodiment of the present application belong to the preset host address network segment. Segments are dedicated to mobile class services.
  • the router needs to generate a list of local service identifiers in advance, before S301, as shown in Figure 4, the method also includes the following steps:
  • each edge cloud also includes a name server (Name Server), which stores the correspondence between the URL and IP address of each service that the local server cluster can provide, and the router can call the application program interface of the name server (Application Programming Interface, API), and then obtain the corresponding relationship between the service URL of the local service cluster and the public network IP address from the name server.
  • name server name server
  • API Application Programming Interface
  • the host address in the public network IP address is the service identifier, so the extracted host address is the service identifier that the local server cluster can provide.
  • the host address included in the public network IP address is the service identifier
  • the router can obtain the corresponding relationship between the URL of the local server cluster and the public network IP address from the name server of the local server cluster.
  • the service identifiers of all the services that the local server can provide can be extracted, and then a service identifier list can be generated.
  • the terminal can be provided with nearby services to reduce the access delay of the terminal.
  • the embodiment of the present application may also update the local service identification list in real time.
  • the method includes:
  • the services that the local server cluster can provide may change, and accordingly the corresponding relationship between the URL and the IP address will also change, and the router can obtain the latest URL and public network IP of the services that the local server cluster can provide in real time Correspondence between addresses.
  • the extracted host address includes a host address that does not exist in the local service list, add the host address to the local service identifier list; if there is a host address other than the extracted host address in the local service list, add The host address is removed from the local service list.
  • the corresponding relationship between the URL of the service provided by the local server cluster and the public network IP address can be obtained from the name server in real time, and the host address can be extracted from the obtained public network IP address of the corresponding relationship.
  • the router can obtain the latest corresponding relationship in time, which can make the service identifiers in the local service identifier list consistent with the services that the current local server cluster can provide, and improve the quality of routers based on local services. Indicates the accuracy of forwarding packets in the identification list.
  • the router can also periodically obtain the correspondence between the URL of the service that the local server cluster can provide and the public network IP address from the name server, and extract the hostname of each public network IP address from it. address, and then update the local service identification list based on the host address extracted from each public network IP address.
  • this method can reduce the processing overhead of the router, and can make the service identification in the local service identification list consistent with the services that the current local server cluster can provide. , to improve the accuracy of the router forwarding packets based on the local service identification list.
  • the above S302 if the same service identifier as the host address segment exists in the local service identifier list, then forward the first request message to the local server, which can be specifically implemented as:
  • the destination IP address of the first request message is converted to the IP address of the load balancing device, and the second request message is obtained, and sent to the local server through the load balancing device Send the second request message.
  • the router can send the second request message to the load balancing device, so that the load balancing device converts the destination IP address of the second request message into the IP address of the local server based on the load balancing policy, and then forwards it to the local server.
  • the load balancing strategy may be set based on actual conditions, and a load balancing strategy in related technologies may be adopted, which is not limited in this embodiment of the present application.
  • the load balancing device may determine a local server for processing the second request packet based on the load balancing policy, and then convert the destination IP address of the second request packet into the private network IP address of the local server.
  • the local server may generate a response message to the second request message, and the local server may forward the response message to the terminal through the router.
  • the local server in the embodiment of the present application provides a short connection and stateless service for the terminal.
  • a short connection and stateless service for the terminal.
  • information query service for example, information query service, data calculation service, etc.
  • the first request message sent by the terminal is processed by different servers to obtain the same response content.
  • the router After the router receives the first request message, it does not directly forward it through the routing table, but first judges whether the local server can process the first request message, and if so, the local server processes the first request message.
  • the text does not need to be forwarded to the server corresponding to the destination IP address of the first request message, which can reduce the access delay.
  • the embodiment of the present application also provides a packet forwarding device, which is applied to a router, as shown in Figure 6, the device includes:
  • the receiving module 601 is configured to receive a first request message, where the host address segment of the destination IP address of the first request message is used to indicate the service identifier of the service requested by the first request message;
  • the first forwarding module 602 is configured to forward the first request message to the local server if there is a service identifier identical to the host address segment in the local service identifier list; wherein, the local service identifier list includes local The service identifier of the service that the server cluster can provide;
  • 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 there is no service identifier identical to the host address segment in the local service identifier list arts.
  • the device further includes:
  • the acquisition module is used to obtain the correspondence between the URL of the service that the local server cluster can provide and the public network IP address from the name server of the local server;
  • An extraction module configured to extract the host address of each public network IP address from the public network IP addresses included in the obtained correspondence
  • a generating module configured to use the extracted host address as a service identifier to generate the local service identifier list.
  • the first forwarding module 602 is specifically configured to:
  • the service identification included in the local service identification list belongs to the preset host address network segment, and the preset host address network segment is an IPv6 address network segment previously applied for for mobile services.
  • the address network segment is dedicated to mobile services.
  • the receiving module 601 is specifically used for:
  • the embodiment of the present application also provides an electronic device, which may be a router, as shown in FIG. , the memory 703 completes mutual communication through the communication bus 704,
  • Memory 703 used to store computer programs
  • the processor 701 is configured to implement the method steps in the foregoing method embodiments when executing the program stored in the memory 703 .
  • the communication bus mentioned above for the electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus or the like.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in the figure, but it does not mean that there is 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 a random access memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk memory.
  • RAM Random Access Memory
  • NVM non-Volatile Memory
  • the memory may also be at least one storage device located far away from the aforementioned processor.
  • the above-mentioned processor can be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it can also be a digital signal processor (Digital Signal Processing, DSP), dedicated integrated Circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • CPU Central Processing Unit
  • NP Network Processor
  • DSP Digital Signal Processing
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • FPGA Field-Programmable Gate Array
  • a computer-readable storage medium is also provided, and a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any of the above message forwarding is realized. method steps.
  • a computer program product including instructions is also provided, and when it is run on a computer, it causes the computer to execute any message forwarding method in the above embodiments.
  • all or part of them may be implemented by software, hardware, firmware or any combination thereof.
  • software When implemented using software, it 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 the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, 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 or a data center integrated with one or more available media.
  • the available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a Solid State Disk (SSD)).
  • each embodiment in this specification is described in a related manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments.
  • the description is relatively simple, and for relevant parts, please refer to part of the description of the method embodiment.

Landscapes

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

Abstract

本申请提供一种报文转发方法、装置、电子设备及介质,涉及通信技术领域,该方法包括:接收第一请求报文,第一请求报文的目的IP地址的主机地址段用于表示第一请求报文所请求服务的服务标识;如果本地服务标识列表中存在与主机地址段相同的服务标识,则向本地服务器转发第一请求报文;其中,本地服务标识列表中包括本地服务器集群能够提供的服务的服务标识;如果本地服务标识列表中不存在与主机地址段相同的服务标识,则基于第一请求报文的目的IP地址向其他路由器转发第一请求报文。可以降低终端访问时延。

Description

一种报文转发方法、装置、电子设备及介质 技术领域
本申请涉及通信技术领域,尤其涉及一种报文转发方法、装置、电子设备及介质。
背景技术
在移动通信网络中,当终端需要访问一个统一资源定位符(Uniform Resource Locator,URL)时,需进行域名解析,以获取该URL对应的目的网际互连协议(Internet Protocol,IP)地址,进而向该目的IP地址对应的服务器发送访问请求。随着技术的发展,对于一些移动性强的服务,一个URL可以由分布在多地的多台服务器提供服务。
终端在通过域名解析服务(Domain Name Server,DNS)服务器查询到一个URL对应的IP地址后,会缓存该URL与IP地址的对应关系,后续针对该URL的访问请求都会被发送到该IP地址对应的服务器。然而,终端可能会发生移动,随着终端的移动,最适合为终端服务的服务器会发生变化,而终端依然会基于缓存的URL与IP地址的对应关系,向该IP地址对应的服务器发送访问请求,导致终端的访问时延较高。
发明内容
本申请实施例的目的在于提供一种报文转发方法、装置、电子设备及介质,以降低终端访问时延。具体技术方案如下:
第一方面,本申请实施例提供一种报文转发方法,所述方法应用于路由器,所述方法包括:
接收第一请求报文,所述第一请求报文的目的IP地址的主机地址段用于表示所述第一请求报文所请求服务的服务标识;
如果本地服务标识列表中存在与所述主机地址段相同的服务标识,则向本地服务器转发所述第一请求报文;其中,所述本地服务标识列表中包括本地服务器集群能够提供的服务的服务标识;
如果本地服务标识列表中不存在与所述主机地址段相同的服务标识,则基于所述第一请求报文的目的IP地址向其他路由器转发所述第一请求报文。
在一种可能的实现方式中,在所述接收第一请求报文之前,所述方法还包括:
从本地服务器集群的名字服务器获取本地服务器集群所能够提供的服务的统一资源定位符URL和公网IP地址之间的对应关系;
从获取到对应关系包括的公网IP地址中,提取各公网IP地址的主机地址;
将提取出的主机地址作为服务标识生成所述本地服务标识列表。
在一种可能的实现方式中,所述如果本地服务标识列表中存在与所述主机地址段相同的服务标识,则向本地服务器转发所述第一请求报文,包括:
如果本地服务标识列表中存在与所述主机地址段相同的服务标识,则将所述第一请求报文的目的IP地址转换为负载均衡设备的IP地址,得到第二请求报文,通过所述负载均衡设备向本地服务器发送所述第二请求报文。
在一种可能的实现方式中,所述本地服务标识列表中包括的服务标识属于预设主机地址网段,所述预设主机地址网段为预先为移动类服务申请的IPv6地址网段,所述预设主机地址网段由所述移动类服务专用。
在一种可能的实现方式中,所述接收第一请求报文,包括:
接收终端发送的第一请求报文;或者,
接收路由器转发的第一请求报文。
第二方面,本申请实施例提供一种报文转发装置,所述装置应用于路由器,所述装置包括:
接收模块,用于接收第一请求报文,所述第一请求报文的目的IP地址的主机地址段用于表示所述第一请求报文所请求服务的服务标识;
第一转发模块,用于如果本地服务标识列表中存在与所述主机地址段相同的服务标识,则向本地服务器转发所述第一请求报文;其中,所述本地服务标识列表中包括本地服务器集群能够提供的服务的服务标识;
第二转发模块,用于如果本地服务标识列表中不存在与所述主机地址段相同的服务标识,则基于所述第一请求报文的目的IP地址向其他路由器转发所述第一请求报文。
在一种可能的实现方式中,所述装置还包括:
获取模块,用于从本地服务器集群的名字服务器获取本地服务器集群所能够提供的服务的URL和公网IP地址之间的对应关系;
提取模块,用于从获取到对应关系包括的公网IP地址中,提取各公网IP地址的主机地址;
生成模块,用于将提取出的主机地址作为服务标识生成所述本地服务标识列表。
在一种可能的实现方式中,所述第一转发模块,具体用于:
如果本地服务标识列表中存在与所述主机地址段相同的服务标识,则将所述第一请求报文的目的IP地址转换为负载均衡设备的IP地址,得到第二请求报文,通过所述负载均衡设备向本地服务器发送所述第二请求。
在一种可能的实现方式中,所述本地服务标识列表中包括的服务标识属于预设主机地址网段,所述预设主机地址网段为预先为移动类服务申请的IPv6地址网段,所述预设主机地址网段由所述移动类服务专用。
在一种可能的实现方式中,所述接收模块,具体用于:
接收终端发送的第一请求报文;或者,
接收路由器转发的第一请求报文。
第三方面,本申请实施例还提供一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;
存储器,用于存放计算机程序;
处理器,用于执行存储器上所存放的程序时,实现上述第一方面所述的方法步骤。
第四方面,本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现第一方面所述的方法。
第五方面,本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的方法。
采用上述技术方案,目的IP地址的主机地址段用于表示第一请求报文所 请求的服务标识,当接收到第一请求报文后,如果本地服务标识列表中存在与上述主机地址段相同的服务标识,则说明本地服务器能够提供第一请求报文所请求的服务,进而向本地服务器转发第一请求报文。也就是说,无论第一请求报文的目的地址是否为本地服务器的IP地址,只要第一请求报文的目的地址的主机地址段属于本地服务标识列表,就可以由本地服务器处理第一请求报文,如此,就无需继续向其他的路由器转发该第一请求报文,可以提高第一请求报文被响应的速度,降低终端的访问时延。
附图说明
为了更清楚地说明本发明实施例和现有技术的技术方案,下面对实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种算力网络系统的架构图;
图2为本申请实施例提供的一种边缘云的架构图;
图3为本申请实施例提供的一种报文转发方法的流程图;
图4为本申请实施例提供的另一种报文转发方法的流程图;
图5为本申请实施例提供的另一种报文转发方法的流程图;
图6为本申请实施例提供的一种报文转发装置的结构示意图;
图7为本申请实施例提供的一种电子设备的结构示意图。
具体实施方式
为使本发明的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本发明进一步详细说明。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本申请的技术方案可以应用于各种通信系统,例如:长期演进(Long Time Evolution,LTE)时分双工(Time Division Duplex,TDD)系统、通用移动通信系统(Universal Mobile Telecommunication System,UMTS)、全球互联微波接入 (Worldwide Interoperability for Microwave Access,WiMAX)通信系统、公共陆地移动网络(Public Land Mobile Network,PLMN)系统、LTE系统、新空口(New Radio,NR)系统、4.5G通信系统、5G通信系统、以及未来的各种无线通信系统等。本申请实施例描述的网络架构以及业务场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着网络架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
本申请实施例具体可以应用于边缘计算的场景中,边缘计算是指在通信系统中靠近数据源头的一侧,采用网络、计算、存储、应用核心能力为一体的开放平台,该开放平台可以为终端就近提供服务。
如图1所示,图1为本申请实施例提供的一种算力网络系统的架构图,该算力网络系统包括中心云、城市云、边缘云。图1中示例性地示出了边缘云1、边缘云2、边缘云3,实际实现中边缘云的数量不限于此。
边缘云与边缘云之间,边缘云与城市云之间,城市云与中心云之间均通过路由器通信。边缘云、城市云和中心云中都包括服务器集群,服务器集群可以为终端提供服务,终端的服务请求报文先被转发到边缘云,若边缘云无法处理,则转发给城市云处理,若城市云无法处理,则转发给中心云处理。
其中,每个边缘云连接于路由器,例如,边缘云1连接于路由器1,边缘云2连接于路由器2,边缘云3连接于路由器3。
路由器用于支持边缘云与外界的通信,路由器连接于用户面功能(User Plane Function,UPF)单元、UPF连接于基站。例如,路由器1通过UPF连接于基站1,路由器2通过UPF连接于基站2,路由器3通过UPF连接于基站3。
该基站可以为分布式基站,分布式基站包括射频拉远单元(Remote Radio Unit,RRU)和基带单元(Base Band Unit,BBU),参见图1,UPF连接于BBU,BBU连接于RRU,终端设备可通过RRU访问边缘云。
本申请实施例中的基站还可以为LTE系统或高级长期演进(Long Termevolution-Advanced,LTE-A)中的演进型基站(NodeB或eNB或e-NodeB,evolutional Node B),或者也可以包括演进的分组核心网络(Evolved Packet  Core,EPC)、第五代通信技术(the 5th Generation,5G)、NR系统中的下一代节点B(next generation Node B,gNB)或者包括云接入网(Cloud Radio Access Network,Cloud RAN)系统中的集中式单元(Centralized Unit,CU)和分布式单元(Distributed Unit,DU),本申请实施例并不限定。
本申请实施例中的终端为无线终端设备,无线终端设备可以经无线接入网(Radio Access Network,RAN)与一个或多个核心网(Core Network,CN)进行通信,无线终端设备可以是移动终端设备,如移动电话(或称为“蜂窝”电话)和具有移动终端设备的计算机,例如,可以是便携式、袖珍式、手持式、计算机内置的或者车载的移动装置,比如手机、pad、笔记本电脑、可穿戴设备等,它们与无线接入网交换语言和/或数据。
如图2所示,图1中的边缘云中可以包括负载均衡设备和本地服务器集群,本地服务器集群中包括多台服务器,每台服务器可提供一种或多种服务。
负载均衡设备连接于路由器,负载均衡设备接收到路由器转发的请求报文后,可基于负载均衡策略从本地服务器集群中选择一台服务器,并向该服务器转发请求报文。
当终端需要获取网络服务时,终端可向基站发送服务请求,基站将服务请求转发给UPF,然后UPF将服务请求转发给路由器,路由器若识别到服务请求报文的目的IP地址为本地服务器的IP地址,则将服务请求报文转发给本地的边缘云中的服务器,若识别到服务请求报文的目的IP地址不是本地服务器的IP地址,则根据路由表转发该服务请求报文。
结合上述系统架构,为了降低终端的访问时延,本申请实施例提供了一种报文转发方法,应用于路由器,该方法包括:
接收第一请求报文,第一请求报文的目的IP地址的主机地址段用于表示第一请求报文所请求服务的服务标识;
如果本地服务标识列表中存在与主机地址段相同的服务标识,则向本地服务器转发第一请求报文;其中,本地服务标识列表中包括本地服务器集群能够提供的服务的服务标识;
如果本地服务标识列表中不存在与主机地址段相同的服务标识,则基于第一请求报文的目的IP地址向其他路由器转发第一请求报文。
采用该方法,目的IP地址的主机地址段用于表示第一请求报文所请求的服务标识,当接收到第一请求报文后,如果本地服务列表中存在与上述主机地址段相同的服务标识,则说明本地服务器能够提供第一请求报文所请求的服务,进而向本地服务器转发第一请求报文。也就是说,无论第一请求报文的目的地址是否为本地服务器的IP地址,只要第一请求报文的目的地址的主机地址段属于本地服务列表,就可以由本地服务器处理第一请求报文,如此,就无需继续向其他的路由器转发该第一请求报文,可以提高第一请求报文被响应的速度,降低终端的访问时延。
以下结合附图对本申请实施例提供的报文转发方法进行详细介绍。
本申请实施例提供了一种报文转发方法,该方法应用于路由器,比如图1中连接于边缘云的路由器,如图3所示,该方法包括:
S301、接收第一请求报文,第一请求报文的目的IP地址的主机地址段用于表示请求报文所请求服务的服务标识。
其中,该第一请求报文可以为超文本传输协议(Hyper Text Transfer Protocol,HTTP)请求报文。
第一请求报文的目的IP地址为向终端提供服务的服务器的公网IP地址,目的IP地址包括网络地址段和主机地址段,其中网络地址段表示服务器的网络位置,主机地址段用于表示服务器的服务标识。本申请实施例中的服务器的公网IP地址的编码规则为“网络地址:服务标识”。作为示例,一个128bit的公网IP地址的前64bit可以为网络地址段,后64bit可以为主机地址段。
在本申请实施例中,对于不同服务器中的相同服务,所使用的服务标识相同,即一种服务具有一个唯一标识。
例如,如果在不同位置的服务器A、服务器B和服务器C可以提供相同的服务,则这三台服务器的IP地址包括的主机地址段相同,包括的网络地址段不同。
S302、如果本地服务标识列表中存在与主机地址段相同的服务标识,则向本地服务器转发第一请求报文。
其中,本地服务标识列表中包括本地服务器集群能够提供的服务的服务标识。例如,本地服务集群能够提供服务A、服务B、服务C,服务A、服务 B、服务C对应的服务标识分别为1100:0000:0000:0001、1100:0000:0000:0011、1100:0000:0000:0111,则本地服务标识列表中包括1100:0000:0000:0001、1100:0000:0000:0011、1100:0000:0000:0111。
可选地,本地服务标识列表中包括的服务标识可以为移动类服务的服务标识,移动类服务为移动性强的服务,比如车联网服务。
S303、如果本地服务标识列表中不存在与主机地址段相同的服务标识,则基于第一请求报文的目的IP地址向其他路由器转发第一请求报文。
如果本地服务标识列表中不存在与主机地址段相同的服务标识,说明本地服务器集群不能提供该服务标识所标识的服务,那么路由器可基于路由表向其他路由器转发第一请求报文。
路由表中包括多条转发表项,每条转发表项至少包括IP地址、出接口和下一跳,路由器可将第一请求报文的目的IP地址与路由表中的转发表项进行匹配,基于匹配到的转发表项包括的出接口和下一跳转发第一请求报文。
例如,若图1中的路由器1的本地服务标识列表中不存在与主机地址段相同的服务标识,则将第一请求报文的目的IP地址匹配路由表,若匹配到的下一跳为路由器2的IP地址,则路由器1向路由器2转发第一请求报文。
采用该方法,目的IP地址的主机地址段用于表示第一请求报文所请求的服务标识,当接收到第一请求报文后,如果本地服务标识列表中存在与上述主机地址段相同的服务标识,则说明本地服务器能够提供第一请求报文所请求的服务,进而向本地服务器转发第一请求报文。也就是说,无论第一请求报文的目的地址是否为本地服务器的IP地址,只要第一请求报文的目的地址的主机地址段属于本地服务标识列表,就可以由本地服务器处理第一请求报文,如此,就无需继续向其他的路由器转发该第一请求报文,可以提高第一请求报文被响应的速度,降低终端的访问时延。
在本申请的一个实施例中,上述S301、接收第一请求报文,具体包括以下两种实现方式。
方式一、接收客户端发送的第一请求报文。
路由器接收到的是终端发送的第一请求报文,即该路由器连接的边缘云为当前距离该终端最近的边缘云,路由器接收到第一请求报文后,可获取第 一请求报文的目的IP地址包括的主机地址段,如果本地服务标识列表中存在与该主机地址段相同的服务标识,则可由本地服务器处理第一请求报文。
其中,本地服务标识列表中存在与该主机地址段相同的服务标识存在两种情况。
第一种情况为:第一请求报文的目的IP地址与本地服务器的公网IP地址相同。
结合图1对第一种情况对应的场景进行说明,假设终端1在基站1的覆盖范围内访问URL1,终端通过查询DNS服务器,得到了URL1与IP地址1的对应关系,该IP地址1为边缘云1中的服务器1(图1中未示出)的公网IP地址。然后终端1发送第一请求报文,该第一请求报文的目的IP地址为服务器1的公网IP地址,然后路由器1可接收到该第一请求报文,并将该第一请求报文转发给服务器1。在这种场景下,第一请求报文的目的IP地址与本地服务器的公网IP地址相同。
第二种情况为:第一请求报文的目的IP地址与本地服务器的公网IP地址不同,具体的,上述目的IP地址的网络地址段与上述公网IP地址的网络地址段不同,上述目的IP地址的主机地址段与上述公网IP地址的主机地址段相同。
结合图1对第二种情况对应的场景进行说明,假设边缘云2中的服务器2(图1中未示出)能够提供与服务器1相同的服务,终端1从基站1的覆盖范围移动到基站2的覆盖范围,此时终端1中仍存储有URL1和IP地址1的对应关系。
所以终端1发送的第一请求报文的目的地址仍为IP地址1,因终端1在基站2的覆盖范围内,所以该第一请求报文会被发送到路由器2。路由器2接收到第一请求报文后,获取第一请求报文包括的IP地址1的主机地址段,并确定本地服务标识列表中包括与该主机地址段相同的服务标识,进而将该第一请求报文转发给服务器2,无需根据路由表向路由器1转发该第一请求报文。
这种场景下,服务器1与服务器2的公网IP地址包括的网络地址段不同,主机地址段相同。
例如,服务器1的公网IP地址为1:1:1:1:1:0:0:0,服务器2的公网IP地址为1:1:1:2:1:0:0:0。可见服务器1的公网IP地址的网络地址段1:1:1:1,与服 务器2的公网IP地址的网络地址段1:1:1:2不同,但服务器1和服务器2的公网IP的主机地址段相同,均为1:0:0:0。
虽然第一请求报文的目的IP地址为服务器1的公网IP地址,但是第一请求报文被就近转发至服务器2,减少了路由器2向路由器1转发第一请求报文,再由路由器1向服务器1转发第一报文造成的时延,可以使得第一请求报文更快被响应,可以降低终端1的访问时延。
方式二、接收路由器发送的第一请求报文。
即该第一请求报文是被其他路由器转发的,对于由其他路由器转发而来的第一请求报文,也可按照上述图3的流程处理。
在本申请实施例中,服务器的公网IP地址可以为IPv6地址,IPv6地址的网络地址资源充足,目前的IPv6地址的主机地址段长度为64bit,可以提供一个巨大的地址空间,利用该地址空间,可以为全网的各服务分配服务标识。
可选地,可以预先为移动类服务申请一段IPv6地址网段,将申请的IPv6地址网段作为移动类服务专用的主机地址网段,即该主机地址网段中的主机地址专门用作移动类服务的服务标识。
为移动类服务申请的IPv6地址网段可以为目前暂未被使用的网段,例如,该IPv6地址网段为1100:0000:0000:0000,当然也可以为其他未被使用的网段,本申请实施例对此不不做限定。
通过为移动类服务申请未被使用的IPv6地址网段作为移动类服务专用的主机地址网段,可以避免影响目前已应用的网段,进而避免与已有的IP地址产生冲突,其他主机地址网段可继续由其他服务应用使用,不受本申请实施例中的专用主机地址网段的影响。
相应地,本申请实施例中的本地服务标识列表中的服务标识属于预设主机地址网段,该预设主机网段为上述预先为移动类服务申请的IPv6地址网段,预设主机地址网段由移动类服务专用。
为了实现图1所示的方法流程,路由器需提前生成本地服务标识列表,在S301之前,如图4所示,该方法还包括以下步骤:
S401、从本地服务器集群的名字服务器获取本地服务器集群所能够提供的服务的URL和公网IP地址之间的对应关系。
其中,每个边缘云中还包括名字服务器(Name Server),名字服务器中存储有本地服务器集群所能提供的各服务的URL和IP地址之间的对应关系,路由器可以调用名字服务器的应用程序接口(Application Programming Interface,API),进而从名字服务器获取本地服务集群具有的服务的URL和公网IP地址之间的对应关系。
S402、从获取到对应关系包括的公网IP地址中,提取各公网IP地址的主机地址。
S403、将提取出的主机地址作为服务标识生成本地服务标识列表。
可以理解的是,本申请实施例中公网IP地址中的主机地址为服务标识,所以提取出的主机地址即为本地服务器集群所能提供服务的服务标识。
采用该方法,公网IP地址包括的主机地址为服务标识,路由器可从本地服务器集群的名字服务器中获取本地服务器集群的URL和公网IP地址的对应关系,从获取到的对应关系包括的公网IP地址中,可以提取出本地服务器所能提供的所有服务的服务标识,进而生成服务标识列表,后续可以基于该服务标识列表就近为终端提供服务,降低终端的访问时延。
在本公开另一实施例中,在图4所示的实施例的基础上,本申请实施例还可以实时更新本地服务标识列表,如图5所示,该方法包括:
S501、实时从本地服务器集群的名字服务器获取本地服务器集群所能够提供的服务的URL和公网IP地址之间的对应关系。
其中,本地服务器集群所能提供的服务可能发生变化,相应地URL和IP地址之间的对应关系也会发生变化,路由器可以实时获取最新的本地服务器集群所能提供的服务的URL和公网IP地址之间的对应关系。
S502、从获取到的对应关系包括的公网IP地址中,提取各公网IP地址的主机地址。
S503、基于提取的各公网IP地址的主机地址更新本地服务标识列表。
如果提取的主机地址中,包括本地服务列表中不存在的主机地址,则将该主机地址加入本地服务标识列表,如果本地服务列表中存在除此次提取的主机地址之外的主机地址,则将该主机地址从本地服务列表中删除。
采用该方法,可以实时从名字服务器获取本地服务器集群所能够提供的 服务的URL和公网IP地址之间的对应关系,并从获取到的对应关系的公网IP地址中提取主机地址,基于提取的主机地址对本地服务标识列表进行更新,如此,路由器可以及时获取最新的对应关系,可以使得本地服务标识列表中的服务标识与当前本地服务器集群所能提供的服务保持一致,提高路由器基于本地服务标识列表转发报文的准确性。
在一种可能的实施方式中,路由器也可以周期性地从名字服务器获取本地服务器集群所能提供的服务的URL和公网IP地址之间的对应关系,并从中提取各公网IP地址的主机地址,再基于提取各公网IP地址的主机地址更新本地服务标识列表。在本地服务集群所能提供的服务变化频率较低的情况下,采用该方式可以降低路由器的处理开销,且可以使得本地服务标识列表中的服务标识与当前本地服务器集群所能提供的服务保持一致,提高路由器基于本地服务标识列表转发报文的准确性。
在本申请另一实施例中,上述S302、如果本地服务标识列表中存在与主机地址段相同的服务标识,则向本地服务器转发所述第一请求报文,具体可以实现为:
如果本地服务标识列表中存在与主机地址段相同的服务标识,则将第一请求报文的目的IP地址转换为负载均衡设备的IP地址,得到第二请求报文,通过负载均衡设备向本地服务器发送第二请求报文。
其中,路由器可将第二请求报文发送给负载均衡设备,以使得负载均衡设备基于负载均衡策略将第二请求报文的目的IP地址转换为本地服务器的IP地址,然后转发给本地服务器。
其中,负载均衡策略可基于实际情况设置,可采用相关技术中的负载均衡策略,本申请实施例对此不作限制。
负载均衡设备可基于负载均衡策略确定用于处理第二请求报文的本地服务器,进而将第二请求报文的目的IP地址转换为该本地服务器的私网IP地址。
本地服务器在处理接收到的第二请求报文后,可生成针对该第二请求报文的响应报文,本地服务器可通过路由器将该响应报文转发给终端。
需要说明的是,本申请实施例中的本地服务器为终端提供的是短连接的、无状态的服务。例如,信息查询服务、数据计算服务等。
终端发送的第一请求报文被不同的服务器处理会得到相同的响应内容。
采用该方法,路由器接收到第一请求报文后,不是直接通过路由表转发,而是先判断本地服务器是否可以处理该第一请求报文,若可以,则由本地服务器处理该第一请求报文,无需转发至第一请求报文的目的IP地址对应的服务器,可以降低访问时延。
对应于上述方法实施例,本申请实施例还提供一种报文转发装置,该装置应用于路由器,如图6所示,该装置包括:
接收模块601,用于接收第一请求报文,所述第一请求报文的目的IP地址的主机地址段用于表示所述第一请求报文所请求服务的服务标识;
第一转发模块602,用于如果本地服务标识列表中存在与所述主机地址段相同的服务标识,则向本地服务器转发所述第一请求报文;其中,所述本地服务标识列表中包括本地服务器集群能够提供的服务的服务标识;
第二转发模块603,用于如果本地服务标识列表中不存在与所述主机地址段相同的服务标识,则基于所述第一请求报文的目的IP地址向其他路由器转发所述第一请求报文。
在本申请另一实施例中,该装置还包括:
获取模块,用于从本地服务器的名字服务器获取本地服务器集群所能够提供的服务的URL和公网IP地址之间的对应关系;
提取模块,用于从获取到对应关系包括的公网IP地址中,提取各公网IP地址的主机地址;
生成模块,用于将提取出的主机地址作为服务标识生成所述本地服务标识列表。
在本申请另一实施例中,第一转发模块602,具体用于:
如果本地服务标识列表中存在与所述主机地址段相同的服务标识,则将所述第一请求报文的目的IP地址转换为负载均衡设备的IP地址,得到第二请求报文,通过所述负载均衡设备向本地服务器发送所述第二请求报文。
在本申请另一实施例中,本地服务标识列表中包括的服务标识属于预设主机地址网段,所述预设主机地址网段为预先为移动类服务申请的IPv6地址 网段,预设主机地址网段由移动类服务专用。
在本申请另一实施例中,接收模块601,具体用于:
接收终端发送的第一请求报文;或者,
接收路由器转发的第一请求报文。
本申请实施例还提供了一种电子设备,该电子设备可以为路由器,如图7所示,包括处理器701、通信接口702、存储器703和通信总线704,其中,处理器701,通信接口702,存储器703通过通信总线704完成相互间的通信,
存储器703,用于存放计算机程序;
处理器701,用于执行存储器703上所存放的程序时,实现上述方法实施例中的方法步骤。
上述电子设备提到的通信总线可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
通信接口用于上述电子设备与其他设备之间的通信。
存储器可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。
上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。
在本申请提供的又一实施例中,还提供了一种计算机可读存储介质,该计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述任一报文转发方法的步骤。
在本申请提供的又一实施例中,还提供了一种包含指令的计算机程序产 品,当其在计算机上运行时,使得计算机执行上述实施例中任一报文转发方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明保护的范围之内。

Claims (12)

  1. 一种报文转发方法,其特征在于,所述方法应用于路由器,所述方法包括:
    接收第一请求报文,所述第一请求报文的目的IP地址的主机地址段用于表示所述第一请求报文所请求服务的服务标识;
    如果本地服务标识列表中存在与所述主机地址段相同的服务标识,则向本地服务器转发所述第一请求报文;其中,所述本地服务标识列表中包括本地服务器集群能够提供的服务的服务标识;
    如果本地服务标识列表中不存在与所述主机地址段相同的服务标识,则基于所述第一请求报文的目的IP地址向其他路由器转发所述第一请求报文。
  2. 根据权利要求1所述的方法,其特征在于,在所述接收第一请求报文之前,所述方法还包括:
    从本地服务器集群的名字服务器获取本地服务器集群所能够提供的服务的统一资源定位符URL和公网IP地址之间的对应关系;
    从获取到对应关系包括的公网IP地址中,提取各公网IP地址的主机地址;
    将提取出的主机地址作为服务标识生成所述本地服务标识列表。
  3. 根据权利要求1或2所述的方法,其特征在于,所述如果本地服务标识列表中存在与所述主机地址段相同的服务标识,则向本地服务器转发所述第一请求报文,包括:
    如果本地服务标识列表中存在与所述主机地址段相同的服务标识,则将所述第一请求报文的目的IP地址转换为负载均衡设备的IP地址,得到第二请求报文,通过所述负载均衡设备向本地服务器发送所述第二请求报文。
  4. 根据权利要求1所述的方法,其特征在于,所述本地服务标识列表中包括的服务标识属于预设主机地址网段,所述预设主机地址网段为预先为移动类服务申请的IPv6地址网段,所述预设主机地址网段由所述移动类服务专用。
  5. 根据权利要求1所述的方法,其特征在于,所述接收第一请求报文,包括:
    接收终端发送的第一请求报文;或者,
    接收路由器转发的第一请求报文。
  6. 一种报文转发装置,其特征在于,所述装置应用于路由器,所述装置包括:
    接收模块,用于接收第一请求报文,所述第一请求报文的目的IP地址的主机地址段用于表示所述第一请求报文所请求服务的服务标识;
    第一转发模块,用于如果本地服务标识列表中存在与所述主机地址段相同的服务标识,则向本地服务器转发所述第一请求报文;其中,所述本地服务标识列表中包括本地服务器集群能够提供的服务的服务标识;
    第二转发模块,用于如果本地服务标识列表中不存在与所述主机地址段相同的服务标识,则基于所述第一请求报文的目的IP地址向其他路由器转发所述第一请求报文。
  7. 根据权利要求6所述的装置,其特征在于,所述装置还包括:
    获取模块,用于从本地服务器集群的名字服务器获取本地服务器集群所能够提供的服务的URL和公网IP地址之间的对应关系;
    提取模块,用于从获取到对应关系包括的公网IP地址中,提取各公网IP地址的主机地址;
    生成模块,用于将提取出的主机地址作为服务标识生成所述本地服务标识列表。
  8. 根据权利要求6或7所述的装置,其特征在于,所述第一转发模块,具体用于:
    如果本地服务标识列表中存在与所述主机地址段相同的服务标识,则将所述第一请求报文的目的IP地址转换为负载均衡设备的IP地址,得到第二请求报文,通过所述负载均衡设备向本地服务器发送所述第二请求报文。
  9. 根据权利要求6所述的装置,其特征在于,所述本地服务标识列表中包括的服务标识属于预设主机地址网段,所述预设主机地址网段为预先为移动类服务申请的IPv6地址网段,所述预设主机地址网段由所述移动类服务专用。
  10. 根据权利要求6所述的装置,其特征在于,所述接收模块,具体用于:
    接收终端发送的第一请求报文;或者,
    接收路由器转发的第一请求报文。
  11. 一种电子设备,其特征在于,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;
    存储器,用于存放计算机程序;
    处理器,用于执行存储器上所存放的程序时,实现权利要求1-5任一所述的方法步骤。
  12. 一种机器可读存储介质,其特征在于,存储有机器可执行指令,在被处理器调用和执行时,所述机器可执行指令促使所述处理器:实现权利要求1-5任一所述的方法步骤。
PCT/CN2021/143521 2021-12-31 2021-12-31 一种报文转发方法、装置、电子设备及介质 WO2023123308A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2021/143521 WO2023123308A1 (zh) 2021-12-31 2021-12-31 一种报文转发方法、装置、电子设备及介质
CN202180004368.3A CN116686273A (zh) 2021-12-31 2021-12-31 一种报文转发方法、装置、电子设备及介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/143521 WO2023123308A1 (zh) 2021-12-31 2021-12-31 一种报文转发方法、装置、电子设备及介质

Publications (1)

Publication Number Publication Date
WO2023123308A1 true WO2023123308A1 (zh) 2023-07-06

Family

ID=86997154

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/143521 WO2023123308A1 (zh) 2021-12-31 2021-12-31 一种报文转发方法、装置、电子设备及介质

Country Status (2)

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

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010166421A (ja) * 2009-01-16 2010-07-29 Nec Corp ネットワークシステム、ネットワーク端末のアドレス選択方法、ネットワーク端末のアドレス選択装置
CN105812261A (zh) * 2016-03-07 2016-07-27 北京交通大学 信息中心网络中的报文转发方法和系统
CN107277882A (zh) * 2016-04-07 2017-10-20 中国移动通信有限公司研究院 一种数据路由方法、装置和基站
CN112398801A (zh) * 2019-08-19 2021-02-23 华为技术有限公司 数据处理方法及设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010166421A (ja) * 2009-01-16 2010-07-29 Nec Corp ネットワークシステム、ネットワーク端末のアドレス選択方法、ネットワーク端末のアドレス選択装置
CN105812261A (zh) * 2016-03-07 2016-07-27 北京交通大学 信息中心网络中的报文转发方法和系统
CN107277882A (zh) * 2016-04-07 2017-10-20 中国移动通信有限公司研究院 一种数据路由方法、装置和基站
CN112398801A (zh) * 2019-08-19 2021-02-23 华为技术有限公司 数据处理方法及设备

Also Published As

Publication number Publication date
CN116686273A (zh) 2023-09-01

Similar Documents

Publication Publication Date Title
EP3726791B1 (en) Network-function monitoring and control
EP3993347A1 (en) Method and device for application migration
US10454879B2 (en) Methods and systems for processing a DNS request
EP4167625A1 (en) Communication method and apparatus
KR102217145B1 (ko) 네트워크 기능을 위한 방법 및 장치
EP3429260B1 (en) Data transmission method and system
EP2873218B1 (en) Application service platform with access to context data of remote access node
US10904950B2 (en) Proxy based network access
US11729137B2 (en) Method and device for edge application server discovery
WO2021042398A1 (zh) 一种通信方法及装置、网络设备、终端设备
EP3668058B1 (en) Content distribution method and system
US20180287940A1 (en) Data universal forwarding plane for information exchange
CN104468866A (zh) 一种无线局域网中多网关终端快速漫游方法
US11902890B2 (en) Application based routing of data packets in multi-access communication networks
EP3754949B1 (en) Method for acquiring and providing service, and user equipment and management server
Pirmagomedov et al. Augmented computing at the edge using named data networking
US20190312787A1 (en) Mapping between wireless links and virtual local area networks
WO2021197155A1 (zh) 一种通信方法及装置
US20230164111A1 (en) Method and apparatus for sending domain name system request
WO2023123308A1 (zh) 一种报文转发方法、装置、电子设备及介质
CN109076381B (zh) 业务数据流发送方法及装置
CN113169936B (zh) 用于数据流处理的服务链机制
US20230025344A1 (en) Application Discovery Method, Apparatus, and System, and Computer Storage Medium
WO2023056954A1 (zh) 域名系统dns查询方法、装置及网络侧设备
WO2015028057A1 (en) Packet processing in communications

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21969665

Country of ref document: EP

Kind code of ref document: A1