CN100594688C - Simulating moving self organization network method - Google Patents

Simulating moving self organization network method Download PDF

Info

Publication number
CN100594688C
CN100594688C CN200710099382A CN200710099382A CN100594688C CN 100594688 C CN100594688 C CN 100594688C CN 200710099382 A CN200710099382 A CN 200710099382A CN 200710099382 A CN200710099382 A CN 200710099382A CN 100594688 C CN100594688 C CN 100594688C
Authority
CN
China
Prior art keywords
bag
node
experiment
packet header
packet
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.)
Expired - Fee Related
Application number
CN200710099382A
Other languages
Chinese (zh)
Other versions
CN101051874A (en
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.)
Peking University
Original Assignee
Peking University
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 Peking University filed Critical Peking University
Priority to CN200710099382A priority Critical patent/CN100594688C/en
Publication of CN101051874A publication Critical patent/CN101051874A/en
Application granted granted Critical
Publication of CN100594688C publication Critical patent/CN100594688C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Using application - interface isolation technique, the method fixes up mapping relation between nodes to be simulated and experiment node. Based on mapping relation of nodes, experiment node dispatches data packets of application program to realize simulation of self-organization network. The invention deploys mapping relation of nodes at sampling time on different wireless nodes on simulation platform to retain characteristic of distribution operation of application. Meanwhile, the method combines the technique with damping control for radio frequency signal to obtain high simulation validityfor two features including wireless link of transmission characteristic, and node movement in mobile self-organization network. The invention guarantees better validity of simulation.

Description

