CN100370788C - Method for realizing data communication utilizing virtual network adapting card in network environment simulating - Google Patents

Method for realizing data communication utilizing virtual network adapting card in network environment simulating Download PDF

Info

Publication number
CN100370788C
CN100370788C CNB2005100963823A CN200510096382A CN100370788C CN 100370788 C CN100370788 C CN 100370788C CN B2005100963823 A CNB2005100963823 A CN B2005100963823A CN 200510096382 A CN200510096382 A CN 200510096382A CN 100370788 C CN100370788 C CN 100370788C
Authority
CN
China
Prior art keywords
data
microsoft loopback
loopback adapter
packet
virtual concentrator
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
CNB2005100963823A
Other languages
Chinese (zh)
Other versions
CN1777142A (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.)
Xidian University
Original Assignee
Xidian 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 Xidian University filed Critical Xidian University
Priority to CNB2005100963823A priority Critical patent/CN100370788C/en
Publication of CN1777142A publication Critical patent/CN1777142A/en
Application granted granted Critical
Publication of CN100370788C publication Critical patent/CN100370788C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention discloses a method for realizing data communication by utilizing virtual network cards in simulating a network environment, which belongs to the technical field of simulating the computer network environment and aims to solve the problem of data transmission at a bottom layer in the network environment simulation according to the problems in the prior art. Firstly, the virtual network cards and a virtual hub are designed, and the virtual hub is connected with the virtual network cards for carrying out the data communication between the virtual network cards according to data communication rules. The procedure comprises: data packets are packaged; data is added to a sending data buffer area of virtual network cards of a sending party; the virtual network cards of a sending party send data packages to the virtual hub which receives the data packages and sends the data packages to virtual network cards of a receiving party; the virtual network cards of a receiving party add the data packages into the sending data buffer area, unpack the received data packages, and restore Ethernet frames and a user's data. The present invention can be used for the analog simulation of data relay at a bottom layer, and the analog simulation of the network environment in the field of computer networks and network security.

Description

