Movatterモバイル変換


[0]ホーム

URL:


CN104735023A - High-performance SSL agency device and method - Google Patents

High-performance SSL agency device and method
Download PDF

Info

Publication number
CN104735023A
CN104735023ACN201310700265.8ACN201310700265ACN104735023ACN 104735023 ACN104735023 ACN 104735023ACN 201310700265 ACN201310700265 ACN 201310700265ACN 104735023 ACN104735023 ACN 104735023A
Authority
CN
China
Prior art keywords
ssl
user
epoll
resource server
thread
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
CN201310700265.8A
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.)
Hangzhou DPTech Technologies Co Ltd
National Computer Network and Information Security Management Center
Original Assignee
Hangzhou DPTech Technologies Co Ltd
National Computer Network and Information Security Management Center
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou DPTech Technologies Co Ltd, National Computer Network and Information Security Management CenterfiledCriticalHangzhou DPTech Technologies Co Ltd
Priority to CN201310700265.8ApriorityCriticalpatent/CN104735023A/en
Publication of CN104735023ApublicationCriticalpatent/CN104735023A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

The invention provides a high-performance SSL agency device which serves as WEB service software to be applied to a server. A user-side connecting module is used for receiving user accessing and negotiating with a user side to build user-side SSL connection. A background processing module is used for receiving a resource operation request of a user, negotiating with a background resource server to build connection with the background resource server and carrying out data reading-writing operation on the user side and the background resource server according to the resource operation request of the user. The user-side connecting module and the background processing module are located in two threads of one process respectively. By means of the high-performance SSL agency device, the characteristics of an SSL encryption card processing chip can be sufficiently used for improving the data processing performance, and therefore the high-performance SSL agency device can be more stable during working under the high pressure.

Description