A kind of method of simulating moving self organization network
Technical field
The present invention relates to the mobile ad-hoc network technology, be specifically related to a kind of method of simulating moving self organization network.
Background technology
(Mobile Ad-hoc NETwork, the MANET) autonomous system of being made up of the node that can move arbitrarily is a kind of wireless multi-hop network of topological dynamic change to mobile ad-hoc network.Compare with existing wireless cellular network (Cellular Networks), WLAN (wireless local area network) (Wireless LAN), have need not to dispose in advance, networking whenever and wherever possible, self-organizing and advantage such as maintenance certainly.
In recent years, the agreement research and development relevant with mobile ad-hoc network continue burning hot, and the agreement assessment is that procotol is designed and developed the important step in the process, directly has influence on quality and efficient that procotol is designed and developed.Simulation, emulation and outdoor scene experiment are three kinds of main agreement assessment approach.
Network simulator is to move false code on virtual network, and it is low to have a cost, and easy, repeatably experiment scene setting can be provided, advantage such as extensibility is good, but authenticity is poor, can't simulate the physical characteristic of mobile ad-hoc network wireless channel.The outdoor scene experiment is the true code of operation on live network, and the agreement that the researcher designs and develops finally will be moved under true environment, carries out the agreement assessment highly significant so build the outdoor scene environment.But the outdoor scene experiment is difficult to obtain the experiment setting of repetition, and because mobile ad-hoc network is a kind of wireless multi-hop network, so need bigger place to dispose outdoor scene experiment bed, this makes that also the cost of outdoor scene experiment is very high.
Emulation is the true code of operation on half real network, and the result that it pursues the agreement operation is identical with the outdoor scene experiment, but and the method that provides the acquisition repeated experiments to be provided with.We can say that emulation is the third agreement assessment approach that conveniency, repeatability and outdoor scene experiment authenticity characteristics are set that combines simulation, has a good application prospect.
In order to guarantee transmission of radio links characteristic Simulation validity preferably, existing mobile ad-hoc network emulation platform uses the space for its deployment of the method compression emulation platform of radiofrequency signal decay control usually, reduce lower deployment cost, document (H.Zhao wherein, W.Yan, T.Zhao, and X Li, " WirelessMulti-hop Network Scenario Emulation with MinMax Error ", inProceedings of the 31st IEEE Conference on Local Computer Networks (LCN ' 06), Nov.2006, pp.949-951) propose a kind ofly to obtain the algorithm of best emulation platform at any mobile ad-hoc network static scene, the implicit prerequisite of this algorithm is fixing by the corresponding relation between simulation node and the simulation node.But in actual applications, after emulation experiment begins, just operated on certain stationary nodes in the emulation experiment bed by the application on the simulation node, carry out in order to make Therapy lasted, remained unchanged by the corresponding relation between simulation node and the simulation node in the whole simulation experimentation with regard to requiring, and the node location in the emulation experiment bed is fixed, and internodal relative position relation is also fixing, and these constraintss make the flexibility deficiency of radiofrequency signal decay control method to node motion emulation.
The method of utilizing fixing experiment bed simulating moving self organization network is arranged in the prior art, this method is disposed a large amount of lightweight simulation nodes in the large space scope, these nodes only need possess wired, wireless data packet transmission-receiving function, need not to move complicated applications (comprising Routing Protocol), all application in the emulation experiment all operate on the main frame, each application on any time this main frame is all corresponding with a lightweight simulation node, realizes mobile ad-hoc network emulation by changing each mapping relations of using with the lightweight simulation node.Obviously, this emulation mode needs to dispose on a large scale place and a large amount of simulation node, and the lower deployment cost height should not be promoted; And operate in all application sets on the main frame, the distributed nature of using operation in this and the mobile ad-hoc network is not inconsistent.
Summary of the invention
In view of this, the present invention is devoted to provide a kind of method of simulating moving self organization network.
Above-mentioned purpose of the present invention is achieved by the following technical solutions:
A kind of method of simulating moving self organization network comprises:
A1) emulation platform is made up of a Control Node and several experiment nodes, APD to be tested is deployed on each experiment node, described Control Node links to each other by high speed switch with described experiment node, on each experiment node a wireless network card and a wired network adapter are housed, wireless network card links to each other with external antenna, inserts the tunable radio frequency signal attenuator between wireless network card and external antenna;
B1) in the emulation experiment set-up procedure, for each experiment node is specified a virtual ip address, use for application program to be tested, mobile self-organization network scene to customization on described Control Node carries out time sampling, produce mobile ad-hoc network static scene sequence, and the parameter vector is controlled in the node mapping relations and the decay of calculating each static scene correspondence in the above-mentioned sequence, the simulation node mapping relations and the decay control parameter vector of each sampling instant are sent to whole experiment nodes, wherein the simulation node mapping relations show as virtual ip address and the corresponding relation of testing node, that is: virtual ip address and corresponding corresponding relation of testing node radio network interface IP address and wired network interface IP address are stored in application-interface map list;
C1) after the startup emulation experiment, each sampling instant, described Control Node sends current sampling instant sequence number to each experiment node, described experiment node is provided with this node decay control parameter according to current sampling instant sequence number, and dispatches according to the IP packet of current sampling instant node mapping relations application programs.
Further comprise after the described step c1:
When a2) the IP packet of experiment node application programs sends, in the IP bag, keep the initial IP packet header;
B2) if the source address in the initial IP packet header is a virtual address, and this address corresponding wireless network interface IP in application-interface map list belongs to this machine, then IP bag is labeled as " an experiment bed packet " and " wireless transmission ", it is forwarded to destination address corresponding wireless network interface in application-interface map list in the initial IP packet header by radio network interface;
C2) if the source address in the initial IP packet header is a virtual address, and this address corresponding wireless network interface IP in application-interface map list does not belong to this machine, after then the IP bag being labeled as " experiment bed packet ", it is forwarded to the wired network interface of the source address correspondence in application-interface map list in the initial IP packet header by wired network interface.
Further comprise after the described step c1:
A3) described experiment node receives in the IP packet header IP packet that is labeled as " experiment bed packet ";
B3) if the IP bag is not marked as " wireless transmission ", then this IP is wrapped the destination address corresponding wireless network interface in application-interface map list that is sent in the initial IP packet header by radio network interface;
C3) if IP bag is marked as " wireless transmission ", and the corresponding wired network interface IP in applications-interface map list of the destination address in the initial IP packet header belongs to this machine, then recover initial IP packet header after, IP wrapped is delivered to the protocol stack upper strata; If the IP bag is marked as " wireless transmission ", and the corresponding wired network interface IP in application-interface map list of the destination address in the initial IP packet header does not belong to this machine, then by wired network interface it is sent to the wired network interface of the destination address correspondence in application-interface map list in the initial IP packet header.。
When described experiment node sent packet, the treatment step before Routing Protocol was:
A4) the IP bag that is about to send from the acquisition of network protocol stack upper strata;
B4) if the source address of IP bag belongs to virtual ip address, then with the expansion of former IP bag, headspace;
C4) give lower-layer protocols with the IP bag.
When described experiment node sent packet, the treatment step behind Routing Protocol was:
A5) obtaining to handle IP afterwards through Routing Protocol wraps;
B5),, otherwise continue then to the finishing scheduling of this IP bag if source address is not a virtual ip address;
C5) IP packet header is copied to the space of having reserved;
D5) if IP bag source address corresponding wireless network interface IP in application-interface map list belongs to this machine, then forward e5 to; Otherwise forward f5 to;
E5) the IP bag is designated " experiment bed packet " and " wireless transmission ", source address modification is this machine radio network interface IP, destination address is revised as the destination address corresponding wireless network interface IP in application-interface map list in the initial IP packet header, forwards g5 then to;
F5) the IP bag is designated " experiment bed packet ", source address modification is this machine wired network interface IP, and destination address is revised as the wired network interface IP of source address correspondence in application-interface map list in the initial IP packet header;
G5) give the protocol stack lower-layer protocols with the IP bag.
When the experiment node received packet, the treatment step before Routing Protocol was:
A6) IP that obtains to receive from network protocol stack lower floor wraps;
B6) if the IP bag is not marked as " experimental data bag ", then this IP bag directly is sent to the protocol stack upper-layer protocol, to its finishing scheduling, otherwise continue;
C6) if the IP bag is not marked as " wireless transmission ", then find the destination address in the initial IP packet header, then the destination address in IP packet header is made as the destination address corresponding wireless network interface IP in application-interface map list in the initial IP packet header, the source address in IP packet header is made as this machine radio network interface IP, and after IP bag is labeled as " wireless transmission ", the IP bag is delivered to the protocol stack upper strata, finishes, otherwise continue;
D6) this moment, the IP bag was marked as " wireless transmission ".If the corresponding wired network interface IP in application-interface map list of the destination address in the initial IP packet header belongs to this machine, then cover outside packet header with the inner initial IP packet header that keeps, after recomputating the check value of entire I P bag, it is delivered to the protocol stack upper strata; Otherwise, IP packet header destination address is made as destination address in the initial IP packet header corresponding wired network interface IP in application-interface map list, the source address in IP packet header is made as the wired networking of this machine interface IP, be delivered to the protocol stack upper strata.
When the experiment node received packet, the treatment step behind Routing Protocol was:
A7) obtain to wrap through the IP of Routing Protocol processing;
B7) if IP bag source address is a virtual address, then forward c7 to; Otherwise forward d7 to;
C7) compressed IP packet is removed the space of reserving in the b4 step;
D7) give the protocol stack upper-layer protocol with the IP bag.
The present invention has following technique effect: exist in the radiofrequency signal decay control method impliedly to require the defective that remained unchanged by simulation node and simulation node mapping relations, make the flexibility deficiency of this emulation mode to node motion emulation, can't satisfy the demand of customization experiment scene, its basic reason is that this machine wave point transceive data is used in the application that operates on the experiment node.Application-interface isolation technics that the present invention proposes makes is fixed by simulation node and experiment node mapping relations, but it is variable by simulation node and wave point mapping relations, when guaranteeing to use continuous service, solved the defective of radiofrequency signal decay control method, promoted flexibility, made mobile ad-hoc network can allow the customization experiment scene based on radiofrequency signal decay control to node motion emulation.When using the present invention to carry out the mobile ad-hoc network emulation experiment, use node mapping relations according to initial sampling instant and be deployed on the different radio node in the emulation platform, kept the characteristics of application distribution operation in the mobile ad-hoc network; Adopt radiofrequency signal decay control method, both guaranteed transmission of radio links characteristic Simulation validity preferably, reduced lower deployment cost again; And adopt application-interface isolation technics, also guaranteed node motion validity of simulation preferably.
Description of drawings
Fig. 1 is the emulation platform hardware architecture schematic diagram of mobile ad-hoc network of the present invention;
Fig. 2 is a Control Node software architecture schematic diagram in the emulation platform of the present invention;
Fig. 3 is an experiment node software architectural schematic in the emulation platform of the present invention;
Fig. 4 is a radiofrequency signal decay control schematic diagram of the present invention;
Fig. 5 is experiment node when packet is sent, the process chart before Routing Protocol;
Fig. 6 is experiment node when packet is sent, the process chart behind Routing Protocol;
Fig. 7 is experiment node when packet is received, the process chart before Routing Protocol;
Fig. 8 is experiment node when packet is received, the process chart behind Routing Protocol;
Fig. 9 is the schematic diagram of (SuSE) Linux OS Netfilter framework.
Embodiment
The present invention is described in detail below in conjunction with the drawings and specific embodiments.
Fig. 1 is the emulation platform hardware architecture that is used for simulating moving self organization network, and this platform is made up of a Control Node and some experiment nodes, and they link to each other by high speed switch.On each experiment node a radio network interface is housed, this network interface links to each other with external antenna by the SMA interface, between radio network interface and external antenna, insert the tunable radio frequency signal attenuator of two SMA interfaces, for example: the program control step attenuator of BOWEISZZ007.
Fig. 2 is a Control Node software architecture in the emulation platform." user interface " provides experiment that input interface is set to the user, after the mobile self-organization network scene time sampling of this module with customization, sends the static scene sequence after the sampling to " command interpreter "; The node mapping relations and the decay control parameter vector of each sampling instant static scene correspondence found the solution and exported to " command interpreter ", and the sampling instant that will be associated with this static scene, node mapping relations and decay parameter are together passed to " Rule Builder "; " Rule Builder " is according to the input from " command interpreter ", sampling instant is numbered, generate the rule of " sampling instant numbering, sampling instant sequence number " corresponding relation and " sampling instant sequence number, application mapping, interface mappings, decay parameter vector " form, need the sequence of rules that uses in whole rule formation emulation experiments of each sampling instant; " regular distributor " is distributed to all with this sequence of rules and tests nodes in the emulation set-up procedure, after emulation experiment starts, according to " sampling instant numbering, sampling instant sequence number " corresponding relation, adopt clock-driven method when each sampling instant arrives, send current sampling instant sequence number to each experiment node; " node state management " module is responsible for receiving the status report from the experiment node, generates nodal information by Rule Builder, is uploaded to " nodal information management " module.
Fig. 3 is an experiment node software architecture in the emulation platform, the operation (SuSE) Linux OS." regular receiver " receives from the sequence of rules of Control Node and last samples sequence number constantly, and passes to " rule-interpreter "; " rule-interpreter " transmits current decay value of consult volume according to sequence of rules and the current sampling instant sequence number received to " attenuator control " module, sends current application mapping and interface mappings rule to " configuration file generator "; " packet scheduler " reschedules the packet that mails to/receive from radio network interface and wired network interface according to configuration file (that is: current application mapping and interface mappings rule); " status report device " regularly tests the running status of node to " node state management " module report of Control Node.
Fig. 4 is a radiofrequency signal decay control schematic diagram.It in the frame of broken lines control circuit board that attenuator and peripheral circuit thereof are formed, corresponding with " adjustable attenuator " module among Fig. 1, realize in the frame it being the hardware and software module of testing on the node machine, wherein " attenuator control " is corresponding with " attenuator control " software module among Fig. 3, " wireless network card " is the radio network interface that is inserted on the experiment node machine, and the characteristics of this network interface are to link to each other with antenna by the SMA interface.Control circuit board is the USB interface power supply of node machine by experiment; Attenuator control module on the experiment node machine sends control data by serial ports to control circuit board, and the CPU on the control circuit board will convert the control data of may command SZZ007 attenuator from the control data on the experiment node machine to, thus control decay parameter.
In the emulation experiment set-up procedure, may further comprise the steps:
A) mobile self-organization network scene to customization carries out time sampling, produces mobile ad-hoc network static scene sequence;
The user constitutes the static scene sequence by the mobile self-organization network scene that " user interface " on Control Node customization emulation experiment needs;
B) parameter is controlled in the node mapping relations and the decay of finding the solution each static scene correspondence in the above-mentioned sequence;
" user interface " module sends the static scene sequence to " command interpreter ", " command interpreter " calculates the node mapping relations and the decay control parameter of each static scene correspondence, and the sampling instant that will be associated with this static scene, node mapping relations and decay parameter are together passed to " Rule Builder ";
" Rule Builder " is according to the input from " command interpreter ", sampling instant is numbered, generate the rule of " sampling instant numbering, sampling instant sequence number " corresponding relation and " sampling instant sequence number, application mapping, interface mappings, decay parameter vector " form, the whole rule of each sampling instant constitutes needs the sequence of rules that uses in the emulation experiments, concrete form is referring to the example in the f step;
" Rule Builder " passes to " regular distributor " with " sampling instant numbering, sampling instant sequence number " corresponding relation and " sampling instant sequence number, application mapping, interface mappings, decay parameter vector " sequence of rules;
C) simulation node mapping relations and the decay control parameter with each sampling instant is sent to whole experiment nodes;
" regular transmitter " is sent to " regular receiver " modules of all experiment nodes with " sampling instant sequence number, application mapping, interface mappings, decay parameter vector " sequence of rules.
After starting emulation experiment, may further comprise the steps:
D) each sampling instant, Control Node sends current sampling instant sequence number to each experiment node;
" regular distributor " foundation " sampling instant numbering, sampling instant sequence number " corresponding relation adopts clock-driven method when each sampling instant arrives, to the current sampling instant sequence number of " regular receiver module " transmission of each experiment node.
E) the experiment node is provided with this node decay control parameter according to current sampling instant sequence number;
" rule-interpreter " is according to current sampling instant sequence number, from " sampling instant sequence number, application mapping, interface mappings, decay parameter vector " sequence of rules, extract the decay control value of consult volume of this node of current time and send to " attenuator control " module, " attenuator control " module transmits control signal to the control circuit board shown in Fig. 4 dotted line, regulates the control parameter of SZZ007 attenuator;
F) the data packet dispatching module on the experiment node is dispatched according to current sampling instant node mapping relations application programs packet;
" rule-interpreter " is according to current sampling instant sequence number, extracting current time from " sampling instant sequence number, application mapping, interface mappings, decay parameter vector " sequence of rules uses mapping and interface mappings rule and sends to " configuration file generator ", " configuration file generator " generates application-interface map list, and " packet scheduler " reschedules the packet that mails to/receive from radio network interface and wired network interface according to current application-interface map list;
For example, sequence of rules shown in the following table with experiment bed system of three nodes.
The sampling instant sequence number Use mapping Interface mappings Decay parameter vector
1 123 123 Slightly
2 123 321 Slightly
It is illustrated in constantly 1, node 1,2 and 3 corresponding respectively be positioned at radio network interface on node 1,2 and 3; Arrived in the moment 2, node 2 still uses the radio network interface on the own node, and node 1 and 3 then uses the radio network interface transmission on the other side's machine mutually; Like this with regard to emulation No. 1 and No. 3 nodes intercoursed the such dynamic scene of physical location owing to moving.
When node receives that Control Node sends moment during sequence number 1, just generate application-interface map list as shown in the table.
Virtual network interface Radio network interface Wired network interface
192.168.0.1 192.168.1.1 192.168.2.1
192.168.0.2 192.168.1.2 192.168.2.2
192.168.0.3 192.168.1.3 192.168.2.3
Wherein, " virtual network interface " IP represents the employed IP of application program of user address, does not represent the network interface of a reality." radio network interface " and " wired network interface " represented respectively to use the application program of this virtual interface to carry out the employed wave point of data packet transceive in wireless network this moment, and the wireline interface on the node of application program place.Radio network interface that last part is identical in the IP address and wired network interface, for example 192.168.1.1 and 192.168.2.1, all be positioned on the same node, when node receives that Control Node sends moment during sequence number 2, the application-interface mappings on the node is as shown in the table:
Virtual network interface Radio network interface Wired network interface
192.168.0.1 192.168.1.3 192.168.2.1
192.168.0.2 192.168.1.2 192.168.2.2
192.168.0.3 192.168.1.1 192.168.2.3
G) in the whole simulation experimentation, steps d~f execution that circulates finishes until emulation experiment.
Before the algorithm in describing step f, need describe two key issues based on " packet scheduler " of (SuSE) Linux OS.
First problem is how the implementation of dispatching algorithm promptly is inserted into dispatching algorithm in the system.In the network protocol stack of (SuSE) Linux OS, realized the framework of Netfilter by name, allowed the several diverse locations of program in the flow process of network protocol stack handle packet of kernel state to insert Hook Function, so that packet is carried out specific processing.The hook relevant with this method mainly comprises following: NF_IP_LOCAL_OUT, expression packet are being sent out and without crossing the route protocol processes; NF_IP_POST_ROUTING, the expression packet is being sent out and is passing through the route protocol processes; NF_IP_PRE_ROUTING, expression packet are being received and without crossing the route protocol processes; NF_IP_LOCAL_IN, the expression packet is being received and is passing through the route protocol processes.Therefore, this method is embodied as module with dispatching algorithm, behind each hook place location registration process function, is inserted in the system kernel, so just can realize fine granularity control, such as before or after handling at routing program packet being made amendment and dispatching to packet transmission and receiving course.
Second problem is the compatibility issue of this scheduler module and existing ICP/IP protocol stack.The problem that needs to consider mainly comprises, IP package head format problem, and the IP fragmentation problem, or the like.At IP package head format problem, do not influence legacy data in order to make traffic control, following way is to use " tunnel " technology, whole former IP is sealed be contained in the new packet header, arrives behind the destination " opening " again; At the IP fragmentation problem, following way is, before the route layer program of network is to processing data packets (this moment, big packet was still without crossing burst), per 1456 bytes spaces of reserving 24 bytes for IP bag data division more, wherein 20 bytes are used for filling in new IP packet header behind the burst, 4 bytes are reserved for possible expansion later on, arrive the destination and also " close sheet " afterwards, the space of reserving are removed again.
Scheduling process is divided into the scheduling of the packet that needs are sent and to scheduling two parts of the packet received from network interface, its treatment step is described below respectively:
Send data packet dispatching:
Fa) before routing program is handled, the IP that is about to send from the acquisition of network protocol stack upper strata wraps;
Fb),, be the space of 24 bytes of data reservation of per 1456 bytes in the data division front then with the expansion of former IP bag if the source address of IP bag belongs to virtual ip address;
Fc) give lower-layer protocols with the IP bag;
Fd) obtaining to handle IP afterwards through Routing Protocol wraps;
Fe),, otherwise continue then to the finishing scheduling of this IP bag if source address is not a virtual ip address;
Ff) IP packet header is copied to the previous section in the space of reserving among the fb;
Fg) in application-interface map list, search the wave point address of source address correspondence.If this wave point address belongs to this machine address, then forward fh to; Otherwise forward fi to;
Fh) IP being wrapped protocol number in the outside packet header (being different from the IP packet header that copies to data division among the f) is revised as 144 (this is to select arbitrarily to the number of specific protocol from still unallocated, be used for showing that this bag belongs to " experiment bed packet ", promptly through encapsulation, contain inner IP packet header), destination address is revised as the radio address of former destination address correspondence, the TOS territory is made as 1 and (represents the transmission course that this IP bag has passed through wave point, promptly above-mentioned " through wireless transmission "), the dev member of the struct sk_buff structure that this IP bag is corresponding be made as the struct net_device structure of this machine wave point correspondence (by system function _ _ dev_get_by_name obtains); Calling system function ip_route_me_harder calculates the route of IP bag, and calling system function ip_send_check recomputates the check value of entire I P bag, forwards fj then to;
Fi) protocol number with outside packet header is revised as 144, and destination address is revised as the wireline interface of its source address correspondence, and the dev member of the struct sk_buff structure that this IP bag is corresponding is made as the struct net_device structure of this machine wireline interface correspondence; Calling system function ip_route_me_harder calculates the route of IP bag, and calling system function ip_send_check recomputates the check value of entire I P bag;
Fj) give the protocol stack lower-layer protocols with the IP bag.
In such scheme, step fa~fc as shown in Figure 5, step fd~fj is as shown in Figure 6.
In such scheme, the fb step is mounted to the NF_IP_LOCAL_OUT place of Netfilter as handling function, can when being called, it obtain IP packet to be sent required in the fa step automatically; The processing function of fb step returns NF_ACCEPT promptly can finish the c step.
In such scheme, fe~fi step is mounted to the NF_IP_POST_ROUTING hook place of Netfilter as handling function, can when being called, it obtain the packet that passes through the Routing Protocol processing required in the fd step automatically; This function returns NF_ACCEPT can finish the fj step.
In such scheme, the fb step comprises following steps:
Fb1) in application-interface map list, search the list item that virtual address equals this IP bag source address.If find, change fb2, otherwise change fc;
Fb2) deduct the length in IP packet header itself with the entire I P packet length that writes down in the IP packet header, obtain the length of data division.Then with this value divided by 1456 and multiply by 24, obtain the size of packets need expansion, if the division calculation remainder is non-vanishing, need in last result, add 24;
Fb3) use skb_copy_expand system function duplicates and expands former IP bag, and its parameter that indicates extend sizes is made as the result of calculation of fb2.Use the skb_put system function to increase the data division length of new IP bag, its parameter that indicates extend sizes also is made as the result of calculation of fb2;
Fb4) former IP packet header is copied to the head of new data packets; The data of former IP bag are copied to the correct position that new IP wraps, and fill with numeral 0 other positions;
Fb5) length that new IP bag is set is the result of calculation that former IP packet length adds fb2, uses the ip_send_check function to recomputate the IP packet header check value of new IP bag;
Fb6) replace former IP bag with the new IP bag that makes up, use the kfree_skb system function that former IP bag is discharged.
In such scheme, step fb4 comprises following steps:
Fb41) former IP packet header is copied to the head of new data packets;
Fb42) regard the data division of former IP bag as k part, except last part, other each parts are made up of 1456 continuous bytes, k data that partly comprise 1 byte between 1456 bytes.This k part copied to respectively the new IP bag with f (k) on the initial reposition from former IP bag.First byte of f (k) expression reposition is to the distance (byte number) of new first byte of IP bag data division, and its formula is f (k)=1460* (k-1)+20.After having duplicated a partial data, 20 bytes and 4 bytes afterwards in new IP bag before this part are filled with numerical value 0 at every turn.
Receive data packet dispatching:
Fk) before routing program is handled, obtain the packet of receiving from network protocol stack lower floor;
Fl), then this IP bag directly is sent to the protocol stack upper-layer protocol, to its finishing scheduling if the protocol number of IP bag is not 144.Otherwise continue;
Fm) if TOS territory, IP packet header is 0, then find the destination address in the inner packet header (protocol number 144 can guarantee the existence in inner packet header), then the destination address in outside packet header is made as the wave point address of this address correspondence, source address is made as this machine wave point address, the TOS territory is made as 1, the dev member of the structsk_buff structure that this IP bag is corresponding is made as the struct net_device structure of this machine wave point correspondence, calling system function ip_route_me_harder calculates the route of IP bag, and after recomputating the check value of entire I P bag, the IP bag is delivered to the protocol stack upper strata, finishes.Otherwise continue;
Fn) this moment, TOS territory, IP packet header was 1, found inner packet header destination address.If the wireline interface address of this address correspondence belongs to this machine, then cover outside packet header, and 24 byte spaces that inside is reserved be changed to 0 with inner packet header, recomputate the check value of entire I P bag after, it is delivered to the protocol stack upper strata; Otherwise, the external packets head's address is made as this wireline interface address, and source address is made as this machine wireline interface address, and calling system function ip_route_me_harder calculates the route of IP bag, and after recomputating the check value of entire I P bag, be delivered to the Routing Protocol on protocol stack upper strata;
Fo) obtain to wrap through the IP of Routing Protocol processing;
Fp) if IP bag source address is a virtual address, then forward fq to; Otherwise forward fr to;
Fq) compressed IP packet is removed the part of inner packet header and filling;
Fr) give the protocol stack upper-layer protocol with the IP bag, to the finishing scheduling of this IP bag.
In such scheme, step fk~fn as shown in Figure 7, step fo~fr is as shown in Figure 8.
In such scheme, fl~fn step is mounted to the NF_IP_PRE_ROUTING place of Netfilter as handling function, can when being called, it obtain IP packet to be sent required in the fk step automatically; This processing function returns NF_ACCEPT promptly can finish " being delivered to the protocol stack upper strata " operation, returns NF_DROP and can finish " abandoning this packet " operation.
In such scheme, fp and fq step are mounted to the NF_IP_LOCAL_IN place of Netfilter as handling function, can when being called, it obtain the packet that passes through the Routing Protocol processing required in the fo step automatically; This function returns NF_ACCEPT can finish the fr step.
In such scheme, the fq step comprises following steps:
Fq1) deduct the length in IP packet header itself with the entire I P packet length that writes down in the IP packet header, obtain the length of data division.Be worth divided by 1480 with this then, obtain the burst number,, number need be added 1 if the division calculation remainder is non-vanishing;
Fq2) use the skb_copy_expand system function to duplicate former IP bag;
Fq3) data with former IP bag copy to the correct position that new IP wraps;
Fq4) using system function skb_trim is provided with some pointer of the struct sk_buff structure of new IP bag, its second parameter be taken as former IP packet length deduct 24 with the product of burst number;
Fq5) total length in the IP head is made as the length (be mention among the q4 second parameter) of new IP bag, uses the ip_send_check function to recomputate the IP packet header check value of new IP bag;
Fq6) replace former IP bag with the new IP bag that makes up, use the kfree_skb system function that former IP bag is discharged.
In such scheme, fq3 is divided into following steps:
Fq31) regard the data division of former IP bag as k part, the burst number that k equals to obtain among the q1.Except last part, other each parts are made up of 1460 continuous bytes, k data of comprising of part 1 byte between 1460 bytes.
Fq32) this k part copied to respectively the new IP bag with f (k) on the initial reposition from former IP bag.First byte of f (k) expression reposition is to the distance (byte number) of new first byte of IP bag data division, and its formula is f (k)=1456* (k-1)+20.
In sum, the invention discloses a kind of method of simulating moving self organization network.Above-described application scenarios and embodiment are not to be used to limit the present invention, and any those skilled in the art without departing from the spirit and scope of the present invention, can do various changes and retouching, so protection scope of the present invention is looked the claim scope and defined.

