Detailed description of the invention
In the following detailed description, provide a large amount of details, to provide reality of the present inventionExecute the thorough understanding of example. But, it should be appreciated by those skilled in the art that these details are onlyIllustrative rather than restrictive, can in the situation that there is no these details, realize the present invention.In description, do not describe some known parts, structure and operation in detail, in order to avoid improper topotypeStick with paste the present invention.
Phrase " embodiment " or " embodiment " etc. mentioning in description represents in conjunction with this enforcementSpecial characteristic, structure or characteristic routine and that describe are included at least one embodiment of the present invention.Therefore, in this manual everywhere occur phrase " in one embodiment " or " according to a realityExecute example " etc. might not refer to same embodiment.
It will be understood by those skilled in the art that embodiment as herein described can be by hardware, software, solidPart, middleware, microcode or its are combined to realize.
First with reference to figure 1, it shows the system 100 according to one exemplary embodiment of the present inventionGeneral view.
In the one typical case of system 100 realizes, client 101 be positioned at network (for example, LAN,Not shown) a region in, server 102 is arranged in another region of consolidated network, and gateway103 between these two regions, play the effect of bridge joint. For for simplicity, for this beEach building block of system, only show single equipment here, but the present invention is not limited to this.
Client 101 can comprise any one in the multiple computing equipment based on processor, itsIn network, there is the unique identify label of oneself, for example, include but not limited to this client physicallyLocation (, media Access Control (MAC) address), IP address etc. Described client can be transportedRow has one or more in various operating system, for example, includes but not limited to various versionLinuxTM、UnixTM、WindowsTM, etc.
Similarly, server 102 and gateway 103 also can comprise respectively the multiple meter based on processorAny one in calculation equipment; Equally, server 102 and gateway 103 also can move respectively respectivelyOne or more in kind operating system. Server 102 is used to each including client 101Plant requesting service various types of services are provided. Gateway 103 is in bridge mode, for realizing clientCommunication between end 101 and server 102. In an embodiment of the present invention, gateway 102 can alsoProvide application level proxy service, and its agent functionality is in network seven layer protocol architecturesTwo layers (data link layer, more particularly, media access control sublayer wherein) be also transparent.
Below, with source station (for example, client 101) to point of destination (for example, server 102) send outSend data instance, client is described in the situation that gateway (or transparent proxy gateway) 103 exists101 and server 102 between the actual a kind of communication process occurring. Those skilled in the art can manageSeparate, here using client 101 as source station, be only a kind of example using server 102 as point of destinationSituation, the present invention is not limited to this.
First the data that client 101 is sent can be intercepted by transparent proxy gateway 103, and the latter againGo to send these data with the identity of client 101 to server 102. Thus, transparent by between two partiesProxy gateway 103 is realized transfer of data between client 101 and server 102. From client101 angle, it is to communicate at direct and server 102, but actual really not so.
More specifically, with reference to Fig. 1, receive (or intercepting) at transparent proxy gateway 103 to clientWhen 101 frames that send to server 102 110 (as shown in the arrow in left side in figure), can be to this frameMAC layer information contained in 110 stem is carried out record, for example, at least comprises source MACInformation (, the MAC Address of client 101 self), etc. The MAC layer information recordingCan also comprise the target MAC (Media Access Control) address information (, the MAC Address of server 202) of frame 110.In addition, depend on actual needs, can also record out of Memory, for example, using 802.1Q virtual officeIn the situation of territory net (VLAN), (wherein in the frame format of Ethernet, insert the VLAN of 4 bytesMark), can also record vlan identifier (ID) in VLAN mark etc., the present invention is alsoBe not limited to this.
Above-mentioned record end of operation after, in one embodiment, can start receivedThe application layer data comprising in frame 110 carries out application level proxy processing. Described application layer data refer toThe relevant data of operation of application process, for example, include but not limited to Email, HTTP messageEtc., it is processed in the application layer of layered protocol message structure. At Transparent Proxy netClose in 103, application level proxy processing example is as included but not limited to killing virus, information filtering etc.,Used in prior art.
After application level proxy is disposed, be in due course, transparent proxy gateway 103 will be withThe identity of client 101 is sent frame 111 (as shown in the arrow on right side in figure) to server 102,The application layer data of having handled before having comprised in this frame 111. It should be noted that according to the present invention,For this frame 111, can revise frame by the source MAC address information of the frame 110 that recorded beforeCorresponding informance in 111 stem, and then amended frame 111 is issued to server 102. Pass throughSuch processing, is appreciated that the MAC layer information of the frame 111 that transparent proxy gateway 103 sendsBe that the primitive frame 110 that same client 101 is sent is consistent, therefore can realize the second layer transparent.
By comparison, on the existing transparent proxy gateway that moves for example linux system, although canIP address by calling system API amendment initiator and port are (to make from gateway forwards toward targetThe grouping of server looks like directly sends from original client, realizes the 3rd layer thoroughly with thisBright, as previously mentioned), but but cannot revise source MAC. In this case, for example, doFor some second layer filter plants between gateway device and server, may can't see original true completelyReal client mac address, and cause a series of problem such as corresponding control, access strategy withoutMethod solves, and causes such agency to realize not to be real transparent, that is to say, it at logarithm reportedlyBe input into some identification information of having revised client in the capable process of acting on behalf of.
As previously mentioned, utilize design of the present invention, can realize the second layer transparent, thus the use of facilitatingFamily network design has improved user's experience simultaneously.
Fig. 2 illustrates in greater detail the system 200 according to one exemplary embodiment of the present invention. ?Hereinafter, omitted for unit (for example, client 201, server 202 identical in Fig. 1Etc.) explanation, and specifically describe emphatically gateway of the present invention (or Transparent Proxy) 203.
As shown in the figure, according to one embodiment of present invention, transparent proxy gateway 203 can comprise noteRecord logic 204, application level proxy 205 and Microsoft Loopback Adapter (VIF) 206. As in bridge jointThe gateway of pattern, its typically have multiple interfaces (, network interface card) for each self-corresponding orderLabeling station communicates. For convenience of description, in Fig. 2, only illustrate for transparent proxy gateway 203Two interfaces, the network interface card 207 that can communicate with client 201 and can with serviceThe network interface card 208 that device 202 communicates.
As known to those skilled in the art, conventionally in gateway device, safeguard have one to transmit (notIllustrate), entry (if any) wherein shows Target Station (identifying with its MAC Address)And the corresponding relation between an interface of this gateway, for example client 201 corresponding to network interface card 207,Server 202 is corresponding to network interface card 208 etc. Transparent proxy gateway 203 (more specifically, for example,Network interface card 207) mail to the server 202 as point of destination being truncated to from the client 201 as source stationA frame (for example, frame 210) time, determine that this gateway can communicate with server 202,For example, transmit by search, find to exist the network interface card 208 corresponding with server 202.
In Fig. 2, record logic 204 for record that network interface card 207 intercepts from 201 of clientsThe frame 210 of past server 202 for information about. In one exemplary embodiment of the present invention, instituteSource (, the client 201) MAC Address that the information of stating at least comprises frame 210, this can be from this frameStem in obtain. Described information for example can also include but not limited to: the object of frame 210 (,Server 202) MAC Address, this also can obtain from the stem of this frame; With this object MACThe interface (, network interface card 208) of what address was corresponding belong to gateway 203, this can transmit from describedMiddle acquisition; Etc.. These information can be stored explicitly, so that use.
As a non-limiting example, in the transparent proxy gateway based on Linux, can makeAllow kernel to follow the tracks of and record all logical network connection or session with connecting to follow the tracks of. In the present inventionA kind of example implementation in, can expand the data structure safeguarded for each connection (for example, withIP address and port identify as it) to store more information. For example, recording logic 204 canFor example, so that required information (, source and destination MAC Address of frame 210 etc.) is remembered explicitlyIn the structure of record after expansion, for subsequent process.
By network protocol stack, the frame 210 before receiving is successively peelled off stem and to more high-rise biographyPass, the application layer data finally wherein comprising is delivered to application level proxy 206 to carry out conventional answeringUse layer proxy processing, for example, include but not limited to killing virus, information filtering etc. Of the present inventionMain improvement do not lie in this, therefore omits further describing it.
Continue with reference to figure 2, in one exemplary embodiment of the present invention, for transparent proxy gateway203 frames that send to server 102 with the identity of client 101 in response to the frame 210 receiving211, can realize the recovery of source MAC in this frame by VIF206.
The form that Microsoft Loopback Adapter VIF206 can drive by network interface card realizes. In operating system, addAfter thereby year this driving is registered this network interface card, it is one that VIF206 is identified as by operating systemCommon network interface card. According to one exemplary embodiment of the present invention, VIF206 can revise transparent generationThe routing policy (for example, routing table) of reason gateway 203, to make for through application level proxy 205Data that process, transparent the sending of needs (for example, issuing server 202) are all routed toVIF206 sends.
VIF206 has the ability of the source MAC of the amendment frame 211 corresponding with frame 210. According toOne embodiment of the present of invention, for example, VIF206 can be with reference to before by recording logic 204 records(expansion connection follow the tracks of in) frame 210 for information about in corresponding content, as client201 MAC Address; Then, the source MAC address information in the stem of frame 211 is revised as to instituteThe source MAC (, the MAC Address of client 201) of record; Then, directly call netAmended frame 211 is sent to server 202 by the transmission function of card 208.
Thus, send to server 202 at transparent proxy gateway 203 with the identity of client 201In frame 211, can guarantee that source MAC address information is also and the MAC ground of client 201 selfLocation is the same, thereby it is transparent to have realized the second layer (MAC layer).
In one embodiment of the invention, for example, before can the utilizing information of record, with reference to this netWhat close transmits, and determines to send by network interface card 208.
Here, directly called the transmission function of physical network card (for example, network interface card 208) by VIF206,Avoid carrying out the process of framing for this physical network card by network protocol stack, thereby guaranteed warpThe source MAC of the frame that this physical network card sends remains through above-mentioned amended source MAC(, the MAC Address of client 201).
The function that it will be understood by those skilled in the art that above-mentioned all parts also can combine mutually, exampleAs, recording logic 204 and VIF205 can be by realizing in single parts.
In addition, consider the situation of 802.1QVLAN, according to one embodiment of present invention, record is patrolledCollect 204 and can also additionally record the VLANID of received frame (for example, frame 210), exampleAs, it can be recorded in explicitly and be connected the expansion of following the tracks of with the information such as the MAC Address of this frameIn structure; Correspondingly, VIF206 can also utilize this recorded VLANID to change and will issueThe VLANID of the frame (for example, frame 211) of server 202, thus also can realize for VLANSecond layer Transparent Proxy.
In addition, utilize design philosophy of the present invention, it will be understood by those skilled in the art that for from clothesBusiness device 202 mail to client 201 data (at this moment, server 202 can be regarded as source station,Client 201 can be regarded as point of destination), transparent proxy gateway 203 can carry out similarlyProcessing, make in client 201, is that real server 202 is carrying out direct communication with it,In fact be that transparent proxy gateway 203 is between two parties leading to it with the identity of server 202Letter.
In addition, consideration need to be by shaking hands to connect (or session) to carry out the feelings of transfer of dataCondition (for example, using transmission control protocol (TCP)). According to one exemplary embodiment of the present invention,In this case, in the time that client 201 is sent connection foundation request to server 202 for the first time, phaseThe claim frame of answering can be intercepted by the network interface card of transparent proxy gateway 203 207. Gateway 203 is confirmed oneselfCan communicate with server 202, for example, be by network interface card 208 (otherwise, net hereClosing 203 can select this claim frame directly by other network interface card beyond inter nic on this gateway 207Broadcast, as realized in bridging device of the prior art). Then, record logic 204Can record this claim frame for information about, for example, the source MAC conduct in the stem of this frameThe MAC Address of client 201, the target MAC (Media Access Control) address in the stem of this frame is as server 202MAC Address, etc., the present invention is not limited to this.
According to one exemplary embodiment of the present invention, after such information is recorded, according to holdingHandball Association view, as transparent proxy gateway 203 in response to this claim frame with the identity of server 202 toThe acknowledgement frame that client 201 is sent, VIF206 can be by the source MAC ground in the stem of this acknowledgement frameLocation information is revised as the MAC Address of recorded server 202, and by directly calling network interface card 207Transmission function amended this acknowledgement frame is issued to client 201. Those skilled in the art canUnderstand, then client 201 can be sent and reaffirm frame in response to receiving this acknowledgement frame, asIt is such that prior art realizes. By such handshake procedure, at client 201 and Transparent Proxy(certainly,, in client 201, it is direct and server between gateway 203, to have set up connection202 have set up connection). In addition, after suitable opportunity, transparent proxy gateway 203 is with clientBetween 201 identity (more specifically, the MAC Address of this client) and server 202, set upSituation about connecting is similar to the above, is not described in detail in this.
Transfer of data (for example, frame 210) between client 201 and server 202 is passed through justThe connection of setting up is like this carried out. The information recording before utilizing, VIF206 can be sending outGive the source MAC address information in the stem of frame 211 server 202, corresponding with frame 210Be revised as the MAC Address of recorded client 201, realize the second layer with this transparent, as frontDescribed.
Below with reference to Fig. 3, show according to the method 300 of one exemplary embodiment of the present inventionFlow chart. Described method 300 can have the gateway of application level proxy function (for example, transparent generationReason gateway 103,203) middle realization.
As shown in the figure, this process starts from step S301, in this step, to the first net in gatewayWhat card intercepted mails to from source station the application layer data comprising the first frame of point of destination and processes. GinsengExamine the example providing in conjunction with Fig. 2, for transparent proxy gateway 203 (more specifically, wherein canThe network interface card 207 communicating with client 201) intercept mail to server 202 from client 201Frame 210 in the application layer data that comprises, for example include but not limited to Email, HTTP messageEtc., as the gateway 203 with application level proxy function, application level proxy 205 wherein canThis application layer data is processed, for example, included but not limited to killing virus, information filtering etc.
Gateway, need to be with the identity of source station by the number intercepting from source station before in order to realize agent functionalityMail to destination according to (it has passed through the processing of gateway). According to an exemplary enforcement of the present inventionExample, at step S302, to issue in response to described the first frame described point of destination, comprise through locatingSource MAC address information in the stem of the second frame of the application layer data of reason is revised as described source stationMAC Address. Continue with reference to figure 2 the application number of plies comprising in to frame 210 at application level proxy 205After processing, VIF206 can comprise this treated application layer data formedSource MAC address information in the stem of the second frame 211 is revised as the MAC of client 201 selfAddress. That is to say, the mac address information in the stem of amended like this frame 211 is and visitorMac address information in the stem of the original frame sending 210 of family end 201 is consistent.
Then, this process advances to step S303, in this step, by directly calling described gatewayIn the transmission function of the second network interface card, described the second frame is sent to described point of destination. Continue reference diagram2, VIF206 can, after above-mentioned retouching operation completes, directly call in transparent proxy gateway 203The transmission function of real physical network card 208 (it can communicate with server 202), makesFrame 211 is really issued server 202. Thus, according to an embodiment of the invention can be realThe method 300 of existing MAC layer Transparent Proxy can finish.
In addition, in one embodiment of the invention, before step S301, described in can also working asFor example, when the first frame (, frame 210) for example, is intercepted by described the first network interface card (, network interface card 207), noteSource MAC address information in the stem of record frame 210, as the MAC Address of client 201,Use for follow-up modify steps. In addition,, in this recording step, can also record frame 210Target MAC (Media Access Control) address information in stem, as the MAC Address of server 202. And,Frame 210 has in the situation of VLAN mark, in this recording step, can also record frame 210Vlan identifier; And in described modify steps S302, can also be by the VLAN of frame 211Identifier is revised as the vlan identifier of recorded frame 210. As a kind of concrete implementation,These information that record, for example, include but not limited to the MAC Address of source station, the MAC of point of destinationAddress and vlan identifier etc., can be stored in the connection of expansion is followed the tracks of, as front instituteState.
In addition in one embodiment of the invention, before step S301, can also require,The request connecting between the client 201 as source station and the server 202 as point of destinationWhen frame is intercepted by network interface card 207, (for example, consideration need to be by shaking hands to connect to continue dataThe situation of transmission, wherein, the frame 210 that comprises application layer data is to be undertaken by the connection after setting upTransmission), record the source MAC address information in the stem of this claim frame, as client 201MAC Address, uses for follow-up modify steps S302. Similarly, can also record this requestThe target MAC (Media Access Control) address information of frame is using the MAC Address as server 202 and VLAN markKnow symbol, etc. And, in response to this intercepted claim frame, as transparent proxy gateway 203 withThe part that the identity of server 202 and client 201 connect by shaking hands, can also be for exampleBy VIF206, the source MAC address information in the stem of the acknowledgement frame in response to this claim frame is repaiiedChange the MAC Address of recorded server 202 into, then call the transmission function of network interface card 207Such acknowledgement frame is sent to client 201.
Describe exemplary method 300 with reference to Fig. 3 above, it will be understood by those skilled in the art thatSaid method step is only illustrative rather than restrictive, depends on specific implementation, described methodCan also comprise how additional/alternative step. In one or more schemes, these method stepsCorresponding function can realize in hardware, software, firmware or its any combination.
Fig. 4 shows according to the block diagram of the device 400 of one exemplary embodiment of the present invention.
Described device 400 at least comprises following part: modified module 401, and for can at gatewayWhat the first network interface card communicating with source station intercepted wraps from the first frame of point of destination is mail in described source stationAfter the application layer data containing is processed, sending to described order in response to described the first frameThe stem of the second frame station, that comprise treated described application layer data in source MACInformation is revised as the MAC Address of described source station; And sending module 402, for by callingThe transmission function of second network interface card that can communicate with described point of destination in described gateway, by describedTwo frames send to described point of destination.
In addition, described device 400 can also comprise additional/alternative module, more multipair in order to realizeThe function of answering, for example, before associated methods 300 described. Described device 400 for example can be rightShould be in the gateway device 103,203 shown in Fig. 1, Fig. 2, or one or more assembly.Should be understood that, device 400 is described to comprise multiple modules, its can be represent by hardware,The functional module that software or its combination realize.
Although describe and show some embodiments of the present invention above, those skilled in the art veryEasily just can expect, be feasible for many amendments and the modification of these embodiment too. CauseThis, should be appreciated that, claims are intended to contain the institute falling within the spirit and scope of the inventionThere are such amendment and modification.