A kind of high performance ssl proxy devices and methods therefor
Technical field
The present invention relates to network safety filed, particularly relate to a kind of high performance ssl proxy devices and methods therefor.
Background technology
Along with the development of network technology, the life of people is increasing and network is closely bound up, such as, amuse and divert oneself, inspection information, shopping payment, Online Payment, see a doctor and register etc.The network user of explosive growth, the personal information of magnanimity is present in network.For personal information, everyone is responsive, and last year, domestic several large website exposed user profile leakage in succession, touched the nerve of user especially.In order to increase fail safe, increasing website increases the application of Hyper text transfer security protocol (HTTPS).HTTPS agreement is used in network communication very early, because the secure tunnel foundation of HTTPS very can consume cpu resource, is only widely used in now the communication of security sensitive on network, such as payment aspect.Because network security problem exposes again and again, also allow user more and more be concerned about, increasing website is registered in the reciprocal process of login user and is used HTTPS agreement.But due to the consideration of server performance and Consumer's Experience, HTTPS accesses seldom to have network company all to support.When performance bottleneck is just present in user and server interaction, WEB service software is the cpu resource that seriously consumes server setting up ssl tunneling, for the customer volume that present website is huge, server will process huge user's access, handling property is had too many difficulties to cope with, and increases so the application of SSL encrypted card is begun to demand.
Because SSL encrypted card has independent SSL process chip, the resource can liberating server CPU, for the treatment of other affairs, can significantly improve the handling property of HTTPS.SSL encrypted card is generally arranged on mainboard PCI slot as display card.If but want the performance giving full play to SSL encrypted card, fully to understand the characteristic of SSL encrypted card process chip and driving, and optimize the process structure of application layer software for its characteristics design.
Currently available technology adopts WEB service software to coordinate SSL encrypted card to complete the encryption and decryption of SSL and to carry out the read-write of data.Referring to Fig. 1, what existing WEB service software adopted is the mode of multi-process in conjunction with epoll Non-Blocking I/O network model, and the role of a ssl proxy played the part of by this type of WEB service software between user side and Resource Server, and the step of its main processes is as follows:
Step one, initialization SSL environment configurations and socket also set a property, and open and monitor;
Step 2, establishment subprocess, initialization epoll structure, adds pending event, and waiting event triggers;
When step 3, user access, trigger epoll event, return the socket of user, the SSL negotiation of process and user and backstage Resource Server also to be set up and the SSL of user is connected and connects with the SSL of backstage Resource Server respectively, then user's socket is added the queue of epoll action listener, the request of process subsequent user;
Step 4, receive user resource operation request and carry out the operation that reads and writes data of user side and backstage Resource Server;
Step 5, user complete access, and ssl proxy stop connects, Resource recovery.
Wherein the detailed process of step 3 is as follows:
Step 3 .1, ssl proxy process receive user's request;
The socket of step 3 .2, acquisition user;
Step 3 .3, set up SSL with user side and be connected; setting up SSL again with backstage Resource Server is connected (in this application scenario; being connected with backstage Resource Server also needs SSL to protect), now ssl proxy process establishes two-way ssl tunneling between user and backstage resource.
Wherein the detailed process of step 3 is as follows:
Etc. pending user's request resource, read and write data at user side and background server end by SSL_read () and SSL_write ().
The SSL service software of described prior art adopts the epoll models coupling multi-process pattern of unblock.But the SSL service software of prior art, because process be connected with the SSL of user side and background server, user and background server reading and writing data be in same epoll circulates, interacting, it is efficient not that program is performed, so there is the space much can optimized.
In high load capacity situation, because process should process the negotiation of two-way SSL connection, also to process the read-write of bi-directional data, SSL negotiations process is again process very consuming time, can affect the speed read and write data, if the amount of reading and writing data is very large, again newly-built connection speed is had an impact, not efficiently.
In addition, referring to Fig. 2, current existing SSL encrypted card process chip has following characteristic: SSL encrypted card has N number of encryption and decryption process core, and N is generally 64.SSL encrypted card is provided with data handling queues, and processing queue buffer is 2048, and the process flow steps of SSL encrypted card is as follows:
Step one, obtain the data treating encryption and decryption being sent to kernel from user side;
Step 2, by pending data starting and ending address, processing command, process deposit data address, state flag bit is filled in processing queue buffer;
Data processing function in step 3, execution driver, imports into the parameter of buffer as function;
Step 4, function process complete and return, the data that user side goes reading process complete according to system mode.
Through the data of our actual measurement, inside queue, have the situation of 1 pending data, the processing time is 20us; When queue has 2000 pending data, after performing data processing function, buffer can be divided equally 64 process cores and process simultaneously by function, and the processing time is approximately 625us.In other words when processing 2000 data, each process one, needs 20*2000us; 2000 data put into buffer process simultaneously only needs 625us.
It can thus be appreciated that when existing SSL encrypted card performs data processing function, have 2000 data to process inside queue and only have data to process separately, the efficiency of process has very large lifting at every turn simultaneously.
Therefore, there is the two-way SSL of establishment and connect the at substantial time and affect read-write data speed in the SSL service software of prior art, and also connects to the new SSL of establishment the problem impacted time reading and writing data amount is large.And the SSL service software of prior art does not consider the characteristic of SSL encrypted card process chip still to there is very large room for improvement.
Summary of the invention
In view of this, the object of this invention is to provide a kind of high performance ssl proxy devices and methods therefor, to make full use of the characteristic of SSL encrypted card process chip to improve the performance of data processing, can be more stable when high pressure works.
For achieving the above object, the invention provides technical scheme as follows: a kind of high performance ssl proxy device, its as WEB service software application in server.Comprise:
User side link block, for receiving user's access and holding consultation with user side, sets up user side SSL and connects.
Background processing module, for receiving the resource operation request of user and holding consultation with backstage Resource Server, sets up backstage Resource Server and connects, and according to the resource operation request of user, carries out the operation that reads and writes data of user side and backstage Resource Server.
Described user side link block and described background processing module lay respectively in two threads of same process.
Described background processing module is set up and is connected for foundation is connected with backstage Resource Server SSL with backstage Resource Server.
Described user side link block and described background processing module adopt respective epoll model respectively.
Described epoll model can be the epoll structure of epoll structure or the unblock of blocking.
Described user side link block comprises: initialization unit, for carrying out epoll initialization; Socket returns unit, for when user access triggers epoll event, returns user's socket; SSL negotiation element, for carrying out SSL negotiation with user side, setting up SSL and connecting; Threaded processing element one, for adding to the socket of user and SSL structure body in thread process block structure body array and correlation in initialization thread processing block Array for structural body; Monitor queue and add unit one, the socket of user is added the epoll action listener queue in thread.
Described background processing module comprises: epoll waits for unit, for after the resource operation request receiving user, and the triggering of thread waits event; SSL linkage unit, the state value connected for basis and backstage Resource Server and backstage Resource Server are consulted, and set up SSL and connect; Threaded processing element two, for adding the socket be connected with backstage Resource Server and SSL structure body in thread process block structure body array and correlation in initialization thread processing block Array for structural body; Monitor queue and add unit two, the socket of backstage Resource Server is added the epoll action listener queue in thread.
Described background processing module also comprises: operational processes unit, for the resource operation request according to user after the epoll event triggering of thread, carries out the operation that reads and writes data of user side and backstage Resource Server.
Return epoll after the operation that reads and writes data of described operational processes unit completing user end and backstage Resource Server and wait for unit.
A kind of high performance ssl proxy method, its as WEB service software application in server.It comprises the steps:
User side Connection Step, receives user's access and holds consultation with user side, setting up user side SSL and connect.
Background process step, receives the resource operation request of user and holds consultation with backstage Resource Server, sets up backstage Resource Server and connects, and according to the resource operation request of user, carries out the operation that reads and writes data of user side and backstage Resource Server.
Described user side Connection Step and described background process step lay respectively in two threads of same process.
Set up in described background process step and be connected for foundation is connected with backstage Resource Server SSL with backstage Resource Server.
Described user side Connection Step and described background process step adopt respective epoll model respectively.
Described epoll model can be the epoll structure of epoll structure or the unblock of blocking.
Described user side Connection Step comprises: initialization step, carries out epoll initialization; Socket returns step, when user access triggers epoll event, returns user's socket; SSL negotiation step, and user side carries out SSL negotiation, sets up SSL and connects; Thread process step one, to add to the socket of user and SSL structure body in thread process block structure body array and correlation in initialization thread processing block Array for structural body; Monitor queue and add step one, the socket of user is added the epoll action listener queue in thread.
Described background process step comprises: epoll waiting step, after the resource operation request receiving user, and the triggering of thread waits event; SSL Connection Step, consults according to the state value connected with backstage Resource Server and backstage Resource Server, sets up SSL and connects; Thread process step 2, to add the socket be connected with backstage Resource Server and SSL structure body in thread process block structure body array and correlation in initialization thread processing block Array for structural body; Monitor queue and add step 2, the socket of backstage Resource Server is added the epoll action listener queue in thread.
Described background process step also comprises: operational processes step, according to the resource operation request of user after the epoll event triggering of thread, carries out the operation that reads and writes data of user side and backstage Resource Server.
Epoll waiting step is returned after the operation that reads and writes data of described operational processes step completing user end and backstage Resource Server.
The present invention takes full advantage of the feature that SSL encrypted card has multiple encryption and decryption process core, is connected and sets up SSL with backstage Resource Server to be connected setting up SSL with user side and the data read-write operation carrying out user side and backstage Resource Server puts into two threads of two processes or same process.Substantially increase the handling property carrying out data like this, and can be more stable when high pressure works.
Accompanying drawing explanation
Fig. 1 is the functional structure chart of existing WEB service software;
Fig. 2 is the structural representation of SSL encrypted card;
Fig. 3 is the functional structure chart of WEB service software of the present invention;
Fig. 4 is the structure chart of the high performance ssl proxy device of the present invention;
Fig. 5 is the flow chart of the high performance ssl proxy method of the present invention.
Embodiment
Describe the present invention below in conjunction with accompanying drawing.
The present invention makes full use of the characteristic of SSL encrypted card, on the basis of existing technology, by adding thread process, newly-built user side SSL is connected and is connected asynchronization with newly-built backstage Resource Server SSL, and adopt dual epoll model to process respectively for described two SSL connection, substantially increase handling property.
Referring to Fig. 3 and Fig. 4, a kind of high performance ssl proxy device, its as WEB service software application in server.The basic hardware framework of server comprises CPU, internal memory, input input equipment, nonvolatile memory (such as hard disk) and other hardware.Logically, described high performance ssl proxy device comprises:
User side link block, for receiving user's access and holding consultation with user side, sets up user side SSL and connects.
Background processing module, for receiving the resource operation request of user and holding consultation with backstage Resource Server, sets up backstage Resource Server and connects.And according to the resource operation request of user, carry out the operation that reads and writes data of user side and backstage Resource Server.
Described user side link block and described background processing module lay respectively in two threads of same process.
In the present embodiment, also need SSL to protect owing to being connected with backstage Resource Server, be connected for foundation is connected with backstage Resource Server SSL with backstage Resource Server so described background processing module is set up.
In the present embodiment, ssl proxy device can also comprise apparatus for initializing, for initialization SSL environment and socket.
In the present embodiment, ssl proxy device also can also comprise epoll model apparatus for establishing, utilizes at least one process of fork () function creation, and listen is monitored the epoll action listener queue that socket adds described process.
In the present embodiment, described user side link block and described background processing module adopt respective epoll model respectively.
Described epoll model can be the epoll structure of epoll structure or the unblock of blocking.
Described user side link block comprises: initialization unit, for carrying out epoll initialization.Socket returns unit, for when user access triggers epoll event, returns user's socket.SSL negotiation element, for carrying out SSL negotiation with user side, setting up SSL and connecting.Threaded processing element one, for adding to the socket of user and SSL structure body in thread process block structure body array and correlation in initialization thread processing block Array for structural body.Monitor queue and add unit one, the socket of user is added the epoll action listener queue in thread.
Described background processing module comprises: epoll waits for unit, for after the resource operation request receiving user, and the triggering of thread waits event.SSL linkage unit, the state value connected for basis and backstage Resource Server and backstage Resource Server are consulted, and set up SSL and connect.Threaded processing element two, for adding the socket be connected with backstage Resource Server and SSL structure body in thread process block structure body array and correlation in initialization thread processing block Array for structural body.Monitor queue and add unit two, the socket of backstage Resource Server is added the epoll action listener queue in thread.
Described background processing module can also comprise: operational processes unit, for the resource operation request according to user after the epoll event triggering of thread, carries out the operation that reads and writes data of user side and backstage Resource Server.
Return epoll after the operation that reads and writes data of described operational processes unit completing user end and backstage Resource Server and wait for unit.
The present invention also provides a kind of high performance ssl proxy method further, its as WEB service software application in server.It comprises the steps:
User side Connection Step, receives user's access and holds consultation with user side, setting up user side SSL and connect.
Background process step, receives the resource operation request of user and holds consultation with backstage Resource Server, sets up backstage Resource Server and connects, and according to the resource operation request of user, carries out the operation that reads and writes data of user side and backstage Resource Server.
Described user side Connection Step and described background process step lay respectively in two threads of same process.
Set up in described background process step and be connected for foundation is connected with backstage Resource Server SSL with backstage Resource Server.
Described user side Connection Step and described background process step adopt respective epoll model respectively.
Described epoll model can be the epoll structure of epoll structure or the unblock of blocking.
Described user side Connection Step comprises: initialization step, carries out epoll initialization; Socket returns step, when user access triggers epoll event, returns user's socket; SSL negotiation step, and user side carries out SSL negotiation, sets up SSL and connects; Thread process step one, to add to the socket of user and SSL structure body in thread process block structure body array and correlation in initialization thread processing block Array for structural body; Monitor queue and add step one, the socket of user is added the epoll action listener queue in thread.
Described background process step comprises: epoll waiting step, after the resource operation request receiving user, and the triggering of thread waits event; SSL Connection Step, consults according to the state value connected with backstage Resource Server and backstage Resource Server, sets up SSL and connects; Thread process step 2, to add the socket be connected with backstage Resource Server and SSL structure body in thread process block structure body array and correlation in initialization thread processing block Array for structural body; Monitor queue and add step 2, the socket of backstage Resource Server is added the epoll action listener queue in thread.
Described background process step also comprises: operational processes step, according to the resource operation request of user after the epoll event triggering of thread, carries out the operation that reads and writes data of user side and backstage Resource Server.
Epoll waiting step is returned after the operation that reads and writes data of described operational processes step completing user end and backstage Resource Server.
In sum, by giving each process many establishments thread, share and user side and and the two-way SSL negotiations process of backstage Resource Server, the event handling of two epoll model, reduces SSL negotiations process and user data and reads and writes influencing each other of processing.For the feature of encrypted card multi-core, open more process or add the effect that thread can reach the same.In actual test process, under opening 24 processes (server core cpu number is 8) situation: throughput 860Mbps; Concurrency performance 10000, comparing original scheme newly can have very large lifting.The present invention, under same cpu resource consumes, takes full advantage of the processing feature of the multiple encryption and decryption core of SSL encrypted card, improves handling property.Program structure of the present invention is more reasonable, makes ssl proxy program stable under high pressure test.
In addition, what preferred embodiment adopted is unblock epoll structure, then supports SSL encrypted card unblock encryption and decryption functions, and performance can also promote on this basis greatly.After adopting the difference of unblock epoll structure and the present embodiment to be mainly that epoll event triggers, process socket read-write buffer unblock process more more than clogged conditions, due to the difference that this belongs to unblock epoll structure and blocks epoll structure itself, therefore do not repeat them here.No matter unblock epoll structure and block epoll structure, as long as it adopts by adding thread process, newly-built user side SSL is connected and is connected asynchronization with newly-built backstage Resource Server SSL, and carry out process respectively for the dual epoll model of described two SSL connection employing and just can reach.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.