Claims (7)

1, a kind of method of simulating moving self organization network comprises:
A1) emulation platform is made up of a Control Node and several experiment nodes, APD to be tested is deployed on each experiment node, described Control Node links to each other by high speed switch with described experiment node, on each experiment node a wireless network card and a wired network adapter are housed, wireless network card links to each other with external antenna, inserts the tunable radio frequency signal attenuator between wireless network card and external antenna;
B1) in the emulation experiment set-up procedure, for each experiment node is specified a virtual ip address, use for application program to be tested, mobile self-organization network scene to customization on described Control Node carries out time sampling, produce mobile ad-hoc network static scene sequence, and the parameter vector is controlled in the node mapping relations and the decay of calculating each static scene correspondence in the above-mentioned sequence, the simulation node mapping relations and the decay control parameter vector of each sampling instant are sent to whole experiment nodes, wherein the simulation node mapping relations show as virtual ip address and the corresponding relation of testing node, that is: virtual ip address and corresponding corresponding relation of testing node radio network interface IP address and wired network interface IP address are stored in application-interface map list;
C1) after the startup emulation experiment, each sampling instant, described Control Node sends current sampling instant sequence number to each experiment node, described experiment node is provided with this node decay control parameter according to current sampling instant sequence number, and dispatches according to the IP packet of current sampling instant node mapping relations application programs.
2, the method for simulating moving self organization network as claimed in claim 1 is characterized in that: further comprise after the described step c1:
When a2) the I P packet of experiment node application programs sends, in the IP bag, keep the initial IP packet header;
B2) if the source address in the initial IP packet header is a virtual address, and this address corresponding wireless network interface IP in application-interface map list belongs to this machine, then IP bag is labeled as " an experiment bed packet " and " wireless transmission ", it is forwarded to destination address corresponding wireless network interface in application-interface map list in the initial IP packet header by radio network interface;
C2) if the source address in the initial IP packet header is a virtual address, and this address corresponding wireless network interface IP in application-interface map list does not belong to this machine, after then the IP bag being labeled as " experiment bed packet ", it is forwarded to the wired network interface of the source address correspondence in application-interface map list in the initial IP packet header by wired network interface.
3, the method for simulating moving self organization network as claimed in claim 2 is characterized in that: further comprise after the described step c1:
A3) described experiment node receives in the IP packet header IP packet that is labeled as " experiment bed packet ";
B3) if the IP bag is not marked as " wireless transmission ", then this IP is wrapped the destination address corresponding wireless network interface in application-interface map list that is sent in the initial IP packet header by radio network interface;
C3) if IP bag is marked as " wireless transmission ", and the corresponding wired network interface IP in applications-interface map list of the destination address in the initial IP packet header belongs to this machine, then recover initial IP packet header after, IP wrapped is delivered to the protocol stack upper strata; If the IP bag is marked as " wireless transmission ", and the corresponding wired network interface IP in application-interface map list of the destination address in the initial IP packet header does not belong to this machine, then by wired network interface it is sent to the wired network interface of the destination address correspondence in application-interface map list in the initial IP packet header.
4, the method for simulating moving self organization network as claimed in claim 2 is characterized in that: when described experiment node sent the IP packet, the treatment step before Routing Protocol is handled was:
A4) the IP bag that is about to send from the acquisition of network protocol stack upper strata;
B4) if the source address of IP bag belongs to virtual ip address, then with the expansion of former IP bag, headspace;
C4) give lower-layer protocols with the IP bag.
5, the method for simulating moving self organization network as claimed in claim 4 is characterized in that: when the experiment node sent the IP packet, the treatment step after Routing Protocol is handled was:
A5) obtaining to handle IP afterwards through Routing Protocol wraps;
B5),, otherwise continue then to the finishing scheduling of this IP bag if source address is not a virtual ip address;
C5) IP packet header is copied to the space of having reserved;
D5) if IP bag source address corresponding wireless network interface IP in application-interface map list belongs to this machine, then forward e5 to; Otherwise forward f5 to;
E5) the IP bag is designated " experiment bed packet " and " wireless transmission ", source address modification is this machine radio network interface IP, and the destination address that destination address is revised as in the initial IP packet header is being used
Corresponding wireless network interface IP forwards g5 then in-the interface map list;
F5) the IP bag is designated " experiment bed packet ", source address modification is this machine wired network interface IP, and destination address is revised as the wired network interface IP of source address correspondence in application-interface map list in the initial IP packet header;
G5) give the protocol stack lower-layer protocols with the IP bag.
6, the method for simulating moving self organization network as claimed in claim 3 is characterized in that: when the experiment node received the IP packet, the treatment step before Routing Protocol is handled was:
A6) IP that obtains to receive from network protocol stack lower floor wraps;
B6) if the IP bag is not marked as " experimental data bag ", then this IP bag directly is sent to the protocol stack upper-layer protocol, to its finishing scheduling, otherwise continue;
C6) if the IP bag is not marked as " wireless transmission ", then find the destination address in the initial IP packet header, then the destination address in IP packet header is made as the destination address corresponding wireless network interface IP in application-interface map list in the initial IP packet header, the source address in IP packet header is made as this machine radio network interface IP, and after IP bag is labeled as " wireless transmission ", the IP bag is delivered to the protocol stack upper strata, finishes, otherwise continue;
D6) this moment, the IP bag was marked as " wireless transmission ", if the corresponding wired network interface IP in application-interface map list of the destination address in the initial IP packet header belongs to this machine, then cover outside packet header with the inner initial IP packet header that keeps, after recomputating the check value of entire I P bag, it is delivered to the protocol stack upper strata; Otherwise, IP packet header destination address is made as destination address in the initial IP packet header corresponding wired network interface IP in application-interface map list, the source address in IP packet header is made as the wired networking of this machine interface IP, be delivered to the protocol stack upper strata.
7, the method for simulating moving self organization network as claimed in claim 6 is characterized in that: when the experiment node received the IP packet, the treatment step after Routing Protocol is handled was:
A7) obtain to wrap through the IP of Routing Protocol processing;
B7) if IP bag source address is a virtual address, then forward c7 to; Otherwise forward d7 to;
C7) compressed IP packet is removed the space of reserving in the b4 step;
D7) give the protocol stack upper-layer protocol with the IP bag.
CN200710099382A 2007-05-18 2007-05-18 Simulating moving self organization network method Expired - Fee Related CN100594688C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200710099382A CN100594688C (en) 2007-05-18 2007-05-18 Simulating moving self organization network method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200710099382A CN100594688C (en) 2007-05-18 2007-05-18 Simulating moving self organization network method

