CN1777142A - 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 PDFInfo
- Publication number
- CN1777142A CN1777142A CNA2005100963823A CN200510096382A CN1777142A CN 1777142 A CN1777142 A CN 1777142A CN A2005100963823 A CNA2005100963823 A CN A2005100963823A CN 200510096382 A CN200510096382 A CN 200510096382A CN 1777142 A CN1777142 A CN 1777142A
- Authority
- CN
- China
- Prior art keywords
- data
- microsoft loopback
- packet
- loopback adapter
- virtual hub
- 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.)
- Granted
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The method designs virtual network card and virtual hub. Using hub connects virtual network cards. Data communication is carried out between virtual network cards according to data communication rule. The communication procedure is as following: packaging data packets, and adding data to buffer area of sending data at virtual network card of sending party; virtual network card of sending party sends data packets to virtual hub; virtual hub receives data packet; virtual hub sends data packets to virtual network card of receiving party; virtual network card of receiving party adds the data packets to received data buffer area; de-packaging the received data packets and restoring the Ethernet frame and user's data. Comparing with prior art, the invention is applicable to analog simulation of forwarding data at bottom layer in areas of computer network and network security as well as analog simulation of network environment.
Description
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 (HUB), the major function of Microsoft Loopback Adapter is transmission, reception and data cached, with virtual HUB 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 HUB:
(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 HUB;
(5) virtual HUB receives packet;
(6) virtual HUB 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 data record and funcall interface, the essential information 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.The 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 HUB 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 HUB between the Microsoft Loopback Adapter.Virtual HUB also comprises data record and two parts of funcall interface.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.The 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 processing 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 HUB is: Microsoft Loopback Adapter sends the form that data are taken the initiative and sent to virtual HUB, 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 HUB.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 HUB 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 HUB.Then, if the state of detecting visual HUB is virtual HUB free time, then directly transmission; Otherwise postpone 1,2,3,4 of design ... survey again after chronomere's (chronomere can set as required, as second, millisecond etc.), in case the virtual HUB free time then directly sends; Otherwise continue to postpone, up to the virtual HUB 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 HUB receives packet is: virtual HUB 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 HUB 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 HUB 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 HUB transmission packet to the process of recipient's Microsoft Loopback Adapter is: when virtual HUB sends packet, whether the data buffer zone of at first detecting the receiving terminal Microsoft Loopback Adapter is idle, if busy, then wait for; If receiving terminal data buffer zone 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.Except then all Microsoft Loopback Adapters of registering in virtual HUB of traversal, source data packet network interface card, send data to these network interface cards successively, 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 HUB 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 Ethernet data frames, 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 HUB, the process of data communication and method advantages of simple can provide numerous funcall interfaces for the user, can carry out open exploitation on this basis.
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 the virtual HUB of the present invention
Fig. 3 connects the process block diagram that carries out data communication by virtual HUB 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 HUB
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 data record and funcall interface.The essential information 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.The 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.Reception data buffer storing virtual network interface card receives the data of coming from virtual HUB.Send the data buffer zone and store the data that are ready for sending to virtual HUB.Master data record at first is set during the Microsoft Loopback Adapter initialization,, then connects registration to the virtual HUB 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, and it wants real-time monitoring to send the data buffer zone, when Microsoft Loopback Adapter sends the condition of data and condition that virtual HUB receives data and satisfies, just then data is sent to virtual HUB from transmission buffering area reading of data.
With reference to Fig. 2, it is the logical construction schematic diagram of the virtual HUB of the present invention, and virtual HUB comprises data record and funcall interface two parts.The essential information of the virtual HUB of data record essential record, 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.The 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 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 virtual HUB initialization, and secondly its request of subtend Microsoft Loopback Adapter of connecting registration 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 HUB, 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 HUB 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 HUB 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 HUB 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 that Microsoft Loopback Adapter and virtual HUB handle 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 ethernet frame, and ethernet 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 Ethernet data frames as new packet, the information such as side-play amount of the header part of new packet record Ethernet data frames 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 data configuration: 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 transmitting terminal sends buffering area, gives Microsoft Loopback Adapter after packet is ready to and sends.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, then ready data adding is sent buffering area if send 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.
(3) the transmit leg Microsoft Loopback Adapter sends to packet the virtual HUB that is attached thereto.
With reference to Fig. 5, it is the flow chart that Microsoft Loopback Adapter of the present invention sends data to virtual HUB, Microsoft Loopback Adapter sends the form that data are taken the initiative and sent to virtual HUB, 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 HUB.In addition, 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, Microsoft Loopback Adapter sends reading of data the buffering area from data, is ready for sending to the virtual HUB 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 HUB.Then, if the state of detecting visual HUB is virtual HUB free time, then directly transmission; Otherwise postpone 1,2,3,4 of design ... survey again after the chronomere (chronomere can set as required, as second, millisecond etc.), in case the virtual HUB free time then directly sends; Otherwise continue to postpone, up to the virtual HUB free time.
(4) virtual HUB receives the packet from Microsoft Loopback Adapter, and virtual HUB receives and takes passive form from the data of Microsoft Loopback Adapter, and when promptly waiting until the data arrival of Microsoft Loopback Adapter transmission, it just receives and deposit in the data buffer zone.Virtual HUB 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 HUB 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 HUB sends the reception buffering area of packet to the receiving terminal Microsoft Loopback Adapter, and whether when virtual HUB sends packet, it is idle at first to detect the receiving terminal data buffer zone, if busy, then waits for; If receiving terminal data buffer zone 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 HUB, send data to these network interface cards successively, this is the process of a broadcasting.
(6) Microsoft Loopback Adapter receives the packet of self-virtualizing HUB.
With reference to Fig. 6, it is that Microsoft Loopback Adapter of the present invention receives packet flow process figure, and Microsoft Loopback Adapter is at first checked the promiscuous mode sign of self when virtual HUB 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 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 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 Ethernet data frames, 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 (9)
1, adopt Microsoft Loopback Adapter to realize the method for data communication in network environment simulating, its step is as follows:
(1) design Microsoft Loopback Adapter and virtual concentrator HUB;
(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 HUB;
(5) virtual HUB receives packet;
(6) virtual HUB 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.
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 the Microsoft Loopback Adapter that designs comprises data record and funcall interface, the essential information 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; The 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 HUB of design is the bridge of communicating by letter between the Microsoft Loopback Adapter, when carrying out data communication, will link together by virtual HUB between the Microsoft Loopback Adapter; Virtual HUB also comprises data record and two parts of funcall interface; 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; The funcall interface has: obtain the HUB title, obtain port number, obtain and connect network interface card number, interpolation and deletion registration network interface card.
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 the said encapsulation of carrying out packet, be that user data or application data are encapsulated as Ether frame, again Ether frame is encapsulated as the packet that Microsoft Loopback Adapter and virtual HUB handle, its process 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, 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 being encapsulated as Ether frame, 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.
4, 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 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 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.
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 transmit leg Microsoft Loopback Adapter transmission packet to the process of virtual HUB is: Microsoft Loopback Adapter sends the form that data are taken the initiative and sent to virtual HUB, 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 HUB, in addition, 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 HUB, want the state of detecting visual HUB this moment, if the virtual HUB free time then directly sends, otherwise survey again after the chronomere that postpones to design, in case the virtual HUB free time, then directly send; Otherwise continue to postpone, up to the virtual HUB free time.
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 the process that said virtual HUB receives packet is: virtual HUB 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 HUB 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 HUB 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.
7, 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 HUB transmission packet to the process of recipient's Microsoft Loopback Adapter is: when virtual HUB sends packet, whether the data buffer zone of at first detecting the receiving terminal Microsoft Loopback Adapter is idle, if busy, then wait for; If receiving terminal data buffer zone 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; Except then all Microsoft Loopback Adapters of registering in virtual HUB of traversal, source data packet network interface card, send data to these network interface cards successively, this is the process of a broadcasting.
8, 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: Microsoft Loopback Adapter is at first checked the promiscuous mode sign of self when virtual HUB 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.
9, 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 the packet that receives being 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 Ethernet data frames, 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.
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 true CN1777142A (en) | 2006-05-24 |
CN100370788C 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) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101887379A (en) * | 2010-06-18 | 2010-11-17 | 北京航空航天大学 | Virtual network card-based wireless channel simulation method |
CN102006308A (en) * | 2010-12-16 | 2011-04-06 | 成都西麦克虚拟现实电子技术有限公司 | High compatibility real-time simulation data network |
CN102938681A (en) * | 2012-08-02 | 2013-02-20 | 中国电力科学研究院 | Method and system for mapping transformer substation abstract communication service interface to network communication |
CN105611398A (en) * | 2015-12-31 | 2016-05-25 | 深圳国微技术有限公司 | Method and apparatus for processing network data by using conditional access module |
CN109889428A (en) * | 2018-12-30 | 2019-06-14 | 武汉奥浦信息技术有限公司 | A method of information exchange is realized by means of line mode |
CN112527720A (en) * | 2020-12-05 | 2021-03-19 | 青岛鼎信通讯股份有限公司 | Data communication method applied to rack-mounted plant station terminal |
CN112653702A (en) * | 2020-12-25 | 2021-04-13 | 沈阳通用软件有限公司 | Method for identifying and building agent environment |
CN112835775A (en) * | 2021-01-29 | 2021-05-25 | 许继集团有限公司 | Simulation network communication method and device and relay protection device simulation test system |
US20210258332A1 (en) * | 2020-02-14 | 2021-08-19 | DUDU Information Technologies, Inc. | Apparatus and method for providing cyber security training content |
CN113316181A (en) * | 2021-07-28 | 2021-08-27 | 中电长城网际安全技术研究院(北京)有限公司 | Wireless network simulation method, wireless network simulation data processing method and device |
CN114221828A (en) * | 2021-12-27 | 2022-03-22 | 上海贝锐信息科技股份有限公司 | Double-interface multicast broadcast forwarding method |
CN114371674A (en) * | 2021-12-30 | 2022-04-19 | 中国矿业大学 | 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 |
Family Cites Families (4)
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 |
CN1324856C (en) * | 2004-01-05 | 2007-07-04 | 联想(北京)有限公司 | Data transmission method of network equipment based on multinetwork card and device |
CN100367210C (en) * | 2005-06-16 | 2008-02-06 | 武汉理工大学 | Method for structuring distribution application system at stand-alone environment |
-
2005
- 2005-11-21 CN CNB2005100963823A patent/CN100370788C/en not_active Expired - Fee Related
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101887379B (en) * | 2010-06-18 | 2013-03-06 | 北京航空航天大学 | Virtual network card-based wireless channel simulation method |
CN101887379A (en) * | 2010-06-18 | 2010-11-17 | 北京航空航天大学 | Virtual network card-based wireless channel simulation method |
CN102006308A (en) * | 2010-12-16 | 2011-04-06 | 成都西麦克虚拟现实电子技术有限公司 | High compatibility real-time simulation data network |
CN102938681A (en) * | 2012-08-02 | 2013-02-20 | 中国电力科学研究院 | Method and system for mapping transformer substation abstract communication service interface to network communication |
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 |
CN105611398A (en) * | 2015-12-31 | 2016-05-25 | 深圳国微技术有限公司 | Method and apparatus for processing network data by using conditional access module |
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 |
US20210258332A1 (en) * | 2020-02-14 | 2021-08-19 | DUDU Information Technologies, Inc. | 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 |
CN112653702A (en) * | 2020-12-25 | 2021-04-13 | 沈阳通用软件有限公司 | Method for identifying and building agent environment |
CN112835775A (en) * | 2021-01-29 | 2021-05-25 | 许继集团有限公司 | Simulation network communication method and device and relay protection device simulation test system |
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 |
CN113316181A (en) * | 2021-07-28 | 2021-08-27 | 中电长城网际安全技术研究院(北京)有限公司 | Wireless network simulation method, wireless network simulation data processing method and device |
CN114221828A (en) * | 2021-12-27 | 2022-03-22 | 上海贝锐信息科技股份有限公司 | Double-interface multicast broadcast forwarding method |
CN114371674A (en) * | 2021-12-30 | 2022-04-19 | 中国矿业大学 | Method and device for sending analog data frame, storage medium and electronic 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 |
Also Published As
Publication number | Publication date |
---|---|
CN100370788C (en) | 2008-02-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN1777142A (en) | Method for realizing data communication utilizing virtual network adapting card in network environment simulating | |
Davidson | An introduction to TCP/IP | |
US9237098B2 (en) | Media access control (MAC) address summation in Datacenter Ethernet networking | |
CN102739473B (en) | Network detecting method using intelligent network card | |
CN104704778B (en) | Method and system for virtual and physical network integration | |
WO2022104869A1 (en) | Chip-level encryption-based ethernet and field bus fusion gateway and transmission method | |
WO2018177409A1 (en) | Packet transmission method and apparatus | |
CN1954574B (en) | Unified infrastructure over Ethernet | |
CN104954218A (en) | Distributed virtual switching device and forwarding method | |
CN106612224A (en) | Message forwarding method and device applied to VXLAN (Virtual eXtensible LAN) | |
CN109547452A (en) | The method and system of TCP Transparent Proxy are realized on Linux bridge equipment | |
US20030182440A1 (en) | Network processor with high-speed transceiver | |
CN109756475B (en) | Data transmission method and device in unidirectional network | |
CN1758654A (en) | Method for set-up direct link tunnel for user terminal and its communication method and server | |
CN1601996A (en) | Method for access of IP public net of virtual exchanger system | |
CN112929284A (en) | ND message identification method and system under IPv6VXLAN scene | |
CN106657377A (en) | WIA-PA (Wireless Networks for Industrial Automation-Process Automation)/full-interconnection manufacturing network information service adaptor and realization method thereof | |
US7505418B1 (en) | Network loopback using a virtual address | |
US20080040494A1 (en) | Partitioning a Transmission Control Protocol (TCP) Control Block (TCB) | |
CN113938443A (en) | Wireless Internet of things protocol switch architecture and implementation method | |
Cisco | Apple Talk | |
CN1571396A (en) | An implementing method for switching ZONET in IPv6 network | |
JP4461017B2 (en) | Data packet routing method and apparatus for implementing the method | |
Cena et al. | Composite CAN XL-Ethernet Networks for Next-Gen Automotive and Automation Systems | |
CN1286300C (en) | Communication method of transmitting and moving Internet protocol association with network address |
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 |