Claims (16)

CN201310700265.8A2013-12-182013-12-18High-performance SSL agency device and methodPendingCN104735023A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201310700265.8ACN104735023A (en)2013-12-182013-12-18High-performance SSL agency device and method

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201310700265.8ACN104735023A (en)2013-12-182013-12-18High-performance SSL agency device and method

Publications (1)

Publication NumberPublication Date
CN104735023Atrue CN104735023A (en)2015-06-24

Family

ID=53458462

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201310700265.8APendingCN104735023A (en)2013-12-182013-12-18High-performance SSL agency device and method

Country Status (1)

CountryLink
CN (1)CN104735023A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101256505A (en)*2007-03-022008-09-03中国科学院声学研究所 Single-process content server device and method based on IO event notification mechanism
CN101410803A (en)*2006-01-242009-04-15思杰系统有限公司Methods and systems for providing access to a computing environment
CN101729543A (en)*2009-12-042010-06-09同济大学Method for improving performance of mobile SSL VPN by utilizing remote Socks5 technology
CN102811201A (en)*2011-05-312012-12-05阿里巴巴集团控股有限公司SSL (Secure Sockets Layer) nonblocking communication method and server therefor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101410803A (en)*2006-01-242009-04-15思杰系统有限公司Methods and systems for providing access to a computing environment
CN101256505A (en)*2007-03-022008-09-03中国科学院声学研究所 Single-process content server device and method based on IO event notification mechanism
CN101729543A (en)*2009-12-042010-06-09同济大学Method for improving performance of mobile SSL VPN by utilizing remote Socks5 technology
CN102811201A (en)*2011-05-312012-12-05阿里巴巴集团控股有限公司SSL (Secure Sockets Layer) nonblocking communication method and server therefor

