[go: up one dir, main page]

CN112929440A - Method for keeping double stack connection by cookie - Google Patents

Method for keeping double stack connection by cookie Download PDF

Info

Publication number
CN112929440A
CN112929440A CN202110174980.7A CN202110174980A CN112929440A CN 112929440 A CN112929440 A CN 112929440A CN 202110174980 A CN202110174980 A CN 202110174980A CN 112929440 A CN112929440 A CN 112929440A
Authority
CN
China
Prior art keywords
server
cookie
load balancer
response
cookie field
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
CN202110174980.7A
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.)
Shanghai Hongji Information Technology Co Ltd
Original Assignee
Shanghai Hongji Information Technology 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 Shanghai Hongji Information Technology Co Ltd filed Critical Shanghai Hongji Information Technology Co Ltd
Priority to CN202110174980.7A priority Critical patent/CN112929440A/en
Publication of CN112929440A publication Critical patent/CN112929440A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/142Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/686Types of network addresses using dual-stack hosts, e.g. in Internet protocol version 4 [IPv4]/Internet protocol version 6 [IPv6] networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method for maintaining double stack connection by using cookie, which respectively configures different cookie values for each server; the user browser accesses the domain name and reaches a load balancer, and the load balancer is distributed to the server 1 according to a default algorithm; the server 1 responds, the load balancer adds a Set-Cookie field in the response head according to the selected server, and the content of the Set-Cookie field is expressed as the server 1; the user browser receives the response and analyzes the response to the Set-Cookie field; subsequent browser requests carry Cookie fields and reach a load balancer; the load balancer analyzes the contents of the Cookie field and forwards the request to the server 1; the dual stack connection remains complete; the invention can meet the service requirement of the dual-stack service to the same server when the website service uses the load balancer; the implementation is simple, the website is not required to be changed, and the maintenance cost is reduced.

Description

