Summary of the invention
The technical problem that the present invention will solve is, overcomes the traditional forward agency and the deficiency of reverse proxy technology, and a kind of Communication Realization method of layer transparent agent skill group is provided, and realizes the agent skill group breakthrough that full impregnated is bright.Through in the system and product of agent skill group solution, need not adjust any configuration of client and service end at needs, can realize comparatively perfectly solution.
For solving its technical problem, solution of the present invention is:
A kind of Communication Realization method of layer transparent agent skill group is provided, comprises:
(1) Communication Realization of client and agency service comprises:
(1) client is initiated the communication connection request to service end;
(2) the agency service main frame is intercepted and captured and should be connected through data link layer, and connects the directed relating module of steering proxy to this;
(3) the directed relating module of agency is received as local packets with packet, and the Virtual Service that itself and agency service are monitored is connected association process;
(4) the agency service Virtual Service is confirmed as the packet related with self, and notice ICP/IP protocol stack and client are responded and connected, and binds as the source IP address of responding with service end IP address;
(5) respond bag and transmit, lead to client through data link layer;
(6) client receives and responds bag, and sends to connect and confirm;
(7) affirmation of this affirmation bag of agency service response is wrapped to client;
So far, client with set up process being connected of agency service and finish;
(2) Communication Realization of agency service and service end comprises:
(1) after agency service is that client is set up complete TCP and connected, client ip address is carried out this locality as source IP address bind, send to connect to set up to service end through the ICP/IP protocol stack and ask;
(2) the connection request packet is transmitted through data link layer and is transferred to service end;
(3) service end receives after the connection request, carries out response process, sends then to connect and responds bag;
(4) data link layer that bag arrives the agency service main frame is responded in the connection of service end, and data link layer should be responded the directed relating module of bag steering proxy and handle;
(5) the directed relating module of agency is received as local packets with packet, and carries out association process to the connection that it is associated with connection request that agency service is sent;
(6) the agency service Virtual Service connects replying of response bag, sends to service end;
So far, the connection procedure of agency service and service end is set up and is finished;
(3) after agency service was through above-mentioned two establishment of connections success, follow-up needs carried out the round forwarding of packet through perfect connection, can realize the miscellaneous service demand for services based on Transparent Proxy.
Among the present invention, only needs are carried out agency's business datum execution Transparent Proxy service, and other business datums are adopted the mode of two layers of forwarding of network protocol stacks.
Among the present invention, the business data packet to agency's forwarding and two layers of forwarding of network protocol stack does not change its content, directly carries out two layers of Transparent Proxy service or network protocol stacks and transmits original client and service end data bag.
With respect to prior art, beneficial effect of the present invention is:
Under the Transparent Proxy technology model; Transparent Proxy only need be paid close attention to the application layer service that agency service need be provided; As only serve FTP, and then other services can arrive service end through the mode of two layers of transparent forwarding of network, and Transparent Proxy is only handled the Transparent Proxy of FTP and is transmitted.The great like this flexibility of satisfying professional relevant treatment, the independence that has more embodied the Transparent Proxy method of service is with advanced.
Embodiment
Need to prove that at first the present invention is a kind of application of computer software at communication technical field.In implementation procedure of the present invention, can relate to the application of a plurality of software function modules.The applicant thinks, as read over application documents, accurately understand realization principle of the present invention and goal of the invention after, under the situation that combines existing known technology, those skilled in the art can use the software programming technical ability of its grasp to realize the present invention fully.The aforementioned software functional module includes but not limited to: agency service, the directed relating module of agency etc., and this category of all genus that all application documents of the present invention are mentioned, the applicant enumerates no longer one by one.
For guaranteeing to understand accurately, avoid producing ambiguity or unclear, at first the part term that the present invention relates to is made an explanation as follows:
Virtual Service: refer to that in agent skill group local TCP connects simulation real service end and monitors the Connection Service that provides, the request service of his client of analog service end processing simultaneously with the identity of client, is sent the request service to service end again
Agency service: in the process that communicates to connect with transfer of data; As the intermediary entity that communicates to connect foundation and transfer of data; That participates in connecting independently sets up, and realizes being connected the isolation (promptly directly not establishing a communications link) of setting up to communicating to connect with the two ends of transfer of data
Below in conjunction with accompanying drawing, implementation procedure of the present invention is described in detail.
The naive model of communicating by letter with service end with the typical client shown in the accompanying drawing 1 is an example, and the enforcement of Transparent Proxy service embeds any position of client and service end communication link.
(1), select a suitable link point to insert the Transparent Proxy service host based on professional and actual O&M demand;
(2) the agency service main frame must possess two NICs, is used for and the communicating by letter of client and service end, and is configured to network bridge mode between these two interface cards;
(3) through the directed relating module of the Transparent Proxy shown in the accompanying drawing 2, configuration need be carried out the business of Transparent Proxy, is generally service end IP address and adds the connectivity port;
(4) communicate the connection test.Can realize the safety detection of miscellaneous service demand, value-added service demand etc. based on the Virtual Service of Transparent Proxy simultaneously.
The implementation framework of transparent forwarding model is seen shown in the accompanying drawing 2.
The Communication Realization method of layer transparent agent skill group comprises:
(1) Communication Realization of client and agency service comprises:
(1) client is initiated the communication connection request to service end;
(2) the agency service main frame is intercepted and captured and should be connected through data link layer, and connects the directed relating module of steering proxy to this;
(3) the directed relating module of agency is received as local packets with packet, and the Virtual Service that itself and agency service are monitored is connected association process;
(4) the agency service Virtual Service is confirmed as the packet related with self, and notice ICP/IP protocol stack and client are responded and connected, and binds as the source IP address of responding with service end IP address;
(5) respond bag and transmit, lead to client through data link layer;
(6) client receives and responds bag, and sends to connect and confirm;
(7) affirmation of this affirmation bag of agency service response is wrapped to client;
So far, client with set up process being connected of agency service and finish;
(2) Communication Realization of agency service and service end comprises:
(1) after agency service is that client is set up complete TCP and connected, client ip address is carried out this locality as source IP address bind, send to connect to set up to service end through the ICP/IP protocol stack and ask;
(2) the connection request packet is transmitted through data link layer and is transferred to service end;
(3) service end receives after the connection request, carries out response process, sends then to connect and responds bag;
(4) data link layer that bag arrives the agency service main frame is responded in the connection of service end, and data link layer should be responded the directed relating module of bag steering proxy and handle;
(5) the directed relating module of agency is received as local packets with packet, and carries out association process to the connection that it is associated with connection request that agency service is sent;
(6) the agency service Virtual Service connects replying of response bag, sends to service end;
So far, the connection procedure of agency service and service end is set up and is finished;
(3) after agency service was through above-mentioned two establishment of connections success, follow-up needs carried out the round forwarding of packet through perfect connection, can realize the miscellaneous service demand for services based on Transparent Proxy.
Among the present invention, only needs are carried out agency's business datum execution Transparent Proxy service, and other business datums are adopted the mode of two layers of forwarding of network protocol stacks.Business data packet to agency's forwarding and two layers of forwarding of network protocol stack does not change its content, directly carries out two layers of Transparent Proxy service or network protocol stacks and transmits original client and service end data bag.
The difference that the present invention and other are acted on behalf of scheme is:
1, realizes the Transparent Proxy forwarding mechanism in application layer
Transmit in the implementation in traditional network packet; It is the forwarding of pure packet; The typical case, does not act on behalf of though accomplished the transparency like the packet routing forwarding implementation of switch, router; Promptly not setting up TCP with the two ends of communication respectively and be connected, only is that the bag of network protocol stack data link layer and network layer is transmitted.
In traditional agency mechanism, no matter be that the application layer or the agency of network protocol stack bottom transmit, all can't accomplish the transparency.No matter be forward agency or reverse proxy, agency service all needs independent IP address, and TCP is connected and carry out active data bag transport communication as setting up with client and service end with this.This dual mode; Opaque for client; Opaque for service end, if, then can't accomplish seamless insertion in the basic deploy agency service of original client and service end communication construction; And the configuration that need be correlated with to client or service end, could the successful implementation agency service.
Transparent Proxy mechanism of the present invention; Then demonstrated fully the two-way transparent characteristic of client and service end; Can not only independently set up TCP and be connected, realize the transparent forwarding of packet with two ends, and in the network topology environment that original ripe client is communicated by letter with service end; Can be as increasing the network two-layer switching equipment, seamlessly must insert the Transparent Proxy service.This invention has supported to increase in the complex network environment maintainability and the scalability scheme of miscellaneous service greatly.
2, the innovation realization mechanism of uniqueness
The Transparent Proxy main frame need not possess the IP address of communicating by letter with service end with client, seems just as two layers of exchange of network forwarding unit.As everyone knows, purpose IP address is not the network communication data bag of this host IP address, can't arrive application layer through transport network layer, because this locality does not provide service TCP serve port and is connected.Reverse proxy and forward agent skill group, they need be configured into the industry IP address of communication of being engaged in, and carry out conventional TCP and connect and communicate by letter so can follow a well mapped-out plan; Equally, for the forwarding unit of two layers on network and three layers, need not set up TCP and connect, transmission network packet only need not run counter to the rule of any ICP/IP protocol stack yet.
The Transparent Proxy technology, needing to break through reception IP address is the restriction of the packet of non-main frame local ip address, and sets up virtual TCP connection and monitor serve port.When the packet of client-access arrives agency service host data link layer; The connection orientation of packet is associated with local monitoring serve port; The IP address that local monitoring serve port adopts service end at this moment is as source address; Set up TCP with client and be connected, client is connected with TCP between the agency service just to set up and finishes like this.In like manner, after agency service and client have been set up TCP and be connected, need set up TCP with service end and be connected, at this moment, agency service, is set up TCP with service end and is connected as source IP address with the original ip address of client.After two-way connection was set up and finished, client and service end just can be carried out transfer through agency service, realized the data communication that connects based on TCP.
For UDP communication send a letter here, need not set up reliable connection, therefore in the process of communications, just save the TCP establishment of connection process of foregoing description, and only used the purpose that reaches transparent transmission through the exchange of IP address.
3, a care needs agency's data service
Traditional forward agency and reverse proxy technology based on application layer, owing to disposed the IP address of direct communication, the IP address is as the direct target of communication, so it has occupied an independently communication entity.When service end provides a plurality of application service, as and HTTP is provided service, also comprise FTP; SSH service etc., then under traditional agent framework, the configuration of acting server; Not only HTTP need be supported, FTP must be supported, SSH etc.; Otherwise the service that service end provides just can't obtain normal communications access.
Transparent Proxy technology mainly is based on the shortcoming of forward agency and reverse proxy technology, carries out a kind of brand-new improvement implementation, thereby realization is to client and service end transparent way all.Under the Transparent Proxy technology, the purpose IP address of client-access is the direct IP address of service end, advances after the Transparent Proxy service, and the original visit IP address that service end is seen is the IP address of client not yet.Under a kind of like this technic relization scheme, in the network topology structure of disposing the Transparent Proxy service, need not change any network configuration, just can realize the application deployment of Transparent Proxy service.