Summary of the invention
The present invention is in order to solve the above technical problems, provide a kind of anycast method and system of the NDN based on routing and rewriting, energy
The forwarding logic of CCN content router forwarding engine is not destroyed.The technical solution is as follows:
On the one hand, the present invention proposes a kind of anycast method of the NDN based on routing and rewriting, includes the following steps:
Client sends the first request to network;
Intermediate router routes the scheduler that the first request is forwarded to some server zone based on anycast;
Scheduler is according to a server in the first preset strategy selection bundle of services;
First request is rewritten as the second request according to the agreement between scheduler and server by scheduler;
Second request is transmitted to selected server by scheduler;
Server returns to the first response message to scheduler;
First response message is rewritten as the second response message according to the agreement between scheduler and server by scheduler;
Second response message is returned to client by scheduler.
Further, the Service name of first request is an Anycast service name;The scheduler of each server zone
To the network notifications Anycast service name;First request is forwarded to several by anycast's routing mechanism of NDN by intermediate router
The scheduler of some server zone in server zone.
Further, second request includes that can identify the mark of selected server.
Further, the entitled Anycast service identical with the Service name of the first request of the service of second response message
Name, the reverse path hop-by-hop that the second response message is forwarded by the first request message return to client.
On the other hand, the present invention proposes in a kind of NDN based on routing and the anycast's system rewritten, comprising:
Client: for generating and sending the first request, the second response message is received;
Scheduler: for requesting, to network notifications Anycast service name or its prefix, reception first according to the first policy selection
Server, the first request of rewriting request for the second request, forwarding second, receive the first response message, rewrite the first response message
For the second response message, the second response message of forwarding;
Server: for receiving the second request, generating and send the first response message;
Intermediate router: establishing for the rule according to NDN and update route forwarding table, asks according to fib table forwarding first
Message is sought, returns to the second response message according to PIT table.
The invention adopts the above technical scheme compared with prior art, has following technical effect that
Through the invention, diversified anycast's demand can be supported in NDN, especially can effectively solve scaling concern,
Server can be neatly selected according to server state.In addition, technology proposed by the invention does not destroy NDN content router
Forward the forwarding logic of engine.
The additional aspect of the present invention and advantage will be set forth in part in the description, these will become from the following description
Obviously, or practice through the invention is recognized.
Specific embodiment
Embodiments of the present invention are described below in detail, the example of the embodiment is shown in the accompanying drawings, wherein from beginning
Same or similar element or element with the same or similar functions are indicated to same or similar label eventually.Below by ginseng
The embodiment for examining attached drawing description is exemplary, and for explaining only the invention, and is not construed as limiting the claims.
Those skilled in the art of the present technique are appreciated that unless expressly stated, singular " one " used herein, " one
It is a ", " described " and "the" may also comprise plural form.It is to be further understood that being arranged used in specification of the invention
Diction " comprising " refer to that there are the feature, integer, step, operation, element and/or component, but it is not excluded that in the presence of or addition
Other one or more features, integer, step, operation, element, component and/or their group.It should be understood that when we claim member
Part is " connected " or when " coupled " to another element, it can be directly connected or coupled to other elements, or there may also be
Intermediary element.In addition, " connection " used herein or " coupling " may include being wirelessly connected or coupling.Wording used herein
"and/or" includes one or more associated any cells for listing item and all combinations.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, all terms used herein (including technology art
Language and scientific term) there is meaning identical with the general understanding of those of ordinary skill in fields of the present invention.Should also
Understand, those terms such as defined in the general dictionary, which should be understood that, to be had and the meaning in the context of the prior art
The consistent meaning of justice, and unless defined as here, it will not be explained in an idealized or overly formal meaning.
Fig. 1 shows anycast's schematic diagram of a scenario of an embodiment according to the present invention.In figure, one large-scale service passes through more
A server zone being geographically spread out provides service.These M server zone Site 1, Site being geographically spread out
2 ..., Site M is connected by network.Each Site has multiple servers, such as Site k includes NkA server.Each
Server all provides identical service.The client for desiring access to service issues service request by network, finally by some clothes
The server service request being engaged in device group.The network for connecting client and each server zone is NDN network.
This entity of scheduler is introduced based on routing and the anycast's method rewritten in NDN proposed by the present invention, such as Fig. 3 institute
Show.Each server zone has a scheduler, for selecting a server in server zone.Scheduler usually and some
Server zone is located at the same network, the shop front as server zone.
Fig. 2 shows anycast's method flow diagrams in the NDN of an embodiment according to the present invention based on routing and rewriting.Tool
Body includes the following steps:
1) client sends the first request to network.
The Virtual Service name for the entitled service of service in the first request that client is sent, such as/foo.com/
generic-service-name。
In order to enable the scheduler of some server zone, each service can be forwarded to the request of above-mentioned Service name prefix
The scheduler of device group needs to notice to the route system of NDN with the routing item of the entitled prefix of the Virtual Service of the service after deployment
Mesh, i.e. ,/foo.com/generic-service-name.Optionally, scheduler can be by the routing entry polymerizeing to routing
System notice, such as/foo.com.The routing entry notice message, which is carried through Routing Protocol to the router of NDN network, to spread,
And inject route forwarding table FIB.Substantially, which is anycast's routing entry, and intermediate router passes through routing association
View calculates the forwarding port for suitably reaching some scheduler.
2) intermediate router routes the scheduler that the first request is forwarded to some server zone based on anycast.
After receiving the first request, intermediate router matches suitable port according to the forwarding entry in FIB, by its hop-by-hop
It is forwarded to the scheduler of some server zone.Since the scheduler of multiple server zones all has advertised identical routing entry, because
This, the scheduler that different server zones may be forwarded to the request of same services that different clients issues, and
Identical client different moments issue different server zones may also can be forwarded to the request of same services
Scheduler.Therefore, under the mechanism based on Anycast service, it is difficult to support the anycast based on stream.
3) scheduler is according to a server in the first preset strategy selection bundle of services.
After the first request has been forwarded to the scheduler of some server zone according to anycast's routing, scheduler is according to first
Preset strategy selects the server of first class services request.For this purpose, scheduler at least needs to configure the service of the server zone at place
Device information.Server can also be regular by the state of itself or Real-time Feedback is to scheduler, so that it carries out more complicated request
Scheduling.Scheduler can randomly choose a server service first using simple randomized policy and request, can also be using wheel
Turn strategy and make requests scheduling, can also be made requests according to the state (such as real time load, remaining service ability) of server
Scheduling.The first preset strategy that the present invention uses scheduler is without restriction.
4) the first request is rewritten as the second request according to the agreement between scheduler and server by scheduler.
After the server that first class services request has been determined, the first request is then rewritten as the second request by scheduler, and is remembered
Record the lower rewriting behavior.The rewriting that scheduler makes requests according to the agreement run between scheduler and server, scheduler need
It wants that revised second request selected server can be transmitted to based on the agreement.For example, if scheduler kimonos
It is engaged in supporting NDN agreement between device, then the request Service name that Service name can will be requested to be rewritten as server dependence, such as/
server-ID/foo.com/generic-service-name.Wherein server-ID is the mark of selected server.Again
Such as, if what is run between scheduler and server is ICP/IP protocol, scheduler can construct an IP packet, source
Location is the IP address of scheduler, and destination address is the IP address of selected server, while according to Service name generic-
Service-name determines the port numbers of service, sets corresponding port numbers for destination port, and other in request name
Other information in parameter information and request body is rewritten and is encapsulated according to the consensus standard run.In the process of rewriting
In, it is possible to need to be implemented recalculating for message integrity, such as the calculating of IP packet checksum.The present invention is to scheduling
The agreement and corresponding rewriting rule run between device and server is without restriction.
5) the second request is transmitted to selected server by scheduler.
After scheduler requests successfully to be rewritten as the second request by first, by the second request based on protocol forward to selected
Server, meanwhile, the rewriting behavior is recorded on scheduler.The rewriting record behavior at least will include the first request
Service name and second request mark mapping relations, so as to scheduler upon receipt continue response when can successfully according to should
The reversed rewriting of mapping relations execution response message.
6) server is to the first response message of scheduler dispatches.
After server receives the second request, the request is serviced, and construct the first response message.First response message with
The protocol format building run between server and scheduler, and based on the protocol forward to scheduler.For example, if scheduler
What is run between server is NDN agreement, then the Service name of first response message is /server-ID/foo.com/
Generic-service-name, and scheduler is returned to along the reverse path of the second request.For another example, if scheduler kimonos
What is run between business device is IP agreement, then the destination address of the first response message and destination port are the source address of the second request
And source port, first response are forwarded to scheduler by IP agreement.
7) the first response message is rewritten as the second response message according to the agreement between scheduler and server by scheduler.
After scheduler receives the first response message, by according to the rewriting behavior record of the first request, the first response is disappeared
Breath is rewritten as the second response message.For example, if what is run between scheduler and server is NDN agreement, by the first response
Service name/server-ID/foo.com/generic-service-name of message is rewritten as/foo.com/generic-
service-name.When rewriting, scheduler be it may also be desirable to while update message is signed and key information.And if scheduler
What is run between server is IP agreement, obtains the identification information of the first response message message, including < source address, mesh first
Address, source port, destination port >, accordingly construct second request identification information, then according to first request Service name and
The identification information of second request is rewritten into the second response message.When executing rewriting, in addition to carrying out protocol conversion, scheduler
Also need to be arranged the key information and information signature information of data packet.
8) the second response message is returned to client by scheduler.
When scheduler the second response message of Successful construct after, by the second response message along the forward-path of the first request
Reverse path returns to client.
Fig. 3 shows the entity based on routing and the anycast's method rewritten in the NDN of an embodiment according to the present invention and hands over
Mutually figure.Wherein, step (1)-(8) respectively correspond eight steps in Fig. 2.
Fig. 4 is shown in the NDN of an embodiment according to the present invention based on routing and the anycast's system deployment rewritten signal
Figure, comprising:
Client: for generating and sending the first request to network, the scheduler for receiving a certain server zone from network is returned
The second response message returned;
Scheduler: positioned at the front of each server zone, for network notifications Anycast service name or its prefix, receiving the
One request, according to the first policy selection server, rewriteeing the first request according to the agreement run between scheduler and server is
Second request, is requested based on the protocol forward run between scheduler and server second, receives the first sound that server returns
Answer message, rewriteeing the first response message according to the agreement run between scheduler and server is the second response message, along the
The port that one request reaches returns to the second response message;
Server: for receiving the second request, the first response message is generated, the first response is returned to corresponding scheduler and disappears
Breath;
Intermediate router: establishing for the rule according to NDN and update route forwarding table, asks according to fib table forwarding first
Message is sought, returns to the second response message along the reverse path of the first request message forward-path according to PIT table.
The technical solution proposed through the invention can meet diversified anycast's demand in NDN network.And the energy
The offer of power does not change the content naming rule of the NDN network architecture and the processing logic of NDN forwarding engine.
Those skilled in the art of the present technique are appreciated that the present invention can be related to for executing in operation described herein
The equipment of one or more operations.The equipment can specially design and manufacture for required purpose, or also may include
Known device in general purpose computer, the general purpose computer are activated or are reconstructed with having the procedure selection being stored in it.This
The computer program of sample can be stored in equipment (for example, computer) readable medium or be stored in be referred to suitable for storage electronics
It enables and is coupled in any kind of medium of bus respectively, the computer-readable medium is including but not limited to any kind of
Disk (including floppy disk, hard disk, CD, CD-ROM and magneto-optic disk), immediately memory (RAM), read-only memory (ROM), electricity can be compiled
Journey ROM, electrically erasable ROM (EPROM), electrically erasable ROM (EEPROM), flash memory, magnetic card or light card.It is readable
Medium includes for by any mechanism of the readable form storage or transmission information of equipment (for example, computer).For example, readable
Medium include immediately memory (RAM), read-only memory (ROM), magnetic disk storage medium, optical storage medium, flash memory device, with
The signal (such as carrier wave, infrared signal, digital signal) etc. that electricity, light, sound or other forms are propagated.
Those skilled in the art of the present technique be appreciated that can be realized with computer program instructions these structure charts and/or
The combination of each frame and these structure charts and/or the frame in block diagram and/or flow graph in block diagram and/or flow graph.It can be by this
The processor that a little computer program instructions are supplied to general purpose computer, special purpose computer or other programmable data processing methods comes
Machine is generated, is used for be performed instruction by the processor of computer or other programmable data processing methods and create
Realize the method specified in the frame or multiple frames of structure chart and/or block diagram and/or flow graph.
Those skilled in the art of the present technique have been appreciated that in the present invention the various operations crossed by discussion, method, in process
Steps, measures, and schemes can be replaced, changed, combined or be deleted.Further, each with having been crossed by discussion in the present invention
Kind of operation, method, other steps, measures, and schemes in process may also be alternated, changed, rearranged, decomposed, combined or deleted.
Further, in the prior art to have and the step in various operations, method disclosed in the present invention, process, measure, scheme
It may also be alternated, changed, rearranged, decomposed, combined or deleted.
The above is only some embodiments of the invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.