In network environment simulating, adopt Microsoft Loopback Adapter to realize the method for data communication
Technical field
The present invention relates to the computer network environment simulation technical field, specifically a kind of Microsoft Loopback Adapter that adopts in network environment simulating is realized the method for data communication, and it can be applied to the bottom data of computer network and network safety filed and transmit analog simulation and network environment analog simulation.
Background technology
Existing physical network card (Network Interface Card is called for short NIC) also claims network adapter, is the interconnective interface of main frame and network.No matter be normal hosts or server,, just need to install a network interface card as long as be connected to local area network (LAN).If necessary, an equipment also can dispose the polylith network interface card simultaneously.When carrying out mutual communication, be to transmit between the main frame or the network equipment in the mode of frame at bottom.Function of network card mainly contains two: the one, and be frame with the data encapsulation in the main frame and the network equipment, and data are sent to network get on; The 2nd, receive the frame that network is uploaded, and frame is reassembled into data, send in place main frame and the equipment.Network interface card receives all signals in transmission over networks, but only accepts to send to the frame and the broadcast frame of this main process equipment, and remaining frame is abandoned, and further processing is done by the system of being sent to then.When main frame sent data, network interface card waited for that the suitable time is inserted into grouping in the data flow.Whether receiving system notice main frame message intactly arrives, if problem will require the other side to resend.Every network interface card all has unique ID number in world, also is called MAC (Media Access Control) address.MAC Address is used for the identity at network sign main frame, realizes communication and information exchange between the different main frames in the network.
In a lot of applied environments, needing real network interface card is carried out software simulation, realizing true function of network card, be called virtual network card technology with the method for software.Existing virtual network card technology mainly contains three classes: the Microsoft Loopback Adapter in the Microsoft Loopback Adapter in the network simulation software, functional software Microsoft Loopback Adapter and the virtual network device.
Microsoft Loopback Adapter in the network simulation software mainly is meant the network bottom layer tcp data segment in network simulation instrument such as these type of software systems such as OPNET, NS2, but this part is not a Microsoft Loopback Adapter equipment independently, they are transmission of carrying out emulated data with the method for software between two nodes that connected, these transfer of data are transparent to the user, but the user can be provided with the association attributes of data according to the needs of emulation.
The functional software Microsoft Loopback Adapter mainly is independent operating software module on some main frames, for example freeware SoftEther (Microsoft Loopback Adapter).It mainly is the job order of simulation Ethernet card, simulation hub (HUB) function tunnel characteristic, realize the VPN(Virtual Private Network) function, nothing serious fully is identified as a network interface card this software to make system, like this by connecting and configuration just can some machine that public network (Internet) is interior couple together and is used as Intranet (LAN) and uses.
Microsoft Loopback Adapter in the virtual network device mainly is meant the network interface card of simulating in order to transmit the needs of data at device interior in some personal communication systems, and this method generally is that simulation polylith network interface card is used for improving the speed of transfer of data between device interior and the equipment and the efficient of transfer of data etc. in the certain module of communication equipment.
Virtual network card technology weak point in the network simulation software is that its Microsoft Loopback Adapter and data communications method thereof are transparent to the user, relies on particular environment, and autgmentability is poor.The weak point of functional software virtual network card technology is that it can only be applied in the unit, the usefulness of carrying out network environment simulating that can not be pure.The weak point of the virtual network card technology in the virtual network device is that it relies on hardware device, and is open poor.
Summary of the invention
The objective of the invention is at the deficiencies in the prior art, provide a kind of Microsoft Loopback Adapter that in network environment simulating, adopts to realize the method for data communication, solve the bottom data transmission problem in the network environment simulating, be applied in the network environment simulating, do not rely on specific hardware environment, autgmentability, open good.
Technical scheme of the present invention is: in the single computer environment, at first design Microsoft Loopback Adapter and virtual concentrator, the major function of Microsoft Loopback Adapter is transmission, reception and data cached, with virtual concentrator they are connected, be implemented in data communication between the Microsoft Loopback Adapter in the network environment simulating according to the rule of data communication, the step of this method comprises:
(1) design Microsoft Loopback Adapter and virtual concentrator;
(2) carry out the encapsulation of packet;
(3) data are joined the transmit leg Microsoft Loopback Adapter and send the data buffer zone;
(4) the transmit leg Microsoft Loopback Adapter sends packet to virtual concentrator;
(5) virtual concentrator receives packet;
(6) virtual concentrator sends packet to recipient's Microsoft Loopback Adapter;
(7) recipient's Microsoft Loopback Adapter adds reception data buffer with packet;
(8) packet that receives is sealed off reduction Ether frame and user data.
The above-mentioned Microsoft Loopback Adapter that adopts in network environment simulating is realized the method for data communication, the Microsoft Loopback Adapter of said design comprises first group of data record and first group of funcall interface, the essential information of first group of data record essential record Microsoft Loopback Adapter comprises Microsoft Loopback Adapter title, MAC Address, IP address, subnet mask, gateway, promiscuous mode sign, reception data buffer, transmission data buffer zone, accepting state sign, transmit status sign.First group of funcall interface offers the external world, is responsible for the master data record of Microsoft Loopback Adapter is operated and revised.First group of funcall interface has: obtain the network interface card name, obtain and be provided with MAC Address, obtain and be provided with the IP address, obtain and be provided with gateway, obtain and be provided with the network interface card promiscuous mode, obtain and be provided with subnet mask.The virtual concentrator of said design is the bridge of communicating by letter between the Microsoft Loopback Adapter, when carrying out data communication, will link together by virtual concentrator between the Microsoft Loopback Adapter.Virtual concentrator comprises second group of data record and two parts of second group of funcall interface.Second group of data record has: the title of hub, port number, data buffer zone, mutual exclusion lock, network interface card record are tabulated, have been connected the network interface card number, send packet network interface card sign.Second group of funcall interface has: obtain the hub title, obtain port number, obtain and connect network interface card number, interpolation and deletion registration network interface card.
The above-mentioned Microsoft Loopback Adapter that adopts in network environment simulating is realized the method for data communication, the said encapsulation of carrying out packet, user data or application data are encapsulated as Ether frame, the process that again Ether frame is encapsulated as the packet of Microsoft Loopback Adapter and virtual hub handles is: user data is encapsulated as the standard that Ether frame is followed ICP/IP protocol on the Ethernet, the relevant protocol data of user data according to TCP/IP protocol suite encapsulated, and these main protocol types have IP, TCP, UDP, ICMP, IGMP, ARP and RARP protocol data bag.Application data is encapsulated as the inferior data of protocal layers, and finally is encapsulated as Ether frame, and its encapsulation is Ether frame encapsulation IP data or ICMP data or IGMP data in proper order; IP data encapsulation tcp data or UDP message; Tcp data and UDP message encapsulated user data.
The above-mentioned Microsoft Loopback Adapter that adopts in network environment simulating is realized the method for data communication, saidly data are joined the transmit leg Microsoft Loopback Adapter send the data buffer zone, its process is: give the transmit leg Microsoft Loopback Adapter and send after packet is ready to, check that at first the data of Microsoft Loopback Adapter send the state of buffering area, memory space and its state are arranged for idle if send buffering area, then ready data are added the transmission buffering area.If the transmission buffering area of Microsoft Loopback Adapter is full or its state is busy, then wait for up to sending that buffering area has living space and till its state free time.
The above-mentioned Microsoft Loopback Adapter that adopts in network environment simulating is realized the method for data communication, said transmit leg Microsoft Loopback Adapter transmission packet to the process of virtual concentrator is: Microsoft Loopback Adapter sends the form that data are taken the initiative and sent to virtual concentrator, be that the interior daemon thread of Microsoft Loopback Adapter constantly detects the transmission buffering area, in case find to have data just to read these data immediately and attempting sending to virtual concentrator.In addition, Microsoft Loopback Adapter still adopts the winding form, if the destination address of the packet that is sent is an its own IP address, then directly sends into the transmit leg network interface card and receives buffering area, does not send to the outside.At first, Microsoft Loopback Adapter sends reading of data the buffering area from data, is ready for sending to the virtual concentrator that is attached thereto.Then, check whether the destination address of packet is the network interface card that self sends,, then packet is directly sent to the reception data buffer of transmit leg network interface card self if the destination address of packet is self; Otherwise, need send to virtual concentrator.Then, if the state of detecting visual hub is virtual concentrator free time, then directly transmission; Otherwise postpone design 1,2,3, survey again after the 4... chronomere (chronomere can set as required, as second, millisecond etc.), in case virtual concentrator free time, then directly transmission; Otherwise continue to postpone, up to the virtual concentrator free time.
The above-mentioned Microsoft Loopback Adapter that adopts in network environment simulating is realized the method for data communication, the process that said virtual concentrator receives packet is: virtual concentrator receives and takes passive form from the data of Microsoft Loopback Adapter, when promptly waiting until the data arrival of Microsoft Loopback Adapter transmission, it just receives and deposits in the data buffer zone.Virtual concentrator at first locks to the data buffering area, shows that what carry out this moment is the buffering area write operation of the data sent here of current network interface card, makes the data buffer zone form the mutual exclusion state.Because virtual concentrator links to each other with a plurality of Microsoft Loopback Adapters simultaneously, and its data buffer zone is that these several Microsoft Loopback Adapters are shared, so need lock when the data buffering area is operated, avoids a plurality of network interface cards to operate simultaneously and makes data buffer zone generation confusion.The data buffer zone correct write packet after, to the release of data buffering area.
The above-mentioned Microsoft Loopback Adapter that adopts in network environment simulating is realized the method for data communication, said virtual concentrator transmission packet to the process of recipient's Microsoft Loopback Adapter is: when virtual concentrator sends packet, whether the reception data buffer that at first detects recipient's Microsoft Loopback Adapter is idle, if busy, then wait for; If recipient's reception data buffer free time then read data packet are ready for sending.During read data packet, at first the data buffering area is locked, and then carry out read operation, read behind the packet the release of data buffering area.Then all Microsoft Loopback Adapters of registering in virtual concentrator of traversal had both comprised recipient's Microsoft Loopback Adapter, also comprised the transmit leg Microsoft Loopback Adapter, except the source data packet network interface card, sent data to these network interface cards successively, and this is the process of a broadcasting.
The above-mentioned Microsoft Loopback Adapter that adopts in network environment simulating is realized the method for data communication, said recipient's Microsoft Loopback Adapter with the process that packet adds reception data buffer is: Microsoft Loopback Adapter is at first checked the promiscuous mode sign of self when virtual concentrator receives packet, if Microsoft Loopback Adapter has been set to promiscuous mode, then unconditionally receive this packet; To not make judgement to the destination address of packet if Microsoft Loopback Adapter is provided with promiscuous mode, if the destination address of this packet be the address of receiving terminal network interface card then receive packet, otherwise with data packet discarding.Then, detect reception data buffer and whether have living space, if still have living space then data are write direct; If reception data buffer Man Ze etc. detects after unit interval to be designed again, but the number of times that detects can not be above three times, if three times do not abandon this packet if Man Sanci still has enough spaces with the existing enough spaces of interior reception data buffer then receive this packet and it is write the data buffer zone.
The above-mentioned Microsoft Loopback Adapter that adopts in network environment simulating is realized the method for data communication, said the packet that receives is sealed off, the process of reduction Ether frame and user data is: application program receives the buffering area reading of data and seals off from Microsoft Loopback Adapter, just in time the encapsulation process with packet is opposite for the processing procedure of sealing off, its process is to utilize the side-play amount of the packet that receives to get access to original Ether frame, can parse the data of IP datagram or same level type in the Ether frame of standard, there has been IP datagram just can be easy to obtain TCP message and UDP message, thereby removed TCP heading or UDP heading and obtain final user data.
The present invention's beneficial effect compared with prior art: the present invention simulates basic function such as the data forwarding of physical network card and major function, and forms the data communication process in the network environment simulating, and it mainly has the following advantages:
Favorable expandability: on basis of the present invention, can expand to virtual network device very easily, basic expansion thought is that virtual network device comprises one or several piece Microsoft Loopback Adapter, the bottom data communication module of Microsoft Loopback Adapter as core, other function of virtual network device is set by user oneself; Can form virtual network environment very easily by the interconnected of virtual network device, thereby network is carried out analog simulation.
Open good: the present invention fully takes into account the needs of further developing when the user uses, the module design of Microsoft Loopback Adapter and virtual concentrator, the process of data communication and method advantages of simple, can can carry out open exploitation on this basis for the user provides numerous funcall interfaces.
Highly versatile: the present invention fully takes into account the characteristic of network bottom layer transfer of data, makes most of protocol data bag of Ether frame and TCP/IP protocol suite to transmit by virtual network card system, has very strong versatility.
The present invention can use in many aspects, for example the simulation of the emulation of the research of computer and network, computer network, particular network environment, network security research field etc.Therefore, the present invention has good social benefit and application prospect.
Description of drawings
Fig. 1 is the logical construction schematic diagram of Microsoft Loopback Adapter of the present invention
Fig. 2 is the logical construction schematic diagram of virtual concentrator of the present invention
Fig. 3 connects the process block diagram that carries out data communication by virtual concentrator between the Microsoft Loopback Adapter of the present invention
Fig. 4 is that the present invention is the process schematic diagram of the packet encapsulation of example with the Transmission Control Protocol
Fig. 5 is the flow chart that Microsoft Loopback Adapter of the present invention sends data to virtual concentrator
Fig. 6 is that Microsoft Loopback Adapter of the present invention receives packet flow process figure
Embodiment
With reference to Fig. 1, it is the logical construction schematic diagram of Microsoft Loopback Adapter of the present invention, and Microsoft Loopback Adapter comprises first group of data record and first group of funcall interface.The essential information of first group of data record essential record Microsoft Loopback Adapter comprises Microsoft Loopback Adapter title, MAC Address, IP address, subnet mask, gateway, promiscuous mode sign, reception data buffer, transmission data buffer zone, accepting state sign, transmit status sign.First group of funcall interface offers the external world, is responsible for the master data record of Microsoft Loopback Adapter is operated and revised.First group of funcall interface has: obtain the network interface card name, obtain and be provided with MAC Address, obtain and be provided with the IP address, obtain and be provided with gateway, obtain and be provided with the network interface card promiscuous mode, obtain and be provided with subnet mask.Reception data buffer storing virtual network interface card receives the data of coming from virtual concentrator.Send the data buffer zone and store the data that are ready for sending to virtual concentrator.Master data record at first is set during the Microsoft Loopback Adapter initialization,, then connects registration to the virtual concentrator that is connected as network interface card title, MAC Address, promiscuous mode sign etc.The design of daemon thread is very necessary among the figure, its real-time monitoring sends the data buffer zone, when Microsoft Loopback Adapter sends the condition of data and condition that virtual concentrator receives data and satisfies, just then data are sent to virtual concentrator from transmission buffering area reading of data.
With reference to Fig. 2, it is the logical construction schematic diagram of virtual concentrator of the present invention, and virtual concentrator comprises second group of data record and second group of funcall interface two parts.The essential information of second group of data record essential record virtual concentrator, wherein data record has: the title of hub, port number, data buffer zone, mutual exclusion lock, network interface card record are tabulated, have been connected the network interface card number, send packet network interface card sign.Second group of funcall interface offers the external world, is responsible for the master data record of Microsoft Loopback Adapter is operated and revised.Second group of funcall interface has: obtain the hub title, obtain port number, obtain and connect network interface card number, interpolation and deletion registration network interface card.Data record at first is set during the virtual concentrator initialization, and secondly the Microsoft Loopback Adapter of its request connection registration of subtend is registered, and will add the tabulation of network interface card record for information about, and upgrade the network interface card linking number.A data buffering area is set in the virtual concentrator, and this data buffer zone is towards registered a plurality of network interface cards, therefore may there be a plurality of data operation request to take place simultaneously,, make mutual exclusion between a plurality of data operation request so will add the software mutual exclusion lock for this data buffer zone.The Monitoring Data buffering area that daemon thread is real-time when virtual concentrator sends the condition of data and condition that Microsoft Loopback Adapter receives data and satisfies simultaneously, just from the data buffer zone reading of data, sends to the Microsoft Loopback Adapter that is attached thereto to data then.
With reference to Fig. 3, it is to connect the process block diagram that carries out data communication by virtual concentrator between the Microsoft Loopback Adapter of the present invention, as can be seen from the figure, it is to realize data communication in the network environment of utilizing above-mentioned Microsoft Loopback Adapter that has designed and virtual concentrator to couple together to form, and its process is:
(1) encapsulation of packet is encapsulated as Ether frame with user data or application data, Ether frame is encapsulated as the packet of Microsoft Loopback Adapter and virtual hub handles again.User data is encapsulated as the standard that Ether frame will be followed ICP/IP protocol on the Ethernet, the relevant protocol data of user data according to TCP/IP protocol suite encapsulated, and these main protocol types have IP, TCP, UDP, ICMP, IGMP, ARP and RARP protocol data bag.Application data is encapsulated as the inferior data of protocal layers, and finally is encapsulated as Ether frame, and its encapsulation is Ether frame encapsulation IP data or ICMP data or IGMP data in proper order; IP data encapsulation tcp data or UDP message; Tcp data and UDP message encapsulated user data.
With reference to Fig. 4, it is that the present invention is the process schematic diagram of the packet encapsulation of example with the Transmission Control Protocol, the superiors of figure are the user data that need transmission, at first add user data Appl stem to user data, the user data that has added User Data Header is called application data, application data is added a TCP stem again and just is encapsulated as the tcp data bag, the tcp data bag adds an IP stem and just is encapsulated as the IP packet, the IP packet adds the Ethernet stem respectively and the Ethernet afterbody just is encapsulated as Ether frame, and Ether frame is the data mode that directly transmits in Ethernet by Ethernet card.The encapsulation process of tcp data has only been described here, UDP message and tcp data basically identical, unique different information units that are UDP passes to IP are called UDP datagram, and the header length of UDP is 8 bytes.Other protocol data is sealed dress also similar process.Be that Ether frame is done further encapsulation more then, the method of encapsulation is at first to define new packet, new packet is divided into header part and data division, with the data division of Ether frame as new packet, the information such as side-play amount of the header part of new packet record Ether frame in new packet.Utilize side-play amount can obtain Ether frame in the packet exactly, can obtain the data of each protocol hierarchy very easily from Ether frame, this also provides convenience in the future data being sealed off.
New packet be configured with three kinds of approach:
1) from empty packet structure: at first construct the packet of a sky, the protocol header field and the data division of filling each agreement are set respectively then.
2) from existing Ether frame structure: the packet of an ether level has been arranged, at this moment that this ether packet is temporary in the data buffer zone, read the new packet of needed data component structure in this ether packet subsequently.
3) packet copy: the packet of existing agreement of the same type, construct a new packet and have identical content, only need to copy former data to new packet.
(2) Microsoft Loopback Adapter that packet is joined transmit leg sends buffering area, gives the transmit leg Microsoft Loopback Adapter after packet is ready to and sends.Check that at first the data of transmit leg Microsoft Loopback Adapter send the state of buffering area, memory space and its state are arranged for idle, then ready data adding is sent buffering area if send buffering area.If the transmission buffering area of transmit leg Microsoft Loopback Adapter is full or its state is busy, then wait for up to sending that buffering area has living space and till its state free time.
(3) the transmit leg Microsoft Loopback Adapter sends to packet the virtual concentrator that is attached thereto.
With reference to Fig. 5, it is the flow chart that transmit leg Microsoft Loopback Adapter of the present invention sends data to virtual concentrator, the transmit leg Microsoft Loopback Adapter sends the form that data are taken the initiative and sent to virtual concentrator, be that the interior daemon thread of transmit leg Microsoft Loopback Adapter constantly detects the transmission buffering area, in case find to have data just to read these data immediately and attempting sending to virtual concentrator.In addition, transmit leg Microsoft Loopback Adapter (the same with actual network interface card) still adopts the winding form, if the destination address of the packet that is sent is an its own IP address, then directly sends into the transmit leg network interface card and receives buffering area, does not send to the outside.At first, the transmit leg Microsoft Loopback Adapter is reading of data from send the data buffer zone, is ready for sending to the virtual concentrator that is attached thereto.Then, check whether the destination address of packet is self,, then packet is directly sent to the reception data buffer of transmit leg network interface card self if the destination address of packet is self; Otherwise, need send to virtual concentrator.Then, if the state of detecting visual hub is virtual concentrator free time, then directly transmission; Otherwise postpone design 1,2,3, survey (chronomere can set as required, as second, millisecond etc.) again after the 4... chronomere, in case virtual concentrator free time, then directly transmission; Otherwise continue to postpone, up to the virtual concentrator free time.
(4) virtual concentrator receives the packet from the transmit leg Microsoft Loopback Adapter, virtual concentrator receives and takes passive form from the data of transmit leg Microsoft Loopback Adapter, when promptly waiting until the data arrival of transmit leg Microsoft Loopback Adapter transmission, it just receives and deposits in the data buffer zone of self.Virtual concentrator at first locks to the data buffer zone of self, shows that what carry out this moment is the buffering area write operation of the data sent here of current network interface card, makes the data buffer zone form the mutual exclusion state.Because virtual concentrator links to each other with a plurality of Microsoft Loopback Adapters simultaneously, and its data buffer zone is that these several Microsoft Loopback Adapters are shared, so need lock when the data buffering area is operated, avoids a plurality of network interface cards to operate simultaneously, makes data buffer zone generation confusion.The data buffer zone correct write packet after, to the release of data buffering area.
(5) virtual concentrator sends the reception buffering area of packet to recipient's Microsoft Loopback Adapter, and whether when virtual concentrator sends packet, it is idle at first to detect the receiving side data buffering area, if busy, then waits for; If receiving side data buffering area free time then read data packet are ready for sending.During read data packet, at first the data buffering area is locked, and then carry out read operation, read behind the packet the release of data buffering area.Then travel through all Microsoft Loopback Adapters (except the source data packet network interface card) of registering in virtual concentrator, both comprised recipient's Microsoft Loopback Adapter, also comprise the transmit leg Microsoft Loopback Adapter, send data to these network interface cards successively, this is the process of a broadcasting.
(6) recipient's Microsoft Loopback Adapter receives the packet from virtual concentrator.
With reference to Fig. 6, it is that recipient's Microsoft Loopback Adapter of the present invention receives packet flow process figure, recipient's Microsoft Loopback Adapter is at first checked the promiscuous mode sign of self when virtual concentrator receives packet, if recipient's Microsoft Loopback Adapter has been set to promiscuous mode, then unconditionally receive this packet; To not make judgement to the destination address of packet if recipient's Microsoft Loopback Adapter is provided with promiscuous mode, if the destination address of this packet be the address of recipient's Microsoft Loopback Adapter then receive packet, otherwise with data packet discarding.Then, detect reception data buffer and whether have living space, if still have living space then data are write direct; If reception data buffer is expired then is detected after waiting for the unit interval again, but the number of times that detects can not be above three times, if three times do not abandon this packet if Man Sanci still has enough spaces with the existing enough spaces of interior reception data buffer then receive this packet and it is write the data buffer zone.
(7) packet that receives is sealed off processing.
Application program receives the buffering area reading of data and seals off from recipient's Microsoft Loopback Adapter, just in time the encapsulation process process with the described packet of above-mentioned Fig. 4 is opposite for the processing procedure of sealing off, its process is to utilize the side-play amount of the packet that receives to get access to original Ether frame, can parse the data of IP datagram or same level type in the Ether frame of standard, there has been IP datagram just can be easy to obtain TCP message and UDP message, thereby removed TCP heading or UDP heading and obtain final user data.