Similar Documents

PublicationPublication DateTitle
US9733980B1 (en)Virtual machine management using I/O device logging
CN102609215B (en)Data processing method and device
CN102147763B (en)Method, system and computer for recording weblog
CN104503863B (en)Kernel state and User space method for interchanging data for virtual container system disaster tolerance
US10296356B2 (en)Implementation of reset functions in an SoC virtualized device
CN105681402A (en)Distributed high speed database integration system based on PCIe flash memory card
CN102571925A (en)RDMA (Remote Direct Memory Access)-based data access method in fiber channel environment
CN103064748A (en)Method for processing communication among multiple processes in Linux system
WO2016058560A1 (en)External acceleration method based on serving end and external buffer system for computing device, and device implementing said method
CN103207846A (en) Memory controller and control method
CN104615577A (en)Big data server
KR20220060326A (en)Interface circuit providing extension packet and processor inclduing the interface circuit
US12093706B2 (en)Multiple port emulation
CN103810440A (en)Access system and method
CN104281545B (en)A kind of method for reading data and equipment
CN106293491B (en)The processing method and Memory Controller Hub of write request
CN103605628A (en)PCI-E-based method and device for achieving command interaction between master equipment and slave equipment
CN206193777U (en)LPC interface visit device, notebook computer based on platform of soaring
CN114661239B (en)NVME hard disk-based data interaction system and method
CN104735023A (en)High-performance SSL agency device and method
CN106383802B (en) LPC interface access device and method based on Feiteng platform, notebook computer
CN104331352B (en)Detection method and device are read outside cache uniformity chip address band
BorelloTowards Computational Storage
Wu et al.I/O stack optimization for efficient and scalable access in FCoE-based SAN storage
Peng et al.XHarvest: Rethinking High-Performance and Cost-Efficient SSD Architecture with CXL-Driven Harvesting

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
CB02Change of applicant information

Address after:100029 Beijing city Chaoyang District Yumin Road No. 3

Applicant after:State Computer Network and Information Safety Management Center

Applicant after:Hangzhou Dipu Polytron Technologies Inc

Address before:100029 Beijing city Chaoyang District Yumin Road No. 3

Applicant before:State Computer Network and Information Safety Management Center

Applicant before:Hangzhou Dipu Technology Co., Ltd.

CORChange of bibliographic data
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20150624


[8]ページ先頭

©2009-2025 Movatter.jp