Publications (2)

Publication Number Publication Date
CN101051874A CN101051874A (en) 2007-10-10
CN100594688C true CN100594688C (en) 2010-03-17

Family

ID=38783091

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200710099382A Expired - Fee Related CN100594688C (en) 2007-05-18 2007-05-18 Simulating moving self organization network method

Country Status (1)

Country Link
CN (1) CN100594688C (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183999B (en) * 2007-10-31 2011-03-23 北京航空航天大学 Mobile self-organization network scene constructing method using game data
US8255469B2 (en) 2009-05-29 2012-08-28 Nokia Corporation Method and apparatus for locating communities over an ad-hoc mesh network
CN101917737B (en) * 2010-08-25 2014-04-09 北京交通大学 Simulation frame of wireless self-organized network
CN103297152B (en) * 2012-02-23 2016-12-21 中兴通讯股份有限公司 The calibrating method of a kind of hard emulator and device
CN102957585B (en) * 2012-12-03 2016-08-31 惠州Tcl移动通信有限公司 The data transmission method of a kind of Ethernet and data transmission device
CN104735820B (en) * 2015-04-07 2018-01-05 无锡职业技术学院 Checking system on the spot based on sensor self-organized algorithm
CN104849524A (en) * 2015-05-19 2015-08-19 重庆大学 Data acquisition system orienting high-power pulse signal and method thereof
CN105721087B (en) * 2016-03-21 2019-01-04 北京交通大学 Theoretical non line of sight class is schemed away from the channel modeling method under tunnel environment based on propagating
CN110266548A (en) * 2019-07-02 2019-09-20 国网上海市电力公司 A kind of constructing communication network simulation detection system
CN113268436B (en) * 2021-07-21 2021-10-08 航天中认软件测评科技(北京)有限责任公司 Multi-granularity computer simulation operation information acquisition method based on hook points

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6922395B1 (en) * 2000-07-25 2005-07-26 Bbnt Solutions Llc System and method for testing protocols for ad hoc networks
CN1719792A (en) * 2005-05-30 2006-01-11 中国人民解放军理工大学 Wireless communication simulator and simulating method for TDMA Ad hoc network

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6922395B1 (en) * 2000-07-25 2005-07-26 Bbnt Solutions Llc System and method for testing protocols for ad hoc networks
CN1719792A (en) * 2005-05-30 2006-01-11 中国人民解放军理工大学 Wireless communication simulator and simulating method for TDMA Ad hoc network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种分级无线自组织网络的模拟系统功能设计. 张帆,马立香,毛建兵.2006中国西部青年通信学术会议论文集. 2006
一种分级无线自组织网络的模拟系统功能设计. 张帆,马立香,毛建兵.2006中国西部青年通信学术会议论文集. 2006 *

Also Published As

Publication number Publication date
CN101051874A (en) 2007-10-10

Similar Documents

Publication Publication Date Title
CN100594688C (en) Simulating moving self organization network method
CN101827396B (en) Multi-net cooperative transmission resource distribution system in heterogeneous wireless environment and method
CN105634902A (en) Hardware In The Loop simulation system and communication method therefor
CN112327667B (en) Semi-physical simulation element design method for large-scale unmanned cluster network
CN104796227B (en) A kind of data transmission method and equipment
CN105591955A (en) Message transmission method and device
CN109756430A (en) A kind of processing method and processing device of rule
CN102291745A (en) Method and device for testing multiple access points (AP)
CN104582008B (en) A kind of method for building up of Android phone self-organization network system
CN105530654A (en) Ad hoc network communication device testing method and system
CN102595463A (en) Wireless environment simulation method
CN105530038A (en) Relay device, relay server or relay method
CN103001883B (en) Internal communication method of programmable virtual router based on Net field programmable gate array (FPGA)
CN105337833A (en) Multi-hop wireless network topology simulation system for supporting heterogeneous multi-channel
CN102083137B (en) Method, system and device for transmitting data
CN101588272A (en) Movable self-organization network test platform and method thereof
CN103813350B (en) Agricultural internet of things cloud communication system performance simulation platform
CN106793013A (en) Wireless access system and its exchange method based on L2TP
CN107483284A (en) The method of testing and device of the network equipment
CN113378364B (en) Joint simulation method for wireless network control system
CN103763676B (en) Communication means and equipment between AP and AC
JP5285461B2 (en) Wireless network structure
CN103686725B (en) User data management, equipment and system
CN108234353B (en) Wireless forwarding method, main access point and forwarding access point
CN101355461B (en) Self-adapting measuring apparatus and self-adapting measuring method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100317

Termination date: 20120518