Method for keeping double stack connection by cookie
Technical Field
The invention relates to the technical field of communication, in particular to a method for maintaining double-stack connection by using cookies.
Background
Load balancing is a key component of the highly available network infrastructure, and is typically used to distribute workload across multiple servers to improve the performance and reliability of a website, application, database, or other service.
In a web architecture without load balancing, users are directly connected to a web server, and if the server is down, the users naturally have no way to access the web server. In addition, if many users attempt to access the server at the same time, beyond the limit they can handle, slow loading or no connection at all may occur.
And this failure can be mitigated by introducing a load balancer and additional web servers. Typically, all backend servers will guarantee the same content to be provided so that the user receives consistent content regardless of which server responds. The additional multiple web servers also share the load, relieving the pressure of a single web server and thereby processing more user requests.
Cookie is a small piece of data stored locally by a user browser, and is carried and sent to a server when the browser sends a request to the same server next time. Today, any browser is supported, and almost any page can be browsed.
With the development of emerging technical fields such as 5G, the Internet of things and the like, the IP space requirement is huge, and the IPv6 becomes the basis of interconnection of everything and is imperative. However, IPv6 can not be put into place in one step instead of IPv4, so many transition technologies from IPv4 to IPv6 appear, and IPv4/IPv6 dual stack (hereinafter referred to as dual stack) is one of them.
The dual stack technology is to enable the IPv4 protocol stack and the IPv6 protocol stack to provide services to the outside on one device. In this way, the device can communicate with both the IPv4 network and the IPv6 network.
The DNS (Domain Name System) is very simple in function, and finds out an IP address according to a Domain Name. A domain name can be resolved into both IPv4 and IPv6 addresses.
Existing servers all provide dual stack services. For example: the server 1 configures an IPv4 address (IPv4-1) and an IPv6 address (IPv6-1) at the same time, provides services to the outside, and the server 2 and the like are analogized once.
The load balancer also provides dual stack services, virtual address IPv4 and virtual address IPv6, respectively.
The load balancer configures the service pool IPv4, which contains IPv4 addresses (IPv4-1, IPv 4-2.) on all servers
The load balancer configures the service pool IPv6, which contains IPv6 addresses (IPv6-1, IPv 6-2.) on all servers
When a user browser uses a domain name for access, the domain name may be resolved to an IPv4 address or an IPv6 address.
When the user browser accesses the virtual IPv4, the load balancer selects an IPv4 address from the service pool IPv4 according to a certain algorithm (such as polling) to provide actual service.
When the user browser accesses the virtual IPv6, the load balancer selects an IPv6 address from the service pool IPv6 according to a certain algorithm (such as polling) to provide actual service.
In many cases, when a user browser is required to access a domain name of a local website due to business needs of a website operator, after passing through a load balancer, an IPv4 address and an IPv6 address are located on the same server:
and (4) correct scene:
for the first time: client A browser accesses domain name www.abc.com- > virtual IPv4- > IPv4-1 (Server 1)
And (3) for the second time: client A browser accesses domain name www.abc.com- > virtual IPv6- > IPv6-1 (Server 1) twice to access the Server
Error scenario:
for the first time: client A browser accesses domain name www.abc.com- > virtual IPv4- > IPv4-1 (Server 1)
And (3) for the second time: client A browser access domain name www.abc.com- > virtual IPv6- > IPv6-2 (server 2) two times access server inconsistency
The reason for this problem is that when the client browser accesses the domain name, the virtual IP may be resolved into IPv4 or IPv6 and then allocated to the service pool IPv4 or IPv6, and the two service pools respectively select a server therein to provide service, possibly selecting different servers, thereby causing service failure.
Therefore, a method for dual stack connection maintenance using cookies becomes an urgent problem to be solved.
Disclosure of Invention
The invention aims to balance the load of the same client to the request of the same domain name, no matter IPv4 or IPv6, to the same server.
In order to achieve the purpose, the technical scheme provided by the invention is as follows: a method for dual stack connection maintenance using cookies, comprising the steps of:
step 1: configuring different cookie values for each server respectively;
step 2: the user browser accesses the domain name, is resolved into an IPv4 or IPv6 address, and reaches a load balancer, and the request does not contain a Cookie field due to the first access;
and step 3: the load balancer is distributed to the server 1 according to a default algorithm;
and 4, step 4: the server 1 responds, and the response reaches the load balancer;
and 5: the load balancer adds a Set-Cookie field in the response head according to the selected server, and the content of the Set-Cookie field is expressed as a server 1;
step 6: the user browser receives the response and analyzes the response to the Set-Cookie field;
and 7: according to the standard, all subsequent requests of the browser to the domain name carry the Cookie field, and the subsequent requests of the browser carry the Cookie field and reach a load balancer;
and 8: the load balancer analyzes the contents of the Cookie fields, a server is not distributed by using a default algorithm any more, and the request is forwarded to the server 1 according to the instruction of the Cookie contents; the dual stack connection remains complete.
As an improvement, all requests in said step 7 include DNS resolution as IPv4, DNS resolution as IPv4IPv 6.
Compared with the prior art, the invention has the advantages that: the invention can meet the service requirement of the dual-stack service to the same server when the website service uses the load balancer; the implementation is simple, the website is not required to be changed, and the maintenance cost is reduced.
Drawings
Fig. 1 is a diagram illustrating a method for dual stack connection maintenance using cookies according to the present invention, in which different cookie values are respectively configured for respective servers.
FIG. 2 is a flowchart of the operation of a method for dual stack connection maintenance using cookies in accordance with the present invention.
Detailed Description
The method for dual stack connection maintenance using cookies according to the present invention will be described in further detail with reference to the accompanying drawings.
With reference to fig. 1-2, the method for maintaining dual stack connection by using cookie according to the present invention is implemented as follows:
configuring different cookie values for each server respectively; the user browser accesses the domain name, is resolved into an IPv4 or IPv6 address, and reaches a load balancer, and the request does not contain a Cookie field due to the first access; the load balancer is distributed to the server 1 according to a default algorithm; the server 1 responds, and the response reaches the load balancer; the load balancer adds a Set-Cookie field in the response head according to the selected server, and the content of the Set-Cookie field is expressed as a server 1; the user browser receives the response and analyzes the response to the Set-Cookie field; according to the standard, all subsequent requests of the browser to the domain name carry the Cookie field, and the subsequent requests of the browser carry the Cookie field and reach a load balancer; the load balancer analyzes the contents of the Cookie fields, a server is not distributed by using a default algorithm any more, and the request is forwarded to the server 1 according to the instruction of the Cookie contents; the dual stack connection remains complete and the dual stack connections of the other servers remain the same as the method of operation of server 1.
The present invention and its embodiments have been described above, and the description is not intended to be limiting, and the drawings are only one embodiment of the present invention, and the actual structure is not limited thereto. In summary, those skilled in the art should appreciate that they can readily use the disclosed conception and specific embodiments as a basis for designing or modifying other structures for carrying out the same purposes of the present invention without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (2)