Claims (6)

1. adopt Microsoft Loopback Adapter to realize the method for data communication in the network environment simulating in single computer, its step is as follows:
(1) design Microsoft Loopback Adapter and virtual concentrator;
(2) carry out the encapsulation of packet;
(3) data are joined the transmit leg Microsoft Loopback Adapter and send the data buffer zone;
(4) the transmit leg Microsoft Loopback Adapter sends packet to virtual concentrator;
(5) virtual concentrator receives packet;
(6) virtual concentrator sends packet to recipient's Microsoft Loopback Adapter;
(7) recipient's Microsoft Loopback Adapter adds reception data buffer with packet;
(8) packet that receives is sealed off reduction Ether frame and user data;
It is characterized in that the Microsoft Loopback Adapter that designs comprises first group of data record and first group of funcall interface, the essential information of first group of data record essential record Microsoft Loopback Adapter comprises Microsoft Loopback Adapter title, MAC Address, IP address, subnet mask, gateway, promiscuous mode sign, reception data buffer, transmission data buffer zone, accepting state sign, transmit status sign; First group of funcall interface offers the external world, is responsible for the master data record of Microsoft Loopback Adapter is operated and revised; The funcall interface has: obtain the network interface card name, obtain and be provided with MAC Address, obtain and be provided with the IP address, obtain and be provided with gateway, obtain and be provided with the network interface card promiscuous mode, obtain and be provided with subnet mask; The virtual concentrator of design is the bridge of communicating by letter between the Microsoft Loopback Adapter, when carrying out data communication, will link together by virtual concentrator between the Microsoft Loopback Adapter; Virtual concentrator comprises second group of data record and two parts of second group of funcall interface; Second group of data record has: the title of hub, port number, data buffer zone, mutual exclusion lock, network interface card record are tabulated, have been connected the network interface card number, send packet network interface card sign; Second group of funcall interface has: obtain the hub title, obtain port number, obtain and connect network interface card number, interpolation and deletion registration network interface card.
2. the Microsoft Loopback Adapter that adopts in network environment simulating according to claim 1 is realized the method for data communication, it is characterized in that saidly data are joined the transmit leg Microsoft Loopback Adapter sending the data buffer zone, its process is: give the transmit leg Microsoft Loopback Adapter and send after packet is ready to, check that at first the data of transmit leg Microsoft Loopback Adapter send the state of buffering area, memory space and its state are arranged for idle if send buffering area, then ready data are added and send buffering area, if the transmission buffering area of transmit leg Microsoft Loopback Adapter is full or its state is busy, then wait for, up to sending that buffering area has living space and till its state free time.
3. the Microsoft Loopback Adapter that adopts in network environment simulating according to claim 1 is realized the method for data communication, it is characterized in that said transmit leg Microsoft Loopback Adapter transmission packet to the process of virtual concentrator is: the transmit leg Microsoft Loopback Adapter sends the form that data are taken the initiative and sent to virtual concentrator, be that the interior daemon thread of transmit leg Microsoft Loopback Adapter constantly detects the transmission buffering area, in case find to have data just to read these data immediately and attempting sending to virtual concentrator, in addition, the transmit leg Microsoft Loopback Adapter adopts the winding form, if the destination address of the packet that is sent is an its own IP address, then directly send into the transmit leg network interface card and receive buffering area, do not send to the outside, otherwise, need send to virtual concentrator, want the state of detecting visual hub this moment, if the virtual concentrator free time then directly sends, otherwise survey again after the chronomere that postpones to design, in case the virtual concentrator free time, then directly send; Otherwise continue to postpone, up to the virtual concentrator free time.
4. the Microsoft Loopback Adapter that adopts in network environment simulating according to claim 1 is realized the method for data communication, the process that it is characterized in that said virtual concentrator reception packet is: virtual concentrator receives and takes passive form from the data of transmit leg Microsoft Loopback Adapter, when promptly waiting until the data arrival of transmit leg Microsoft Loopback Adapter transmission, it just receives and deposits in the data buffer zone, virtual concentrator at first locks to the data buffering area, show that what carry out this moment is the buffering area write operation of the data sent here of current network interface card, make the data buffer zone form the mutual exclusion state, because virtual concentrator links to each other with a plurality of Microsoft Loopback Adapters simultaneously, and its data buffer zone is that these several Microsoft Loopback Adapters are shared, so need when the data buffering area is operated, lock, avoid a plurality of network interface cards to operate simultaneously and make the data buffer zone that confusion take place, the data buffer zone correct write packet after, to the release of data buffering area.
5. the Microsoft Loopback Adapter that adopts in network environment simulating according to claim 1 is realized the method for data communication, it is characterized in that said virtual concentrator transmission packet to the process of recipient's Microsoft Loopback Adapter is: when virtual concentrator sends packet, whether the reception data buffer that at first detects recipient's Microsoft Loopback Adapter is idle, if busy, then wait for; If receiving side data buffering area free time then read data packet are ready for sending; During read data packet, virtual concentrator at first locks to the data buffer zone of self, and then carries out read operation, reads behind the packet data buffer zone release to self; Then all Microsoft Loopback Adapters of registering in virtual concentrator of traversal had both comprised recipient's Microsoft Loopback Adapter, also comprised the transmit leg Microsoft Loopback Adapter, except the source data packet network interface card, sent data to these network interface cards successively, and this is the process of a broadcasting.
6. the Microsoft Loopback Adapter that adopts in network environment simulating according to claim 1 is realized the method for data communication, it is characterized in that said recipient's Microsoft Loopback Adapter with the process that packet adds reception data buffer is: recipient's Microsoft Loopback Adapter is at first checked the promiscuous mode sign of self when virtual concentrator receives packet, if recipient's Microsoft Loopback Adapter has been set to promiscuous mode, then unconditionally receive this packet; To not make judgement to the destination address of packet if recipient's Microsoft Loopback Adapter is provided with promiscuous mode, if the destination address of this packet be the address of recipient's network interface card then receive packet, otherwise with data packet discarding; Then, detect reception data buffer and whether have living space, if still have living space then data are write direct; If reception data buffer Man Ze etc. detects after unit interval to be designed again, but the number of times that detects can not be above three times, if three times do not abandon this packet if Man Sanci still has enough spaces with the existing enough spaces of interior reception data buffer then receive this packet and write the data packet reception data buffer.
CNB2005100963823A 2005-11-21 2005-11-21 Method for realizing data communication utilizing virtual network adapting card in network environment simulating Expired - Fee Related CN100370788C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100963823A CN100370788C (en) 2005-11-21 2005-11-21 Method for realizing data communication utilizing virtual network adapting card in network environment simulating

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100963823A CN100370788C (en) 2005-11-21 2005-11-21 Method for realizing data communication utilizing virtual network adapting card in network environment simulating

