The data communication interface method of testing
Technical field
The present invention relates generally to network communication field, relates in particular to interface testing technology in the network communication protocol.
Background technology
In the network communicating system, communication interface generally has the branch of lan interfaces and Wide Area Network interface, and the difference between them is: one is the interfacing of utilizing physical layer, and another one is to utilize link layer protocol.Lan interfaces generally is multi-multipoint, forms based on ether physical layer transceiver technology and Ethernet protocol group.Wide Area Network interface generally is point-to-point or point-to-multipoint, based on wide area network physics transmit-receive technology and the wide area network link layer protocol form.Network internal generally is to adopt local area network (LAN) at present, connects between net generally to be to use wide area network.Because the point-to-point and point-to-multipoint of wide area network, and the functional characteristics of some wan protocols, on LAN protocol, carry the usage of wan protocol at present, most typical is exactly PPPOE, but just transmitting on local area ethernet at link layer protocol PPP, it designs, also have other wan protocol such as frame relay, X.25 wait and on local area ethernet, to transmit.But for the test of some complexity, the link layer protocol that needs any wide area network on the one hand can be transmitted on Ethernet, requires to have the equipment and the integrated circuit board of a large amount of lan interfaces on the other hand.For example in the development﹠ testing process of current router, may run into and to build a large-scale interconnection environment that more than 100 Wide Area Network interface arranged.We are example to build L2TP large test environment, in order to simulate 1500 L2TP access clients' large-scale access environment, if we use real physics integrated circuit board to build, promptly use the most frequently used maximum CE1 interface card of number of ports at present, a CE1 interface can be created 32 physics Wide Area Network interface, suppose maximum 4 the physical slot positions of router, 1 4CE1 interface card can be inserted in a groove position, such router just can have 16 * 32=512 interface, an interface can be simulated a L2TP and be inserted the user, in order to reach 1500 user's access amounts, must do access device with 3 routers, 3 routers are made subscriber equipment, and they all need insert 4 4CE1.Also need 1 in addition and do the L2TP access server side.The environment of building this maximum number of interface needs 7 routers, and 24 4CE1 cards are connected with corresponding a lot of cable.As Fig. 1.
In general, test development for a lot of link layers and upper layer module thereof on the router, do not need to be concerned about what real physical interface type is, the data that the developer only needs characteristic that Wide Area Network interface has Wide Area Network interface, transmit above are that the encapsulation of wide area network link protocol gets final product, at this moment for building an environment, but will spend a large amount of time removes preparation machine, integrated circuit board and stube cable, and carry out physical connection and configuration, consume the manpower time cost virtually, also taken a large amount of exploiting natural resources simultaneously.
Summary of the invention
The technical problem to be solved in the present invention is: solve in the prior art, build complicated development and testing environment and need waste a large amount of manpower time costs, and take a large amount of exploitative shortcomings, a kind of method that can create the virtual MAN interface that can carry wan protocol on the basis of LAN protocol is proposed.
The technical scheme that the present invention solve the technical problem employing provides a kind of data communication interface method of testing, may further comprise the steps:
A, the data frame structure of the online transmission of local is done expansion, form the virtual MAN interface frame, construct corresponding Wide Area Network interface control structure simultaneously;
B, according to the frame format of virtual MAN interface frame, it is received or sends processing.
Further, described reception may further comprise the steps:
Frame is judged, if the virtual MAN interface frame then hands over virtual wide area interface Drive Layer to handle; If normal Ether frame then hands over the Ethernet link layer to handle.
Further, the structure of the virtual MAN interface frame among the described step a comprises: the Ether frame form of standard; The virtual MAN protocol header that on ether frame head basis, expands; The wide area network link frame head of standard; Standard wide area network link data content comprises the application layer message that occupy application layer, occupy the transport layer message of transport layer, occupy IP and other data messages of IP network layer, other wide area network data contents.
Further, comprise in the form of the virtual MAN interface frame among the described step a:
Target MAC (Media Access Control) address, source MAC, slot number, version number, protocol number, interface number, frame length and wide area network isl frame.
The invention has the beneficial effects as follows, utilize the virtual MAN interface to substitute actual physics Wide Area Network interface environment required in the development and testing process, thereby make things convenient for development﹠ testing, save development time and testing time, reduce the resource occupation of integrated circuit board and cable simultaneously.Also because the virtual MAN interface is based upon on the Basic Ethernet, Ethernet has characteristics at a high speed, therefore the present invention goes back even can finish the task that some actual physics environment are not accomplished or are difficult to accomplish, as the high-speed wan link test, large-scale access service test, situations such as the route upheaval test of big interface quantity.
The present invention is further illustrated below in conjunction with the drawings and specific embodiments.
Description of drawings
Fig. 1: 1500 L2TP that build with the actual physical integrated circuit board insert users' environment; The equipment that wherein is labeled as A is the subscriber equipment with 4 4C1; The equipment that is labeled as B is the L2TP access device with 4 4CE1;
Fig. 2: ethernet layer hierarchical structure chart; Wherein a is an Ethernet system layer aggregated(particle) structure; B is the frame format of each layer of Ethernet system correspondence;
Fig. 3: virtual MAN interface layer hierarchical structure chart of the present invention; Wherein a is a virtual MAN system layer aggregated(particle) structure; B is the frame format of each layer of virtual MAN correspondence;
Fig. 4: virtual MAN frame assumption diagram of the present invention; Wherein a is an ethernet frame format; B is a virtual MAN interface frame form;
Fig. 5: the standard Wide Area Network interface of virtual MAN interface configuration sample and generation;
Fig. 6: use the present invention to create the virtual MAN interface and build large-scale access environment shown in Figure 1;
Fig. 7: the ether of band virtual MAN interface of the present invention receives to be handled;
Fig. 8: the ether of band virtual MAN interface of the present invention sends to be handled.
Embodiment
The present invention proposes a kind of method that can create the virtual MAN interface that can carry wan protocol on the basis of LAN protocol, the virtual MAN interface of Chuan Jianing in this way, the above agreement of link layer all can be used as real Wide Area Network interface to it and treat, and mainly comprises the steps:
1, constructs the control structure of each virtual MAN interface;
2, according to transmission, the receiving course of constructed frame structure constructing virtual Wide Area Network interface;
3, revise normal ether and receive flow process, hand over virtual wide area interface Drive Layer to handle the virtual MAN interface frame, hand over the Ethernet link layer to handle normal Ether frame;
4, the frame with the virtual MAN interface sends, and hands over the virtual MAN interface to drive and sends, and the virtual MAN interface drives and is articulated to transmission place that Ethernet drives again.
Finishing the controlled function of virtual MAN, mainly is keep-alive, the function of surveying the opposite end existence; Utilize configuration to finish the building work of virtual MAN interface, this configuration also can be used as script and is recorded in the startup script.
More specifically, the system of the general TCP/IP data communication system formation that is of five storeys, physical layer, interface Drive Layer, link layer, network layer (IP layer), transport layer (TCP layer), application layer, the hierarchical structure of Dui Ying ethernet local area network such as Fig. 2 with it.
The present invention revises its link layer based on the hierarchical structure of Ethernet, but does not influence normal ethernet communication, and the interface Drive Layer of establishment virtual MAN interface realizes the virtual MAN interface.The present invention has created standard set Wide Area Network interface data structure and has handled the virtual MAN interface frame for each virtual MAN interface, and the interface structure of standard is consistent in this sets of data structure and the communication system; With the driven management data structure that a virtual MAN interface is arranged of standard Wide Area Network interface data structure correspondence, form the interface Drive Layer of virtual MAN interface.Amended virtual MAN interface layer aggregated(particle) structure such as Fig. 3.
The present invention constructs a kind of frame format of virtual MAN interface on the basis of Ethernet protocol frame format, it is corresponding which virtual MAN interface that this frame format can be distinguished the notebook data frame.The main field of virtual MAN frame head has slot number, version number, and protocol number, interface number, frame length, wherein slot number is that a configurable radix adds that slot number constitutes virtual MAN interface frame form such as Fig. 4 of structure.
Functional description for each layer among Fig. 3 is as follows: ether driving interface layer mainly is that the phy chip of Ethernet is done the driving function, receives Ether frame from Ethernet, and the virtual MAN interface frame is sent on the Ethernet; The Ether frame here comprises virtual MAN Ether frame and standard Ether frame, if the virtual MAN Ether frame then hands over virtual MAN driving interface layer to handle, if normal ethernet frame then hands over the Ethernet link layer to handle; Each field of virtual MAN interface Drive Layer identification virtual MAN frame head, telling this frame is which the virtual MAN interface that belongs to which groove position, this frame is the frame type of what virtual MAN, if Frame, then peeling off the wide area network link layer of sending to corresponding virtual MAN interface behind the virtual MAN frame head goes to handle, if the control message is then directly handled in virtual MAN interface Drive Layer, as the keepalive feature of virtual MAN interface; It is exactly the wide area network link layer process process of standard that virtual MAN interface link layer is handled; IP layer, transport layer and application layer also all are the processing procedures of standard, and they can not make because of the present invention and how to revise, and think that directly the virtual MAN interface is exactly the Wide Area Network interface of a standard.As shown in Figure 5, behind the configuration virtual wide area network, two standard wide area network pos interfaces of generation.
Because the present invention discloses concrete frame structure, those of ordinary skill can be implemented according to content disclosed by the invention, so the concrete steps for above variety of processes no longer are described in detail in detail.
Also because the virtual MAN interface is based upon on the Basic Ethernet, Ethernet has characteristics at a high speed, therefore the present invention goes back even can finish the task that some actual physics environment are not accomplished or are difficult to accomplish, as the high-speed wan link test, large-scale access service test, situations such as the route upheaval test of big interface quantity.If use the present invention to create the virtual MAN interface, build large-scale access environment as shown in Figure 1, then as shown in Figure 6, only need 3 routers, 4 Ethernet interfaces get final product, and are just very simple.