1. A method for dual stack connection maintenance using cookies, comprising the steps of:
step 1: configuring different cookie values for each server respectively;
step 2: the user browser accesses the domain name, is resolved into an IPv4 or IPv6 address, and reaches a load balancer, and the request does not contain a Cookie field due to the first access;
and step 3: the load balancer is distributed to the server 1 according to a default algorithm;
and 4, step 4: the server 1 responds, and the response reaches the load balancer;
and 5: the load balancer adds a Set-Cookie field in the response head according to the selected server, and the content of the Set-Cookie field is expressed as a server 1;
step 6: the user browser receives the response and analyzes the response to the Set-Cookie field;
and 7: according to the standard, all subsequent requests of the browser to the domain name carry the Cookie field, and the subsequent requests of the browser carry the Cookie field and reach a load balancer;
and 8: the load balancer analyzes the contents of the Cookie fields, a server is not distributed by using a default algorithm any more, and the request is forwarded to the server 1 according to the instruction of the Cookie contents; the dual stack connection remains complete.
2. The method of claim 1, wherein the dual stack connection maintenance using cookies: all requests in the step 7 include DNS resolution as IPv4 and DNS resolution as IPv4IPv 6.
CN202110174980.7A 2021-02-09 2021-02-09 Method for keeping double stack connection by cookie Pending CN112929440A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110174980.7A CN112929440A (en) 2021-02-09 2021-02-09 Method for keeping double stack connection by cookie

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110174980.7A CN112929440A (en) 2021-02-09 2021-02-09 Method for keeping double stack connection by cookie

Publications (1)

Publication Number Publication Date
CN112929440A true CN112929440A (en) 2021-06-08

Family

ID=76171309

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110174980.7A Pending CN112929440A (en) 2021-02-09 2021-02-09 Method for keeping double stack connection by cookie

Country Status (1)