Publications (2)

Publication Number Publication Date
CN1777142A CN1777142A (en) 2006-05-24
CN100370788C true CN100370788C (en) 2008-02-20

Family

ID=36766456

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100963823A Expired - Fee Related CN100370788C (en) 2005-11-21 2005-11-21 Method for realizing data communication utilizing virtual network adapting card in network environment simulating

Country Status (1)

Country Link
CN (1) CN100370788C (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101887379B (en) * 2010-06-18 2013-03-06 北京航空航天大学 Virtual network card-based wireless channel simulation method
CN102006308A (en) * 2010-12-16 2011-04-06 成都西麦克虚拟现实电子技术有限公司 High compatibility real-time simulation data network
CN102938681B (en) * 2012-08-02 2016-08-31 中国电力科学研究院 Transformer station's Abstract Common Service Interface is mapped to the method and system of network service
CN105611398B (en) * 2015-12-31 2019-04-23 深圳国微技术有限公司 A kind of method and apparatus using Conditional Access Module network data
CN109889428A (en) * 2018-12-30 2019-06-14 武汉奥浦信息技术有限公司 A method of information exchange is realized by means of line mode
KR102130806B1 (en) * 2020-02-14 2020-07-06 주식회사 두두아이티 Apparatus and method for providing cyber security training content
CN112527720A (en) * 2020-12-05 2021-03-19 青岛鼎信通讯股份有限公司 Data communication method applied to rack-mounted plant station terminal
CN112653702B (en) * 2020-12-25 2023-03-10 三六零数字安全科技集团有限公司 Method for identifying establishment of agent environment
CN112835775B (en) * 2021-01-29 2024-03-01 许继集团有限公司 Simulation network communication method and device and relay protection device simulation test system
CN113316181B (en) * 2021-07-28 2021-12-10 中电长城网际安全技术研究院(北京)有限公司 Wireless network simulation method, wireless network simulation data processing method and device
CN114371674B (en) * 2021-12-30 2024-04-05 中国矿业大学 Method and device for sending analog data frame, storage medium and electronic device
CN114679465A (en) * 2022-03-28 2022-06-28 北京火山引擎科技有限公司 Resource operation method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW444461B (en) * 1999-11-25 2001-07-01 Inventec Corp Virtual network system and method
CN1303054A (en) * 1999-10-28 2001-07-11 英业达集团(上海)电子技术有限公司 Virtual network device and its communication method
CN1556625A (en) * 2004-01-05 2004-12-22 联想(北京)有限公司 Data transmission method of network equipment based on multinetwork card and device
CN1694071A (en) * 2005-06-16 2005-11-09 武汉理工大学 Method for structuring distribution application system at stand-alone environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1303054A (en) * 1999-10-28 2001-07-11 英业达集团(上海)电子技术有限公司 Virtual network device and its communication method
TW444461B (en) * 1999-11-25 2001-07-01 Inventec Corp Virtual network system and method
CN1556625A (en) * 2004-01-05 2004-12-22 联想(北京)有限公司 Data transmission method of network equipment based on multinetwork card and device
CN1694071A (en) * 2005-06-16 2005-11-09 武汉理工大学 Method for structuring distribution application system at stand-alone environment

Also Published As

Publication number Publication date
CN1777142A (en) 2006-05-24

Similar Documents

Publication Publication Date Title
CN100370788C (en) Method for realizing data communication utilizing virtual network adapting card in network environment simulating
CN103888386B (en) The transmission method and device, system of expansible virtual local area network packet
CN104704778B (en) Method and system for virtual and physical network integration
US8908704B2 (en) Switch with dual-function management port
US9237098B2 (en) Media access control (MAC) address summation in Datacenter Ethernet networking
WO2022104869A1 (en) Chip-level encryption-based ethernet and field bus fusion gateway and transmission method
US6438128B1 (en) Alternate use of data packet fields to convey information
CN104954218B (en) Distributed virtual switch and retransmission method
CN101160850B (en) Method and device for forwarding packet
WO2018120798A1 (en) Vxlan packet processing method, device and system
CN106612224B (en) Message forwarding method and device applied to VXLAN
CN100550763C (en) The management method of the network equipment and network management system
CN103490961B (en) Network equipment
CN105634901B (en) Mac address information synchronous method and device based on CAS VXLAN
US20030182440A1 (en) Network processor with high-speed transceiver
US20050165961A1 (en) Interworking functionality
CN113890680A (en) Transmission method applied to fiber channel avionics network DDS
CN106657377A (en) WIA-PA (Wireless Networks for Industrial Automation-Process Automation)/full-interconnection manufacturing network information service adaptor and realization method thereof
JP2002204252A (en) System for converting overlapping private address
CN100452763C (en) Network unit for forwarding an Ethernet packet
JP3506327B2 (en) High-speed / high-reliability Ethernet transmission system and I / F device
CN113765721B (en) Ethernet remote configuration device based on FPGA
CN102123049A (en) Cache synchronization method based on MAC (Multi-Access Computer) address transmission
CN202094924U (en) Serial server
CN101166138A (en) Device for L2 virtual private network service transmission

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: 20080220

Termination date: 20131121