Country Link
CN (1) CN112929440A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101304436A (en) * 2008-07-07 2008-11-12 杭州华三通信技术有限公司 Load balancing method, system and equipment for implementing application layer conversation persistency
CN101534321A (en) * 2009-03-09 2009-09-16 浪潮电子信息产业股份有限公司 Load-balancing session-keeping algorithm based on cookie
CN101605092A (en) * 2009-07-10 2009-12-16 浪潮电子信息产业股份有限公司 A Content-Based Load Balancing System
CN102075445A (en) * 2011-02-28 2011-05-25 杭州华三通信技术有限公司 Load balancing method and device
US20110185065A1 (en) * 2010-01-28 2011-07-28 Vladica Stanisic Stateless forwarding of load balanced packets
US20120117267A1 (en) * 2010-04-01 2012-05-10 Lee Hahn Holloway Internet-based proxy service to limit internet visitor connection speed
CN102771083A (en) * 2009-12-23 2012-11-07 思杰系统有限公司 Systems and methods for mixed mode of IPv6 and IPv4 DNS of global server load balancing
CN209805866U (en) * 2019-06-05 2019-12-17 中星科源(北京)信息技术有限公司 Conversation maintaining system
CN111953700A (en) * 2020-08-18 2020-11-17 中国工商银行股份有限公司 Session keeping method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101304436A (en) * 2008-07-07 2008-11-12 杭州华三通信技术有限公司 Load balancing method, system and equipment for implementing application layer conversation persistency
CN101534321A (en) * 2009-03-09 2009-09-16 浪潮电子信息产业股份有限公司 Load-balancing session-keeping algorithm based on cookie
CN101605092A (en) * 2009-07-10 2009-12-16 浪潮电子信息产业股份有限公司 A Content-Based Load Balancing System
CN102771083A (en) * 2009-12-23 2012-11-07 思杰系统有限公司 Systems and methods for mixed mode of IPv6 and IPv4 DNS of global server load balancing
US20110185065A1 (en) * 2010-01-28 2011-07-28 Vladica Stanisic Stateless forwarding of load balanced packets
US20120117267A1 (en) * 2010-04-01 2012-05-10 Lee Hahn Holloway Internet-based proxy service to limit internet visitor connection speed
CN102075445A (en) * 2011-02-28 2011-05-25 杭州华三通信技术有限公司 Load balancing method and device
CN209805866U (en) * 2019-06-05 2019-12-17 中星科源(北京)信息技术有限公司 Conversation maintaining system
CN111953700A (en) * 2020-08-18 2020-11-17 中国工商银行股份有限公司 Session keeping method and device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
张杰;甘勇;张勇;李海燕;: "一种Web服务中IPv4/IPv6兼容的实现方案", 微计算机信息, no. 30 *
李文正,郭巧,王利,郭为民: "Internet服务器负载均衡的研究与实现", 计算机工程, no. 06 *
许洪超;轩亚光;张玲;张志立;: "IPv4/IPv6双协议栈下服务器过渡方案的设计与实现", 许昌学院学报, no. 02 *

Similar Documents

Publication Publication Date Title
US7680954B2 (en) Proxy DNS for web browser request redirection in public hotspot accesses
US10516611B2 (en) Preferential selection of IP protocol version with domain name matching on proxy servers
CN111314499B (en) Domain name proxy method, device, equipment and readable storage medium
EP2745474B1 (en) Virtualization gateway between virtualized and non-virtualized networks
US8706906B2 (en) Multipath routing process
US8583810B2 (en) Session affinity cache and manager
EP2769307B1 (en) Answer augmentation system for authoritative dns servers
CN112565484B (en) Method, system and storage medium for accessing local area network equipment by domain name seamless roaming
CN109729187B (en) Proxy communication method, system, device and storage medium
US9697173B2 (en) DNS proxy service for multi-core platforms
US20220303278A1 (en) Captive portal for tiered access using conditional dns forwarding
US11768890B2 (en) Method and server apparatus for dynamically identifying pop-out links in networked applications via lookup
US20200112510A1 (en) Redirecting data packets between overlay network and underlay network
US7788407B1 (en) Apparatus and methods for providing an application level gateway for use in networks
US8447839B2 (en) Three-layer web management protocol device emulation
CN114285821B (en) Domain name resolution method, device, electronic device, storage medium and product
US10904328B2 (en) System, method, and apparatus for providing and utilizing a link metadata system for the internet
CN112929440A (en) Method for keeping double stack connection by cookie
CN115801727B (en) Domain name resolution method, device, electronic device and storage medium
US20200127923A1 (en) System and method of performing load balancing over an overlay network
CN118611933B (en) Access method, configuration method and device of NAS server and electronic equipment
Vasiliadis et al. A trusted network model using the lightweight directory access protocol
US20070055761A1 (en) Method and system for redirecting a request in an IP environment
US10630640B1 (en) Variable length field fibre channel address system
CN113886064A (en) Method for selecting service pool members in load balancing system

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210608

RJ01 Rejection of invention patent application after publication