WO2016187783A1 - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
WO2016187783A1
WO2016187783A1 PCT/CN2015/079718 CN2015079718W WO2016187783A1 WO 2016187783 A1 WO2016187783 A1 WO 2016187783A1 CN 2015079718 W CN2015079718 W CN 2015079718W WO 2016187783 A1 WO2016187783 A1 WO 2016187783A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
mac address
receiver
recipient
mac
Prior art date
Application number
PCT/CN2015/079718
Other languages
French (fr)
Chinese (zh)
Inventor
胡农达
冯强
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2015/079718 priority Critical patent/WO2016187783A1/en
Priority to CN201580001272.6A priority patent/CN106489252B/en
Publication of WO2016187783A1 publication Critical patent/WO2016187783A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a data transmission method and apparatus.
  • Ethernet In Ethernet (Ethernet), when unicast communication is between host nodes, the sender's data is first encapsulated into an Internet Protocol (IP) packet, which is then further encapsulated into an Ethernet frame and then sent out from the host node.
  • IP Internet Protocol
  • the structure of the Ethernet frame is as shown in FIG. 1.
  • the Ethernet frame header includes a source media access control (MAC) address and a destination MAC address.
  • the source MAC address is the identifier of the network interface of the source host node, and the destination MAC address is different according to the frame type.
  • the destination MAC address is the identifier of the network interface of the destination host node.
  • the MAC addresses of different network interfaces cannot conflict.
  • IP-MAC address resolution When the application parties communicate, they usually only know the IP address of the other party and the port number of the upper layer protocol. In order to further encapsulate the IP packet into an Ethernet frame, the sender needs to obtain the source MAC address (ie, the local MAC address of the sender host) and the destination MAC address (ie, the MAC address of the receiver host), and the sender host knows the local MAC address. The address, and the MAC address of the receiving host, needs to be obtained through the destination IP address. This method of determining the destination MAC address by the destination IP address is called "IP-MAC address resolution".
  • IP-MAC address resolution is generally implemented by performing Address Resolution Protocol (ARP).
  • ARP Address Resolution Protocol
  • the sender host sends an ARP request packet, which is used to query all hosts in the same broadcast domain for the MAC address corresponding to the destination IP address.
  • the ARP request packet is transmitted over the network to all hosts in the same broadcast domain;
  • ARP request packet finds that it is the MAC address of its own IP address, it replies with an ARP response packet in a unicast manner, and informs the inquiring party of its own MAC address;
  • the sender host receives the ARP response packet and obtains the MAC address of the IP address being queried.
  • node 0 on an Ethernet composed of k+1 host nodes located in the same broadcast domain, node 0 performs an ARP-based IP-MAC address resolution process. Assuming host node 0 is ready to communicate with node 2, host node 0 is to obtain the MAC address of host node 2 by IP-MAC address resolution.
  • the host node 0 sends an ARP request packet, and queries the MAC address corresponding to the IP address of the host node 2, and carries the IP address and MAC address of the host node 0 and the IP address of the host node 2 in the ARP packet; then, the ARP The request packet is transmitted on the network by means of Ethernet broadcast, and reaches the host node 1 to k; then, the host node 1 to k checks whether the ARP request packet is inquiring about the MAC address corresponding to its own IP address, and only the host node 2 finds that the inquiry is being made.
  • the host node 2 replies to the host node 0 with an ARP response packet, which includes the IP address and MAC address of the host node 0 and the IP address and MAC address of the host node 2; finally, the node 0 receives the node
  • the ARP response packet sent by 2 obtains the MAC address corresponding to the IP address of the host node 2, and the IP-MAC address resolution is completed.
  • the basic principle of the method is that the directory system saves the IP-MAC mapping of all current host nodes; when the host node needs to perform IP-MAC address resolution, it directly sends a unicast query packet to the directory system, asks for the MAC address of the specified IP address, and then The directory system responds directly to the host with results.
  • the directory system in this method usually has two implementations: one is a directory system implemented by a separate server or server cluster, and the method is called IP-MAC address resolution based on centralized directory service; the other is based on distributed A directory system of the Distributed Hash Table (DHT), the IP-MAC mapping table can be distributedly stored in the switch.
  • DHT Distributed Hash Table
  • Figure 3 shows an example of an IP-MAC address resolution process based on a centralized directory service.
  • the node k implements IP-MAC address resolution by sending a query packet to the directory system and receiving a response packet.
  • IP-MAC address resolution still needs to be implemented through inter-node communication, so additional address resolution communication delays are introduced before application communication.
  • additional hardware is needed to build the directory system.
  • the switch should be able to store the IP-MAC mapping table and be able to respond. Query, so the switch requires special hardware features to support it.
  • Embodiments of the present invention provide a data transmission method and apparatus for eliminating broadcast communication or directory service communication of IP-MAC address resolution without adding new hardware and hardware functions, thereby eliminating the introduction of the data.
  • Bandwidth overhead and communication latency increase the scalability of Layer 2 Ethernet.
  • an embodiment of the present invention provides a data transmission method, including:
  • the sender obtains the IP address of the receiver
  • the sender transmits data to the recipient based on the generated MAC address of the recipient.
  • the sending before the generating the MAC address of the receiver, further includes:
  • the sender determines that there is no cache information of a mapping relationship between the IP address and the MAC address including the IP address of the receiver.
  • the method further includes:
  • the sender determines that the cache information of the mapping relationship between the IP address and the MAC address of the IP address of the receiver is locally present, based on the MAC address of the receiver corresponding to the IP address of the receiver in the cache message An address that sends data to the recipient.
  • the IP address and the The determined port number generates the MAC address of the recipient, including:
  • the recipient's IP address is recorded in the other bytes of the recipient's MAC address except the highest byte and the next highest byte.
  • the highest word in the sender's MAC address The lowest two bits of the section indicate that the MAC address of the sender is a local unicast address, and the specified port number is recorded in the next highest byte of the sender's MAC address, except the highest byte of the sender's MAC address.
  • the sender's IP address is recorded in the other bytes of the next highest byte.
  • the method further includes:
  • the MAC address of the receiver included in the feedback data does not match the generated MAC address of the receiver, acquiring the IP address of the receiver and the The latest mapping relationship of the recipient's MAC address, and caches the latest mapping relationship locally.
  • the specified port number of the received MAC address of the receiver is 0.
  • a seventh possible implementation manner of the first aspect if the port of the sender is used for binding multiple ports, each port does not share an IP address or If the port is used for binding multiple ports and each port shares an IP address and a MAC address, the specified port number is 0; if the port is used for binding of multiple ports and each port shares an IP address but does not share a MAC address. Address, the specified port number is the number of the port.
  • the IP address of the recipient of the MAC address of the recipient's MAC address is the IP address of the recipient of the MAC address of the recipient's MAC address.
  • an embodiment of the present invention further provides a data transmission apparatus, including:
  • An obtaining unit configured to obtain an IP address of the receiver
  • a synthesizing unit configured to generate, according to the IP address of the receiver and the specified port number, the MAC address of the receiver
  • a sending unit configured to send data to the receiver based on the generated MAC address of the receiver.
  • the buffer unit before the synthesizing unit generates the MAC address of the receiver, the buffer unit is further configured to:
  • the sending unit is further configured to:
  • the cache unit locally has cache information including a mapping relationship between the IP address and the MAC address of the IP address of the receiver, based on the MAC address of the receiver corresponding to the IP address of the receiver in the cache message. Sending data to the recipient.
  • the synthesizing unit in accordance with the IP address of the recipient, is specifically configured to:
  • the recipient's IP address is recorded in the other bytes of the recipient's MAC address except the highest byte and the next highest byte.
  • the highest byte of the MAC address of the device The lowest two bits indicate that the MAC address of the device is a local unicast address, and the specified port number is recorded in the next highest byte of the MAC address of the device, except for the highest byte and the second highest word in the MAC address of the device.
  • the IP address of the device is recorded in the other bytes of the section.
  • the cache unit is further configured to:
  • the MAC address of the receiver included in the feedback data does not match the generated MAC address of the receiver, acquiring the IP address of the receiver and the The latest mapping relationship of the recipient's MAC address, and caches the latest mapping relationship locally.
  • the specified port number is 0.
  • a seventh possible implementation manner of the second aspect if the port of the device is used for multiple port bonding, each port does not share an IP address or the If the port is used for binding to multiple ports and each port shares an IP address and a MAC address, the specified port number is 0. If the port is bound to multiple ports and each port shares an IP address but does not share a MAC address. , the specified port number is the number of the port.
  • the embodiment of the present invention further provides another data transmission apparatus, including a network interface, a memory, and a processor, wherein the memory stores a set of programs, and the processor is configured to invoke the storage in the memory.
  • the program causing the data transmission device to perform the method of any one of the first to seventh possible implementations of the first aspect and the first aspect.
  • the broadcast communication or the directory service communication of the IP-MAC address resolution is avoided without adding new hardware and hardware functions, and the corresponding network bandwidth overhead and communication delay are eliminated. Thereby improving the efficiency of IP-MAC address resolution. At the same time, it helps to improve the scalability of Layer 2 Ethernet by eliminating broadcast communication.
  • FIG. 1 is a schematic structural diagram of an Ethernet frame in the prior art
  • FIG. 2 is a schematic diagram of IP-MAC address resolution based on ARP protocol in the prior art
  • FIG. 3 is a schematic diagram of IP-MAC address resolution based on a centralized directory service in the prior art
  • FIG. 4 is a schematic diagram of a MAC address format in the prior art
  • FIG. 5 is a schematic diagram of a MAC address synthesizing manner according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of a MAC address configuration mechanism according to an embodiment of the present invention.
  • FIG. 7 is a flowchart of data transmission according to an embodiment of the present invention.
  • FIG. 8 is a flowchart of analyzing an IP-MAC address according to an embodiment of the present invention.
  • FIG. 9 is a flowchart of another data transmission according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of IP-MAC address resolution of scenario 1 according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of IP-MAC address resolution of scenario 2 according to an embodiment of the present invention.
  • FIG. 12 to FIG. 15 are structural diagrams of a data transmission apparatus according to an embodiment of the present invention.
  • the embodiment of the present invention provides a data transmission method and device.
  • the method in the embodiment of the present invention is: based on a structured MAC address synthesis method, by reconfiguring a host MAC address, in a communication process between host nodes
  • the sender host synthesizes the MAC address of the receiver host according to the IP address of the receiver host, and then sends data to the receiver host according to the synthesized MAC address of the receiver host.
  • the broadcast communication or directory service communication of IP-MAC address resolution is avoided without adding new hardware and hardware functions, and the corresponding network bandwidth overhead and communication delay are eliminated, thereby improving IP-MAC address resolution. effectiveness.
  • it helps to improve the scalability of Layer 2 Ethernet by eliminating broadcast communication.
  • Modern operating systems allow users to modify the MAC address of the network interface through software methods, and the only role of the MAC address of the host node's network interface is as a unique identifier, so in a centralized intranet scenario such as a data center.
  • the MAC address of the network interface of each host node can be allocated and managed in an orderly manner to avoid MAC address conflicts.
  • the MAC address in the Ethernet allows the user to customize. For example, the lowest two bits of the highest byte of the local unicast MAC address have special meanings, and other bytes can be customized.
  • the embodiment of the present invention designs a structured MAC address synthesis method, which synthesizes a MAC address based on a specified port number and a network address (ie, an IP address).
  • the port number refers to the serial number of multiple network interfaces sharing the same IP address.
  • the port number of the network interface is always set to the specified value (for example, always set to 0); when multiple network interface bindings are used, and multiple network interfaces used by the binding share a single
  • IP address and MAC address are used, the multiple network interfaces used by the binding are regarded as one network interface.
  • the port numbers of multiple network interfaces used by the binding are also always set to the specified value (for example, always set to 0); Multiple network interfaces are used for binding, and multiple network interfaces used for binding share a single IP address, but when each network interface uses a separate MAC address, the port numbers of multiple network interfaces are set to corresponding numbers, and the number is from Starting with 0, add 1 in turn, that is, the port numbers of multiple network interfaces are set to 0, 1, ....
  • the Ethernet MAC address is in the MAC-48 format. It consists of 6 bytes for a total of 48 bits. The upper 24 bits are the Organizationally Unique Identifier (OUI), and the lower 24 bits are the Extended Unique Identifier (EUI).
  • UMI Organizationally Unique Identifier
  • EUI Extended Unique Identifier
  • the MAC address synthesized in the embodiment of the present invention is allocated to the network interface, so the lowest two bits of the highest byte in the MAC address are set to 2'b10, that is, the MAC address is set as the local unicast MAC address, except the highest.
  • the lowest two bits of a byte have the special meaning that other bytes can be customized, and the port number and IP address can be recorded on a customizable byte.
  • the port number can be recorded in the other byte of the lowest byte of the MAC address except the lowest two bits and the next highest byte
  • the IP address is recorded in the other bytes of the MAC address except the highest byte and the next highest byte.
  • the port number and IP address can also be recorded in any specified manner on bytes other than the lowest two bits of the highest byte. That is, the way the MAC address is customized is not unique.
  • all MAC address bits in the MAC address may not be fully used, that is, some MAC address bits may be reserved for other determined meanings and uses.
  • FIG. 5 it is an example of MAC address synthesis according to an embodiment of the present invention.
  • IP address network address
  • the corresponding MAC address can be synthesized according to the IP address and the port number of the network interface, and the mapping relationship between the IP address and the MAC address can be implemented.
  • the embodiment of the present invention provides a MAC address configuration mechanism.
  • the main idea is that, according to the MAC address synthesizing method provided by the embodiment of the present invention, the MAC address of the network interface of the host node is used before the communication. Reconfigure. Referring to Figure 6, the specific process is as follows.
  • Step 600 After the system is started, port initialization is performed.
  • Step 610 Obtain a network address.
  • Step 620 Determine whether multiple network interfaces are used in combination and share the network address. If yes, go to step 630, otherwise go to step 640.
  • Step 630 Further determine whether the plurality of network interfaces used by the binding share the MAC address. If yes, go to step 650; otherwise, go to step 660.
  • Step 640 Synthesize the MAC address by using port number 0 and the network address, and rewrite the MAC address of the network interface.
  • the port number of a single network interface is always set to 0, and then the port number 0 and the network address are used to synthesize the MAC address.
  • Step 650 Synthesize the MAC address by using port number 0 and the network address, and rewrite the MAC address of the network interface.
  • multiple network interfaces used for binding share a network address and a shared MAC address
  • multiple network interfaces used for binding can be regarded as one network interface, and multiple network interfaces to be bound are used.
  • the port number is always set to 0, and then the port number is 0 and the shared network address is used to synthesize the MAC address.
  • the synthesized MAC address can be uniquely determined according to the shared network address.
  • Step 660 For each network interface i, respectively synthesize the MAC address by using the port number i and the network address, and rewrite the MAC address of each network interface.
  • each network interface uses a separate MAC address, and the port number is assigned sequentially for each network interface, for example, respectively.
  • No. 0, 1, ..., correspondingly, for each network interface i, the corresponding port number i and the shared network address are used to synthesize the MAC address, so that each network interface corresponds to a synthesized MAC address.
  • the structure of the MAC address corresponding to each network interface has at least a difference in port number.
  • each synthesized MAC address can be mapped according to the shared network address.
  • Step 670 Determine whether the network address has changed. If yes, return to step 620. Otherwise, repeat step 670.
  • the MAC address of the network interface is reconfigured according to the changed network address according to the above method, the configuration of the MAC address is updated, and the mapping relationship between the IP address and the MAC address is updated in time.
  • the data transmission method according to the embodiment of the present invention is as follows:
  • Step 700 The sender obtains the IP address of the receiver.
  • the sender (which may also be referred to as a source host node) knows the destination IP address, which is the IP address of the receiver (which may also be referred to as the destination host node).
  • Step 710 The sender generates the MAC address of the receiver according to the IP address of the receiver and the specified port number (for example, the specified port number is always set to 0).
  • the sender needs to determine the destination MAC address according to the destination IP address, where the destination MAC address is the MAC address of the receiver.
  • the process of determining the destination MAC address by the destination IP address is IP-MAC address resolution.
  • the traditional IP-MAC address resolution needs to be completed through the inter-node communication process.
  • the MAC address synthesis method designed by the embodiment of the present invention directly generates the MAC address of the receiver based on the IP address of the receiver, thereby eliminating the process of communication between the nodes. Improve the efficiency of IP-MAC address resolution.
  • the method for synthesizing the MAC address of the receiver includes:
  • the method for synthesizing the MAC address of the above-mentioned receiver is only a preferred solution, and the following synthesis method can also be employed.
  • Setting the lowest two bits of the highest byte of the recipient's MAC address indicates that the recipient's MAC address is a local unicast address, and recording the specified port number and the recipient's IP address in the highest byte of the recipient's MAC address.
  • the lowest two digits are in the arbitrarily specified bytes.
  • the receiving party pre-configures the MAC address of the network interface according to the MAC address synthesis method designed in accordance with the present invention, and when the sender communicates with the receiver, the sender also performs the MAC address synthesis method according to the present invention, according to the receiver
  • the IP address and the specified receiver port number are combined with the MAC address of the receiver, so that the process of obtaining the MAC address of the receiver according to the IP address of the receiver is completed, that is, the IP-MAC address resolution is completed.
  • the specified recipient port number can be set to the port number specified by the protocol, for example, can be set to 0.
  • each network interface is reconfigured with a synthesized MAC address, and the sender synthesizes the receiver. In the MAC address, the recipient port number can always be set to 0.
  • the sender After the sender synthesizes the MAC address of the receiver, the sender caches the mapping between the IP address of the receiver and the MAC address of the receiver locally.
  • Step 720 The sender sends data to the receiver based on the generated MAC address of the recipient.
  • the data sent by the sender to the receiver includes the MAC address of the receiver that it generates, and the sender's own MAC address.
  • the MAC address of the sender is pre-configured to the local network interface according to the MAC address synthesis method of the embodiment of the present invention.
  • the lowest two bits of the highest byte of the sender's MAC address indicate that the sender's MAC address is a local unicast address, and the specified port number is recorded in the next highest byte of the sender's MAC address, except for the highest word in the sender's MAC address.
  • the sender's IP address is recorded in the other bytes of the section and the next highest byte.
  • the specified port number is 0; if the port is more If a port is used for binding and each port shares an IP address but does not share a MAC address, the specified port number is the port number.
  • the latest mapping relationship between the IP address of the receiver and the MAC address of the receiver is obtained. And cache the latest mappings locally.
  • the receiving party's feedback data carries the recipient's own IP address and MAC address.
  • the MAC address carried in the feedback data may be the same as or different from the MAC address synthesized by the sender. For example, when the receiver binds to use multiple network interfaces to share IP addresses and uses independent MAC addresses, each network interface uses a separate MAC address, and the sender always generates the recipient's MAC address according to port number 0, then When the receiver uses the port number 1 to feed back the data, the sender receives the feedback data of the receiver and caches the mapping relationship between the latest recipient's IP address and the recipient's MAC address.
  • the sender checks whether there is cache information of the mapping relationship between the IP address and the MAC address including the IP address of the receiver, and determines that the MAC address of the receiver is subsequently generated when it is determined that the locality does not exist.
  • the sender determines that the cache information including the mapping relationship between the IP address and the MAC address of the IP address of the receiver exists locally, the sender directly refers to the MAC address of the receiver corresponding to the IP address of the receiver locally stored, The receiver sends the data.
  • Step 800 The sender obtains the destination network address, that is, the destination IP address.
  • the destination IP address is the IP address of the recipient communicating with the sender.
  • Step 810 The sender determines whether the local destination IP address and destination MAC address mapping exist. The cache information, if yes, proceeds to step 820, otherwise step 830 is performed.
  • Step 820 The sender directly determines the destination MAC address according to the cached destination IP address and the destination MAC address mapping information.
  • the sender can also manage the cache of the local mapping information according to the set rules.
  • the specific rules can be customized, and the present invention does not impose restrictions. For example, the sender can set a certain cache duration, and the local mapping information is exceeded when the cache duration is exceeded. The cache is emptied.
  • Step 830 Synthesize the destination MAC address by using the specified port number (for example, always 0) and the destination IP address.
  • Step 840 Return to the destination MAC address.
  • IP-MAC address resolution designed by the embodiment of the present invention can be applied to the analysis between two other types of addresses, provided that one type of address allows customization, and another type can be synthesized through one type of address. Custom address.
  • an embodiment of the present invention provides another data transmission method.
  • Step 900 The receiver receives the data sent by the sender through a network interface, and obtains the MAC address of the receiver in the data sent by the sender.
  • the sender and the receiver transmit data in the form of an Ethernet frame during the communication process.
  • the receiver can obtain the source MAC address and the destination MAC address by parsing the frame header of the Ethernet frame.
  • the source MAC address is the sender's own MAC address, and the destination MAC address is sent.
  • the MAC address of the receiver generated according to the MAC address of the receiver and the designated port number (for example, always set to 0). If the sender uses the port number 0 to generate the MAC address of the receiver, the receiver will receive the data sent by the sender through the network interface with port number 0.
  • Step 910 The receiver determines the acquired MAC address of the receiver, and interfaces with the network. When the pre-configured MAC addresses are the same, it is confirmed that the data is data transmitted to the recipient.
  • the pre-configured MAC address is a method for the receiver to reconfigure the MAC address, and is generated and configured to the network interface according to the IP address of the receiver and the port number corresponding to the network interface.
  • a single network interface of a host node uses a single IP address and a single MAC address.
  • the two communicating parties are the host node A and the host node B, and it is assumed that the sender of the current data transmission is the host node A, and the receiver is the host node B.
  • Host Node A and Host Node B Prior to communication, Host Node A and Host Node B have reconfigured the MAC address of the network interface in accordance with the MAC synthesis method designed in accordance with the present invention.
  • the MAC address of the network interface is reconfigured to 02:00:C0:A8:01:0A according to the MAC address configuration mechanism designed according to the embodiment of the present invention.
  • the IP address of the network interface of the host node B is 192.168.1.20.
  • the MAC address of the network interface is reconfigured to 02:00:C0:A8:01: 14.
  • the host node A When the host node A wants to send data to the host node B, the host node A synthesizes the corresponding MAC address according to the IP-MAC address resolution mechanism of the embodiment of the present invention, using the IP address 192.168.1.20 and port number 0 of the host node B. Address 02:00: C0: A8: 01: 14 for address resolution.
  • the host node A After synthesizing the destination MAC address, the host node A caches the IP-MAC mapping information of the host node B locally. The destination MAC address in the cache may be used in the next communication with the host node B, or the destination MAC address may be synthesized again. However, once the IP address of the host node B changes, the host node A cannot use the destination MAC address in the cache and must resynthesize the destination MAC address.
  • the plurality of network interfaces after the binding are regarded as one network interface, and the IP-MAC in this case
  • the address resolution process is the same as the above process.
  • Scenario 2 A host node uses multiple network interfaces for binding, sharing IP addresses, but using independent MAC addresses.
  • the two communicating parties are the host node A and the host node B, and it is assumed that the sender of the current data transmission is the host node A, and the receiver is the host node B.
  • Host Node A and Host Node B Prior to communication, Host Node A and Host Node B have reconfigured the MAC address of the network interface in accordance with the MAC synthesis method designed in accordance with the present invention.
  • NIC Network Interface Card
  • NIC-A0 Network Interface Card
  • NIC-A1 Network Interface Card
  • the two network interfaces of the host node B are NIC-B0 and NIC-B1, respectively, which share the IP address 192.168.1.20.
  • the MAC address of the network interface NIC-B0 The address is reconfigured to 02:00:C0:A8:01:14, and the MAC address of the network interface NIC-B1 is reconfigured to 02:01:C0:A8:01:14.
  • the host node A When the host node A wants to send data to the host node B, the host node A synthesizes the corresponding IP address of the host node B by using the IP address 192.168.1.20 and the port number 0 of the host node B according to the IP-MAC address resolution mechanism described in the embodiment of the present invention.
  • IP-MAC address resolution mechanism described in the embodiment of the present invention.
  • the host node A After synthesizing the destination MAC address, the host node A caches the IP-MAC mapping information of the host node B locally. In order to send data to the host node B again, the cached destination MAC address is directly used. Of course, when there is host-side node B's IP-MAC mapping information, the host node A can also synthesize the destination MAC address, but once on the host If the IP address of the node B changes, the host node A cannot use the destination MAC address in the cache, and must resynthesize the destination MAC address.
  • host node A When host node A sends data to host node B (data is in the form of an Ethernet frame), it may use its network interface NIC-A0, or its network interface NIC-A1, assuming its network interface NIC-A1, If host node A does not cache the IP-MAC of host node B locally Mapping information, host node A will use the IP address of host node B and port 0 to synthesize the destination MAC address, and the generated destination MAC address is 02:00:C0:A8:01:14. The Ethernet frame sent by host node A to host node B through network interface NIC-A1 will use destination address MAC address 02:00:C0:A8:01:14, source MAC address 02:01:C0:A8:01:0A .
  • the host node B After receiving the data, the host node B can obtain the MAC address 02:01:C0:A8:01:0A of the host node A according to the data, and cache the mapping information of the IP-MAC address of the host node A locally.
  • the MAC address of the locally cached host node A can be used: 02:01:C0:A8:01:0A.
  • host node B When host node B feeds back data to host node A, it may use its network interface NIC-B0 or its network interface NIC-B1. Assuming that the network interface NIC-B1 is used, when receiving the feedback data of the host node B, the host node A obtains the latest IP-MAC mapping information of the host node B according to the feedback data, and caches it locally.
  • the host node A can determine the destination MAC address according to the latest IP-MAC mapping information of the host node B.
  • the final host node A and the host node B can record all the MAC addresses of the other party and establish a corresponding IP-MAC address mapping cache.
  • the present invention further provides a data transmission apparatus 1200, including:
  • the obtaining unit 1201 is configured to obtain an IP address of the receiver.
  • a synthesizing unit 1202 configured to generate, according to the IP address of the receiver and the specified port number, the MAC address of the receiver;
  • the sending unit 1203 is configured to send data to the receiver based on the generated MAC address of the receiver.
  • the buffer unit 1204 is further configured to:
  • the sending unit 1203 is further configured to:
  • the cache unit locally has cache information including a mapping relationship between the IP address and the MAC address of the IP address of the receiver, based on the MAC address of the receiver corresponding to the IP address of the receiver in the cache message. Sending data to the recipient.
  • the synthesizing unit 1202 when generating the MAC address of the receiver according to the IP address of the receiver and the specified port number, is specifically configured to:
  • the recipient's IP address is recorded in the other bytes of the recipient's MAC address except the highest byte and the next highest byte.
  • the lowest two bits of the highest byte of the MAC address of the device 1200 indicate that the MAC address of the device 1200 is a local unicast address, and the designated port number is recorded in the next highest byte of the MAC address of the device 1200, and the MAC of the device 1200 The IP address of the device is recorded in the other bytes of the address except the highest byte and the next highest byte.
  • the cache unit 1204 is further configured to:
  • the MAC address of the receiver included in the feedback data does not match the generated MAC address of the receiver, acquiring the IP address of the receiver and the The latest mapping relationship of the recipient's MAC address, and caches the latest mapping relationship locally.
  • the specified port number is 0.
  • the specified port is 0. If the port is used for binding of multiple ports and each port shares an IP address but does not share a MAC address, the specified port number is the number of the port.
  • Apparatus 1300 comprising:
  • the receiving unit 1301 is configured to receive data sent by the sender through a network interface
  • the obtaining unit 1302 is configured to obtain, by using data sent by the sender, a MAC address of the receiver.
  • the comparing unit 1303 is configured to: when determining that the acquired MAC address of the receiver is the same as the MAC address pre-configured for the network interface, confirm that the data is data sent to the device 1300;
  • the pre-configured MAC address is generated by the device 1300 according to the IP address of the receiver and the port number corresponding to the network interface, and configured to the network interface.
  • the embodiment of the present invention further provides another data transmission apparatus, including:
  • the processor 1401 is configured to read a program in the memory 1403 and perform the following process:
  • Data is transmitted to the recipient via the transceiver 1402 based on the generated MAC address of the recipient.
  • the transceiver 1402 is configured to send and receive data under the control of the processor 1401.
  • the processor 1401 is further configured to:
  • processor 1401 is further configured to:
  • the cache unit locally has cache information including a mapping relationship between the IP address and the MAC address of the IP address of the receiver, based on the MAC address of the receiver corresponding to the IP address of the receiver in the cache message.
  • the data is transmitted to the recipient via the transceiver 1402.
  • the processor 1401 when generating the MAC address of the receiver according to the IP address of the receiver and the specified port number, the processor 1401 is specifically configured to:
  • the MAC address is a local unicast address, and the specified port number is recorded in the next highest byte of the MAC address of the receiver;
  • the recipient's IP address is recorded in the other bytes of the recipient's MAC address except the highest byte and the next highest byte.
  • the lowest two bits of the highest byte of the MAC address of the data transmission device indicate that the MAC address of the data transmission device is a local unicast address, and the designated port is recorded in the next highest byte of the MAC address of the data transmission device.
  • the IP address of the device is recorded in the other bytes of the MAC address of the data transmission device except the highest byte and the next highest byte.
  • processor 1401 is further configured to:
  • the MAC address of the receiver included in the feedback data does not match the generated MAC address of the receiver, acquiring the IP address of the receiver and the The latest mapping relationship of the recipient's MAC address, and caches the latest mapping relationship locally.
  • the specified port number is 0.
  • the designation The port number is 0. If the port is used for binding of multiple ports and each port shares an IP address but does not share a MAC address, the specified port number is the number of the port.
  • the bus architecture may include any number of interconnected buses and bridges, specifically linked by one or more processors represented by processor 1401 and various circuits of memory represented by memory 1403.
  • the bus architecture can also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and, therefore, will not be further described herein.
  • the bus interface provides an interface.
  • Transceiver 1402 can be a plurality of components, including a transmitter and a receiver, providing means for communicating with various other devices on a transmission medium.
  • the network interface 1404 may also be an interface capable of externally connecting the required devices, including but not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.
  • the processor 1401 is responsible for managing the bus architecture and general processing, and the memory 1403 can store data used by the processor 1401 in performing operations.
  • the embodiment of the present invention further provides another data transmission apparatus, including:
  • the processor 1501 is configured to read a program in the memory 1503 and perform the following process:
  • the pre-configured MAC address is generated by the device according to the IP address of the receiver and the port number corresponding to the network interface 1504, and is configured to the network interface 1504.
  • the bus architecture may include any number of interconnected buses and bridges, specifically linked by one or more processors represented by processor 1501 and various circuits of memory represented by memory 1503.
  • the bus architecture can also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and, therefore, will not be further described herein.
  • the bus interface provides an interface.
  • Transceiver 1502 can be a plurality of components, including a transmitter and a receiver, providing means for communicating with various other devices on a transmission medium.
  • the network interface 1504 may also be an interface capable of externally connecting the required devices, including but not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.
  • the processor 1501 is responsible for managing the bus architecture and general processing, and the memory 1503 can store data used by the processor 1501 when performing operations.
  • the sender acquires the IP address of the receiver, and generates a MAC address of the receiver according to the IP address of the receiver and the specified port number, and the sender is based on the generated MAC address of the receiver.
  • the broadcast communication or directory service communication of IP-MAC address resolution is avoided without adding new hardware and hardware functions, thereby eliminating the bandwidth overhead and communication delay introduced thereby, and improving the availability of Layer 2 Ethernet. Scalability.
  • low cost, low overhead, and high efficiency of IP-MAC address resolution are achieved.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Abstract

Provided in an embodiment of the present invention are a data transmission method and device, for improving IP-MAC address parsing efficiency. The method is: acquiring, by a transmission side, an IP address of a receiving side, and generating, according to the IP address of the receiving side and a designated port number, an MAC address of the receiving party, and transmitting data to the receiving side according to the generated MAC address of the receiving side. Thereby, without adding new hardware or hardware functions, the present invention eliminates an IP-MAC address parsing broadcast communication or directory service communication, as well as a bandwidth overhead and a communication delay introduced thereby, improving expansibility of an Ethernet layer 2. The present invention realizes low costs, low overheads and high efficiency of IP-MAC address parsing.

Description

一种数据传输方法及装置Data transmission method and device 技术领域Technical field
本发明涉及通信技术领域,特别涉及一种数据传输方法及装置。The present invention relates to the field of communications technologies, and in particular, to a data transmission method and apparatus.
背景技术Background technique
在以太网(Ethernet)中,主机节点间单播通信时,发送方的数据首先被封装成互联网协议(Internet Protocol,IP)包,接着再进一步封装成以太网帧,然后从主机节点发出。以太网帧的结构如图1所示,以太网帧头包括源介质访问控制(Media Access Control,MAC)地址和目的MAC地址。其中,源MAC地址是源主机节点网络接口的标识,而目的MAC地址因帧类型而不同,对于单播帧,目的MAC地址是目的主机节点网络接口的标识,为了实现以太网帧的正确转发,不同的网络接口的MAC地址不能发生冲突。In Ethernet (Ethernet), when unicast communication is between host nodes, the sender's data is first encapsulated into an Internet Protocol (IP) packet, which is then further encapsulated into an Ethernet frame and then sent out from the host node. The structure of the Ethernet frame is as shown in FIG. 1. The Ethernet frame header includes a source media access control (MAC) address and a destination MAC address. The source MAC address is the identifier of the network interface of the source host node, and the destination MAC address is different according to the frame type. For the unicast frame, the destination MAC address is the identifier of the network interface of the destination host node. To implement the correct forwarding of the Ethernet frame, The MAC addresses of different network interfaces cannot conflict.
应用双方在进行通信时,通常只知道对方的IP地址和高层协议端口号。为了将IP包进一步封装为以太网帧,发送方需要获得源MAC地址(即发送方主机的本地MAC地址)和目的MAC地址(即接收方主机的MAC地址),发送方主机已知本地的MAC地址,而接收方主机的MAC地址,需要通过目的IP地址去获取。这种通过目的IP地址确定目的MAC地址的方法称为“IP-MAC地址解析”。When the application parties communicate, they usually only know the IP address of the other party and the port number of the upper layer protocol. In order to further encapsulate the IP packet into an Ethernet frame, the sender needs to obtain the source MAC address (ie, the local MAC address of the sender host) and the destination MAC address (ie, the MAC address of the receiver host), and the sender host knows the local MAC address. The address, and the MAC address of the receiving host, needs to be obtained through the destination IP address. This method of determining the destination MAC address by the destination IP address is called "IP-MAC address resolution".
传统的“IP-MAC地址解析”一般通过执行地址解析协议(Address Resolution Protocol,ARP)实现,执行的基本过程如下:The traditional "IP-MAC address resolution" is generally implemented by performing Address Resolution Protocol (ARP). The basic process of execution is as follows:
首先,发送方主机发送一个ARP请求包,用于向同一广播域中的所有主机询问目的IP地址所对应的MAC地址;First, the sender host sends an ARP request packet, which is used to query all hosts in the same broadcast domain for the MAC address corresponding to the destination IP address.
接着,ARP请求包通过网络传输到同一广播域中的所有主机;Then, the ARP request packet is transmitted over the network to all hosts in the same broadcast domain;
然后,收到ARP请求包的某一主机如果发现询问的是自己IP地址的MAC地址,则以单播的方式回复一个ARP响应包,告知询问方自己的MAC地址;Then, if a host that receives the ARP request packet finds that it is the MAC address of its own IP address, it replies with an ARP response packet in a unicast manner, and informs the inquiring party of its own MAC address;
最后,发送方主机收到ARP响应包,获得所询问的IP地址的MAC地址。 Finally, the sender host receives the ARP response packet and obtains the MAC address of the IP address being queried.
例如,参阅图2所示,在一个位于同一个广播域的k+1个主机节点构成的以太网上,节点0执行基于ARP协议的IP-MAC地址解析的过程。假设主机节点0准备与节点2通信,则主机节点0要通过IP-MAC地址解析获得主机节点2的MAC地址。首先,主机节点0发送一个ARP请求包,询问主机节点2的IP地址对应的MAC地址,在该ARP包中携带主机节点0的IP地址和MAC地址以及主机节点2的IP地址;接着,该ARP请求包以以太网广播的方式在网上传输,并到达主机节点1~k;然后,主机节点1~k检查ARP请求包是否在询问自己IP地址对应的MAC地址,结果只有主机节点2发现正询问自己的MAC地址,所以主机节点2向主机节点0回复ARP响应包,该响应包中包括主机节点0的IP地址和MAC地址以及主机节点2的IP地址和MAC地址;最后,节点0收到节点2发来的ARP响应包,获得主机节点2的IP地址对应的MAC地址,至此完成IP-MAC地址解析。For example, referring to FIG. 2, on an Ethernet composed of k+1 host nodes located in the same broadcast domain, node 0 performs an ARP-based IP-MAC address resolution process. Assuming host node 0 is ready to communicate with node 2, host node 0 is to obtain the MAC address of host node 2 by IP-MAC address resolution. First, the host node 0 sends an ARP request packet, and queries the MAC address corresponding to the IP address of the host node 2, and carries the IP address and MAC address of the host node 0 and the IP address of the host node 2 in the ARP packet; then, the ARP The request packet is transmitted on the network by means of Ethernet broadcast, and reaches the host node 1 to k; then, the host node 1 to k checks whether the ARP request packet is inquiring about the MAC address corresponding to its own IP address, and only the host node 2 finds that the inquiry is being made. Its own MAC address, so the host node 2 replies to the host node 0 with an ARP response packet, which includes the IP address and MAC address of the host node 0 and the IP address and MAC address of the host node 2; finally, the node 0 receives the node The ARP response packet sent by 2 obtains the MAC address corresponding to the IP address of the host node 2, and the IP-MAC address resolution is completed.
这种通过广播形式实现MAC地址解析的方式会消耗大量的网络带宽,而且这种开销随着广播域的增大而急剧增长,从而限制单个广播域的网络规模,目前广播通信将单个广播域的以太网限制在数百主机节点的规模。为了构建具有大广播域的大二层以太网,必须消除广播通信。This way of implementing MAC address resolution in broadcast form consumes a large amount of network bandwidth, and this overhead increases sharply with the increase of the broadcast domain, thereby limiting the network size of a single broadcast domain. Currently, broadcast communication will be a single broadcast domain. Ethernet is limited to the size of hundreds of host nodes. In order to build a large Layer 2 Ethernet network with a large broadcast domain, broadcast communication must be eliminated.
目前,为了克服广播通信带来的扩展性问题,在一些数据中心等集中式网络环境中,采用基于目录系统的MAC地址解析。At present, in order to overcome the scalability problem caused by broadcast communication, in some centralized network environments such as data centers, directory-based MAC address resolution is adopted.
该方法的基本原理是目录系统保存当前所有主机节点的IP-MAC映射;当主机节点需要执行IP-MAC地址解析时,直接向目录系统发送单播查询包,询问指定IP地址的MAC地址,然后目录系统直接向主机回复结果。The basic principle of the method is that the directory system saves the IP-MAC mapping of all current host nodes; when the host node needs to perform IP-MAC address resolution, it directly sends a unicast query packet to the directory system, asks for the MAC address of the specified IP address, and then The directory system responds directly to the host with results.
该方法中的目录系统通常有两种实现:一种是独立的服务器或服务器集群实现的目录系统,将该方法称为基于集中式目录服务的IP-MAC地址解析;另一种是基于分布式哈希表(Distributed Hash Table,DHT)的目录系统,IP-MAC映射表可以被分布式地存储在交换机中。The directory system in this method usually has two implementations: one is a directory system implemented by a separate server or server cluster, and the method is called IP-MAC address resolution based on centralized directory service; the other is based on distributed A directory system of the Distributed Hash Table (DHT), the IP-MAC mapping table can be distributedly stored in the switch.
图3显示了基于集中式目录服务的IP-MAC地址解析过程示例。节点k通过向目录系统发送查询包并接收响应包,实现IP-MAC地址解析。 Figure 3 shows an example of an IP-MAC address resolution process based on a centralized directory service. The node k implements IP-MAC address resolution by sending a query packet to the directory system and receiving a response packet.
显然,基于目录服务的IP-MAC地址解析仍要通过节点间通信实现,因此会在应用通信前引入额外的地址解析通信延迟。其次,对于基于集中式目录服务的IP-MAC地址解析,需要额外的硬件构建目录系统,而对于基于分布式目录服务的IP-MAC地址解析,交换机要能存储IP-MAC映射表,并且能够响应查询,因此交换机需要特殊的硬件功能支持。Obviously, directory-based IP-MAC address resolution still needs to be implemented through inter-node communication, so additional address resolution communication delays are introduced before application communication. Secondly, for IP-MAC address resolution based on centralized directory service, additional hardware is needed to build the directory system. For IP-MAC address resolution based on distributed directory service, the switch should be able to store the IP-MAC mapping table and be able to respond. Query, so the switch requires special hardware features to support it.
发明内容Summary of the invention
本发明实施例提供一种数据传输方法及装置,用以在没有增加新的硬件和硬件功能的情况下,消除了IP-MAC地址解析的广播通信或目录服务通信,从而消除了由此引入的带宽开销和通信延迟,提高了二层以太网的可扩展性。Embodiments of the present invention provide a data transmission method and apparatus for eliminating broadcast communication or directory service communication of IP-MAC address resolution without adding new hardware and hardware functions, thereby eliminating the introduction of the data. Bandwidth overhead and communication latency increase the scalability of Layer 2 Ethernet.
第一方面,本发明实施例提供一种数据传输方法,包括:In a first aspect, an embodiment of the present invention provides a data transmission method, including:
发送方获取接收方的IP地址;The sender obtains the IP address of the receiver;
所述发送方根据所述接收方的IP地址和指定的端口号生成所述接收方的MAC地址;Transmitting, by the sender, the MAC address of the receiver according to the IP address of the receiver and the specified port number;
所述发送方基于生成的所述接收方的MAC地址,向所述接收方发送数据。The sender transmits data to the recipient based on the generated MAC address of the recipient.
结合第一方面,在第一方面的第一种可能的实现方式中,所述发送方在生成所述接收方的MAC地址之前,进一步包括:With reference to the first aspect, in a first possible implementation manner of the first aspect, the sending, before the generating the MAC address of the receiver, further includes:
所述发送方确定本地不存在包含所述接收方的IP地址的IP地址和MAC地址的映射关系的缓存信息。The sender determines that there is no cache information of a mapping relationship between the IP address and the MAC address including the IP address of the receiver.
结合第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,进一步包括:In conjunction with the first possible implementation of the first aspect, in a second possible implementation of the first aspect, the method further includes:
若所述发送方确定本地存在包含所述接收方的IP地址的IP地址和MAC地址的映射关系的缓存信息,则基于所述缓存消息中与所述接收方的IP地址对应的接收方的MAC地址,向所述接收方发送数据。If the sender determines that the cache information of the mapping relationship between the IP address and the MAC address of the IP address of the receiver is locally present, based on the MAC address of the receiver corresponding to the IP address of the receiver in the cache message An address that sends data to the recipient.
结合第一方面和第一方面的第一种至第二种可能的实现方式中的任意一种,在第一方面的第三种可能的实现方式中,根据所述接收方的IP地址和指 定的端口号生成所述接收方的MAC地址,包括:In combination with the first aspect and any one of the first to second possible implementations of the first aspect, in a third possible implementation of the first aspect, the IP address and the The determined port number generates the MAC address of the recipient, including:
设置所述接收方的MAC地址的最高字节的最低两位指示所述接收方的MAC地址为局部单播地址,以及将所述指定的端口号记录在所述接收方的MAC地址的次高字节中;Setting a minimum two bits of the highest byte of the MAC address of the receiver indicates that the MAC address of the receiver is a local unicast address, and recording the specified port number to the second highest of the MAC address of the receiver Byte
将所述接收方的IP地址记录在所述接收方的MAC地址的除最高字节和次高字节的其他字节中。The recipient's IP address is recorded in the other bytes of the recipient's MAC address except the highest byte and the next highest byte.
结合第一方面和第一方面的第一种至第三种可能的实现方式中的任意一种,在第一方面的第四种可能的实现方式中,所述发送方的MAC地址中最高字节的最低两位指示所述发送方的MAC地址为局部单播地址,所述发送方的MAC地址的次高字节中记录指定的端口号,所述发送方的MAC地址中除最高字节和次高字节的其他字节中记录所述发送方的IP地址。With reference to the first aspect, and any one of the first to third possible implementation manners of the first aspect, in a fourth possible implementation manner of the first aspect, the highest word in the sender's MAC address The lowest two bits of the section indicate that the MAC address of the sender is a local unicast address, and the specified port number is recorded in the next highest byte of the sender's MAC address, except the highest byte of the sender's MAC address. The sender's IP address is recorded in the other bytes of the next highest byte.
结合第一方面的第一种可能的实现方式,在第一方面的第五种可能的实现方式中,进一步包括:In conjunction with the first possible implementation of the first aspect, in a fifth possible implementation of the first aspect, the method further includes:
在接收到所述接收方的反馈数据时,若所述反馈数据中包含的所述接收方的MAC地址与生成的所述接收方的MAC地址不一致,获取所述接收方的IP地址与所述接收方的MAC地址的最新映射关系,并将所述最新映射关系在本地进行缓存。When receiving the feedback data of the receiver, if the MAC address of the receiver included in the feedback data does not match the generated MAC address of the receiver, acquiring the IP address of the receiver and the The latest mapping relationship of the recipient's MAC address, and caches the latest mapping relationship locally.
结合第一方面的第三种可能的实现方式,在第一方面的第六种可能的实现方式中,所述生成的所述接收方的MAC地址中,所述指定的端口号为0。In conjunction with the third possible implementation of the first aspect, in a sixth possible implementation manner of the first aspect, the specified port number of the received MAC address of the receiver is 0.
结合第一方面的第四种可能的实现方式,在第一方面的第七种可能的实现方式中,若所述发送方的端口为多个端口绑定使用但各端口不共享IP地址或所述端口为多个端口绑定使用且各端口共享IP地址和MAC地址,则所述指定的端口号为0;若所述端口为多个端口绑定使用且各端口共享IP地址但不共享MAC地址,则所述指定的端口号为所述端口的编号。In conjunction with the fourth possible implementation of the first aspect, in a seventh possible implementation manner of the first aspect, if the port of the sender is used for binding multiple ports, each port does not share an IP address or If the port is used for binding multiple ports and each port shares an IP address and a MAC address, the specified port number is 0; if the port is used for binding of multiple ports and each port shares an IP address but does not share a MAC address. Address, the specified port number is the number of the port.
接收方的MAC地址接收方的MAC地址接收方的IP地址。The IP address of the recipient of the MAC address of the recipient's MAC address.
第二方面,本发明实施例还提供一种数据传输装置,包括:In a second aspect, an embodiment of the present invention further provides a data transmission apparatus, including:
获取单元,用于获取接收方的IP地址; An obtaining unit, configured to obtain an IP address of the receiver;
合成单元,用于根据所述接收方的IP地址和指定的端口号生成所述接收方的MAC地址;a synthesizing unit, configured to generate, according to the IP address of the receiver and the specified port number, the MAC address of the receiver;
发送单元,用于基于生成的所述接收方的MAC地址,向所述接收方发送数据。And a sending unit, configured to send data to the receiver based on the generated MAC address of the receiver.
结合第二方面,在第二方面的第一种可能的实现方式中,在所述合成单元生成接收方的MAC地址之前,所述缓存单元进一步用于:With reference to the second aspect, in a first possible implementation manner of the second aspect, before the synthesizing unit generates the MAC address of the receiver, the buffer unit is further configured to:
确定本地不存在包含所述接收方的IP地址的IP地址和MAC地址的映射关系的缓存信息。It is determined that there is no cache information of a mapping relationship between the IP address and the MAC address including the IP address of the recipient.
结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述发送单元进一步用于:In conjunction with the first possible implementation of the second aspect, in a second possible implementation of the second aspect, the sending unit is further configured to:
若所述缓存单元本地存在包含所述接收方的IP地址的IP地址和MAC地址的映射关系的缓存信息,则基于所述缓存消息中与所述接收方的IP地址对应的接收方的MAC地址,向所述接收方发送数据。If the cache unit locally has cache information including a mapping relationship between the IP address and the MAC address of the IP address of the receiver, based on the MAC address of the receiver corresponding to the IP address of the receiver in the cache message. Sending data to the recipient.
结合第二方面和第二方面的第一种至第二种可能的实现方式中的任意一种,在第二方面的第三种可能的实现方式中,在根据所述接收方的IP地址和指定的端口号生成所述接收方的MAC地址时,所述合成单元具体用于:In combination with the second aspect and any one of the first to second possible implementations of the second aspect, in a third possible implementation of the second aspect, in accordance with the IP address of the recipient When the specified port number generates the MAC address of the receiver, the synthesizing unit is specifically configured to:
设置所述接收方的MAC地址的最高字节的最低两位指示所述接收方的MAC地址为局部单播地址,以及将所述指定的端口号记录在所述接收方的MAC地址的次高字节中;Setting a minimum two bits of the highest byte of the MAC address of the receiver indicates that the MAC address of the receiver is a local unicast address, and recording the specified port number to the second highest of the MAC address of the receiver Byte
将所述接收方的IP地址记录在所述接收方的MAC地址的除最高字节和次高字节的其他字节中。The recipient's IP address is recorded in the other bytes of the recipient's MAC address except the highest byte and the next highest byte.
结合第二方面和第二方面的第一种至第三种可能的实现方式中的任意一种,在第二方面的第四种可能的实现方式中,所述装置的MAC地址中最高字节的最低两位指示所述装置的MAC地址为局部单播地址,所述装置的MAC地址的次高字节中记录指定的端口号,所述装置的MAC地址中除最高字节和次高字节的其他字节中记录所述装置的IP地址。With reference to the second aspect and any one of the first to third possible implementation manners of the second aspect, in a fourth possible implementation manner of the second aspect, the highest byte of the MAC address of the device The lowest two bits indicate that the MAC address of the device is a local unicast address, and the specified port number is recorded in the next highest byte of the MAC address of the device, except for the highest byte and the second highest word in the MAC address of the device. The IP address of the device is recorded in the other bytes of the section.
结合第二方面的第一种可能的实现方式,在第二方面的第五种可能的实 现方式中,所述缓存单元进一步用于:In conjunction with the first possible implementation of the second aspect, the fifth possible implementation in the second aspect In the current mode, the cache unit is further configured to:
在接收到所述接收方的反馈数据时,若所述反馈数据中包含的所述接收方的MAC地址与生成的所述接收方的MAC地址不一致,获取所述接收方的IP地址与所述接收方的MAC地址的最新映射关系,并将所述最新映射关系在本地进行缓存。When receiving the feedback data of the receiver, if the MAC address of the receiver included in the feedback data does not match the generated MAC address of the receiver, acquiring the IP address of the receiver and the The latest mapping relationship of the recipient's MAC address, and caches the latest mapping relationship locally.
结合第二方面的第三种可能的实现方式,在第二方面的第六种可能的实现方式中,在所述合成单元生成的所述接收方的MAC地址中,所述指定的端口号为0。With reference to the third possible implementation of the second aspect, in a sixth possible implementation manner of the second aspect, in the MAC address of the receiver generated by the synthesizing unit, the specified port number is 0.
结合第二方面的第四种可能的实现方式,在第二方面的第七种可能的实现方式中,若所述装置的端口为多个端口绑定使用但各端口不共享IP地址或所述端口为多个端口绑定使用且各端口共享IP地址和MAC地址,则所述指定的端口号为0;若所述端口为多个端口绑定使用且各端口共享IP地址但不共享MAC地址,则所述指定的端口号为所述端口的编号。In conjunction with the fourth possible implementation of the second aspect, in a seventh possible implementation manner of the second aspect, if the port of the device is used for multiple port bonding, each port does not share an IP address or the If the port is used for binding to multiple ports and each port shares an IP address and a MAC address, the specified port number is 0. If the port is bound to multiple ports and each port shares an IP address but does not share a MAC address. , the specified port number is the number of the port.
第三方面,本发明实施例还提供另一种数据传输装置,包括网络接口、存储器以及处理器,其中,所述存储器中存储一组程序,且所述处理器用于调用所述存储器中存储的程序,使得所述数据传输装置执行如第一方面和第一方面的第一种至第七种可能的实现方式中的任意一种所述的方法。In a third aspect, the embodiment of the present invention further provides another data transmission apparatus, including a network interface, a memory, and a processor, wherein the memory stores a set of programs, and the processor is configured to invoke the storage in the memory. The program, causing the data transmission device to perform the method of any one of the first to seventh possible implementations of the first aspect and the first aspect.
本发明实施例提供的数据传输方法中,在没有增加新的硬件和硬件功能的情况下,避免了IP-MAC地址解析的广播通信或目录服务通信,消除了相应的网络带宽开销和通信延迟,从而提高了IP-MAC地址解析的效率。同时,通过消除广播通信,有助于提高二层以太网的可扩展性。In the data transmission method provided by the embodiment of the present invention, the broadcast communication or the directory service communication of the IP-MAC address resolution is avoided without adding new hardware and hardware functions, and the corresponding network bandwidth overhead and communication delay are eliminated. Thereby improving the efficiency of IP-MAC address resolution. At the same time, it helps to improve the scalability of Layer 2 Ethernet by eliminating broadcast communication.
附图说明DRAWINGS
图1为现有技术中以太网帧结构示意图;1 is a schematic structural diagram of an Ethernet frame in the prior art;
图2为现有技术中基于ARP协议的IP-MAC地址解析示意图;2 is a schematic diagram of IP-MAC address resolution based on ARP protocol in the prior art;
图3为现有技术中基于集中式目录服务的IP-MAC地址解析示意图;3 is a schematic diagram of IP-MAC address resolution based on a centralized directory service in the prior art;
图4为现有技术中MAC地址格式示意图; 4 is a schematic diagram of a MAC address format in the prior art;
图5为本发明实施例中一种MAC地址合成方式的示意图;FIG. 5 is a schematic diagram of a MAC address synthesizing manner according to an embodiment of the present invention; FIG.
图6为本发明实施例中MAC地址的配置机制流程图;6 is a flowchart of a MAC address configuration mechanism according to an embodiment of the present invention;
图7为本发明实施例中一种数据传输流程图;FIG. 7 is a flowchart of data transmission according to an embodiment of the present invention;
图8为本发明实施例中IP-MAC地址解析流程图;FIG. 8 is a flowchart of analyzing an IP-MAC address according to an embodiment of the present invention;
图9为本发明实施例中另一种数据传输流程图;FIG. 9 is a flowchart of another data transmission according to an embodiment of the present invention; FIG.
图10为本发明实施例中场景一的IP-MAC地址解析示意图;FIG. 10 is a schematic diagram of IP-MAC address resolution of scenario 1 according to an embodiment of the present invention;
图11为本发明实施例中场景二的IP-MAC地址解析示意图;FIG. 11 is a schematic diagram of IP-MAC address resolution of scenario 2 according to an embodiment of the present invention;
图12-图15为本发明实施例中数据传输装置结构图。12 to FIG. 15 are structural diagrams of a data transmission apparatus according to an embodiment of the present invention.
具体实施方式detailed description
本发明实施例设计了一种数据传输方法及装置,本发明实施例中的方法为:基于一种结构化MAC地址的合成方法,通过将主机MAC地址进行重配置,在主机节点间通信过程中,发送方主机按照该结构化MAC地址的合成方法,按照接收方主机的IP地址合成接收方主机的MAC地址,然后根据合成的接收方主机的MAC地址,向接收方主机发送数据。这样,在没有增加新的硬件和硬件功能的情况下,避免了IP-MAC地址解析的广播通信或目录服务通信,消除了相应的网络带宽开销和通信延迟,从而提高了IP-MAC地址解析的效率。同时,通过消除广播通信,有助于提高二层以太网的可扩展性。The embodiment of the present invention provides a data transmission method and device. The method in the embodiment of the present invention is: based on a structured MAC address synthesis method, by reconfiguring a host MAC address, in a communication process between host nodes According to the method for synthesizing the structured MAC address, the sender host synthesizes the MAC address of the receiver host according to the IP address of the receiver host, and then sends data to the receiver host according to the synthesized MAC address of the receiver host. In this way, the broadcast communication or directory service communication of IP-MAC address resolution is avoided without adding new hardware and hardware functions, and the corresponding network bandwidth overhead and communication delay are eliminated, thereby improving IP-MAC address resolution. effectiveness. At the same time, it helps to improve the scalability of Layer 2 Ethernet by eliminating broadcast communication.
下面结合说明书附图对本发明优选的实施方式进行详细说明。Preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
现代操作系统(例如Windows、Linux等)允许用户通过软件的方法修改网络接口的MAC地址,并且主机节点网络接口的MAC地址的唯一作用是作为唯一标识,因此在数据中心等集中式的内联网场景下可以有序地分配和管理每个主机节点的网络接口的MAC地址来避免MAC地址冲突。另外,以太网内MAC地址允许用户自定义,例如,局部单播MAC地址的最高字节的最低两位有特殊含义外,其他字节均可自定义。Modern operating systems (such as Windows, Linux, etc.) allow users to modify the MAC address of the network interface through software methods, and the only role of the MAC address of the host node's network interface is as a unique identifier, so in a centralized intranet scenario such as a data center. The MAC address of the network interface of each host node can be allocated and managed in an orderly manner to avoid MAC address conflicts. In addition, the MAC address in the Ethernet allows the user to customize. For example, the lowest two bits of the highest byte of the local unicast MAC address have special meanings, and other bytes can be customized.
于此,本发明实施例设计了一种结构化MAC地址合成方法,基于指定的端口号和网络地址(即IP地址)合成MAC地址。 Herein, the embodiment of the present invention designs a structured MAC address synthesis method, which synthesizes a MAC address based on a specified port number and a network address (ie, an IP address).
其中,端口号是指共享同一IP地址的多个网络接口的序号。当单个网络接口使用单个IP地址时,该网络接口的端口号始终设置为指定值(例如,始终设置为0);当多个网络接口绑定使用,并且绑定使用的多个网络接口共享单个IP地址和MAC地址时,将绑定使用的多个网络接口看作一个网络接口,该绑定使用的多个网络接口的端口号同样始终设置为指定值(例如,始终设置为0);当多个网络接口绑定使用,并且绑定使用的多个网络接口共享单个IP地址,但每个网络接口使用独立的MAC地址时,则多个网络接口的端口号设置为相应的编号,编号从0开始,依次加1,即,多个网络接口的端口号依次设置为0,1,……。The port number refers to the serial number of multiple network interfaces sharing the same IP address. When a single network interface uses a single IP address, the port number of the network interface is always set to the specified value (for example, always set to 0); when multiple network interface bindings are used, and multiple network interfaces used by the binding share a single When IP address and MAC address are used, the multiple network interfaces used by the binding are regarded as one network interface. The port numbers of multiple network interfaces used by the binding are also always set to the specified value (for example, always set to 0); Multiple network interfaces are used for binding, and multiple network interfaces used for binding share a single IP address, but when each network interface uses a separate MAC address, the port numbers of multiple network interfaces are set to corresponding numbers, and the number is from Starting with 0, add 1 in turn, that is, the port numbers of multiple network interfaces are set to 0, 1, ....
如图4所示,以太网MAC地址采用MAC-48的格式。它由6个字节组成,共48位。高24位是组织唯一标识符(Organizationally Unique Identifier,OUI),低24位是扩展唯一标识符(Extended Unique Identifier,EUI),以太网规定了自己使用MAC地址的方法。以太网保留了MAC地址中的最高字节的低2位用于特殊用途,其中,最高字节的最低位用于表示单播(b0=0)或组播(b0=1)地址;最高字节的次低位用于表示全局管理地址(b1=0)或局部管理地址(b1=1)。当被指定为局部管理地址时,MAC地址可以由本地管理员自己分配。As shown in Figure 4, the Ethernet MAC address is in the MAC-48 format. It consists of 6 bytes for a total of 48 bits. The upper 24 bits are the Organizationally Unique Identifier (OUI), and the lower 24 bits are the Extended Unique Identifier (EUI). The Ethernet specifies the method of using the MAC address. Ethernet retains the lower 2 bits of the highest byte in the MAC address for special purposes, where the lowest bit of the highest byte is used to indicate unicast (b0=0) or multicast (b0=1) address; highest word The next lower bit of the section is used to indicate the global management address (b1=0) or the local management address (b1=1). When specified as a local management address, the MAC address can be assigned by the local administrator.
本发明实施例中合成的MAC地址是分配给网络接口使用的,所以设定MAC地址中最高字节的最低两位为2’b10,即,设定MAC地址为局部单播MAC地址,除最高字节的最低两位有特殊含义为,其他字节均可自定义,可将端口号和IP地址记录在可自定义的字节上。The MAC address synthesized in the embodiment of the present invention is allocated to the network interface, so the lowest two bits of the highest byte in the MAC address are set to 2'b10, that is, the MAC address is set as the local unicast MAC address, except the highest. The lowest two bits of a byte have the special meaning that other bytes can be customized, and the port number and IP address can be recorded on a customizable byte.
其中,可将端口号记录在MAC地址的最高字节除最低两位的其他位以及次高字节中,将IP地址记录在MAC地址的除最高字节和次高字节的其他字节中;也可以将端口号和IP地址按任意指定的方式记录在除最高字节的最低两位之外的字节上。也就是MAC地址自定义设置的方式并不唯一。另外,MAC地址中的所有MAC地址位可以不全使用,即可以保留部分MAC地址位可使用于其他确定的含义和用途。 Wherein, the port number can be recorded in the other byte of the lowest byte of the MAC address except the lowest two bits and the next highest byte, and the IP address is recorded in the other bytes of the MAC address except the highest byte and the next highest byte. The port number and IP address can also be recorded in any specified manner on bytes other than the lowest two bits of the highest byte. That is, the way the MAC address is customized is not unique. In addition, all MAC address bits in the MAC address may not be fully used, that is, some MAC address bits may be reserved for other determined meanings and uses.
参阅图5所示,为本发明实施例MAC地址合成的一种示例。将端口号记录在MAC地址的次高字节中,例如记录在B4字节,将网络地址(IP地址)记录在MAC地址的4个低字节中,例如,记录在B0-B3四个字节。Referring to FIG. 5, it is an example of MAC address synthesis according to an embodiment of the present invention. Record the port number in the next highest byte of the MAC address, for example, in the B4 byte, and record the network address (IP address) in the 4 low bytes of the MAC address. For example, record the four words in B0-B3. Section.
基于上述MAC地址合成的方法,可以根据IP地址和网络接口的端口号合成对应的MAC地址,可以实现IP地址和MAC地址之间规则的映射关系。Based on the foregoing method for synthesizing the MAC address, the corresponding MAC address can be synthesized according to the IP address and the port number of the network interface, and the mapping relationship between the IP address and the MAC address can be implemented.
基于上述MAC地址合成的方法,本发明实施例设计了一种MAC地址的配置机制,主要思想是,根据本发明实施例提供的MAC地址合成方法,在通信之前,将主机节点网络接口的MAC地址进行重配置。参阅图6所示,具体过程如下所述。Based on the foregoing method for synthesizing MAC addresses, the embodiment of the present invention provides a MAC address configuration mechanism. The main idea is that, according to the MAC address synthesizing method provided by the embodiment of the present invention, the MAC address of the network interface of the host node is used before the communication. Reconfigure. Referring to Figure 6, the specific process is as follows.
步骤600:系统启动后,进行端口初始化。Step 600: After the system is started, port initialization is performed.
步骤610:获取网络地址。Step 610: Obtain a network address.
人工获取或通过原MAC自动获取网络地址。Manually obtain or automatically obtain the network address through the original MAC.
步骤620:判断是否多个网络接口绑定使用,并共享网络地址。若是,则执行步骤630,否则执行步骤640。Step 620: Determine whether multiple network interfaces are used in combination and share the network address. If yes, go to step 630, otherwise go to step 640.
步骤630:进一步判断绑定使用的多个网络接口是否共享MAC地址。若是,则执行步骤650,否则,执行步骤660。Step 630: Further determine whether the plurality of network interfaces used by the binding share the MAC address. If yes, go to step 650; otherwise, go to step 660.
步骤640:采用端口号0和网络地址合成MAC地址,并重写网络接口的MAC地址。Step 640: Synthesize the MAC address by using port number 0 and the network address, and rewrite the MAC address of the network interface.
具体地,在此种情况下,单个网络接口使用单个网络地址,则将单个网络接口的端口号始终设置为0,再采用端口号0和网络地址合成MAC地址。Specifically, in this case, if a single network interface uses a single network address, the port number of a single network interface is always set to 0, and then the port number 0 and the network address are used to synthesize the MAC address.
步骤650:采用端口号0和网络地址合成MAC地址,并重写网络接口的MAC地址。Step 650: Synthesize the MAC address by using port number 0 and the network address, and rewrite the MAC address of the network interface.
具体地,在此种情况下,绑定使用的多个网络接口共享网络地址以及共享MAC地址,可将绑定使用的多个网络接口看作一个网络接口,将绑定使用的多个网络接口的端口号都始终设置为0,再采用端口号0和共享的网络地址合成MAC地址,于此,可以根据该共享的网络地址唯一的确定合成后的MAC地址。 Specifically, in this case, multiple network interfaces used for binding share a network address and a shared MAC address, and multiple network interfaces used for binding can be regarded as one network interface, and multiple network interfaces to be bound are used. The port number is always set to 0, and then the port number is 0 and the shared network address is used to synthesize the MAC address. Here, the synthesized MAC address can be uniquely determined according to the shared network address.
步骤660:针对每个网络接口i,采用端口号i和网络地址分别合成MAC地址,并重写每个网络接口的MAC地址。Step 660: For each network interface i, respectively synthesize the MAC address by using the port number i and the network address, and rewrite the MAC address of each network interface.
具体地,在此种情况下,绑定使用的多个网络接口共享单个网络地址,但每个网络接口使用独立的MAC地址,则为每一个网络接口按序分配端口号,例如,分别分配端口号0、1、……,相应地,针对每个网络接口i,采用相应的端口号i和共享的网络地址合成MAC地址,这样,每一个网络接口都对应一个合成的MAC地址。其中,每一个网络接口对应的MAC地址的结构至少存在端口号不同的区别。于此,可以根据共享的网络地址映射到每一个合成后的MAC地址。Specifically, in this case, multiple network interfaces used by the binding share a single network address, but each network interface uses a separate MAC address, and the port number is assigned sequentially for each network interface, for example, respectively. No. 0, 1, ..., correspondingly, for each network interface i, the corresponding port number i and the shared network address are used to synthesize the MAC address, so that each network interface corresponds to a synthesized MAC address. The structure of the MAC address corresponding to each network interface has at least a difference in port number. Here, each synthesized MAC address can be mapped according to the shared network address.
步骤670:判断网络地址是否发生改变,若是,则返回执行步骤620,否则,重复执行步骤670。Step 670: Determine whether the network address has changed. If yes, return to step 620. Otherwise, repeat step 670.
具体地,若网络地址发生改变,则根据变化后的网络地址按照上述方法重新配置网络接口的MAC地址,以及时更新MAC地址的配置,以及,及时更新IP地址与MAC地址的映射关系。Specifically, if the network address is changed, the MAC address of the network interface is reconfigured according to the changed network address according to the above method, the configuration of the MAC address is updated, and the mapping relationship between the IP address and the MAC address is updated in time.
基于上述MAC地址合成方法和重配置机制,参阅图7所示,本发明实施例的数据传输方法如下所述:Based on the foregoing MAC address synthesizing method and reconfiguration mechanism, referring to FIG. 7, the data transmission method according to the embodiment of the present invention is as follows:
步骤700:发送方获取接收方的IP地址。Step 700: The sender obtains the IP address of the receiver.
具体地,在主机节点间进行通信时,发送方(也可称为源主机节点)已知目的IP地址,该目的IP地址即接收方(也可称为目的主机节点)IP地址。Specifically, when communicating between host nodes, the sender (which may also be referred to as a source host node) knows the destination IP address, which is the IP address of the receiver (which may also be referred to as the destination host node).
步骤710:发送方根据接收方的IP地址和指定的端口号(比如,指定的端口号始终设置为0)生成接收方的MAC地址。Step 710: The sender generates the MAC address of the receiver according to the IP address of the receiver and the specified port number (for example, the specified port number is always set to 0).
具体地,发送方在获得目的IP地址后,需要根据目的IP地址确定目的MAC地址,该目的MAC地址即接收方的MAC地址。由目的IP地址确定目的MAC地址的过程即IP-MAC地址解析。传统的IP-MAC地址解析需经过节点间通信过程完成,而通过本发明实施例设计的MAC地址合成方法,基于接收方的IP地址直接生成接收方的MAC地址,省去节点间通信的过程,提高了IP-MAC地址解析的效率。 Specifically, after obtaining the destination IP address, the sender needs to determine the destination MAC address according to the destination IP address, where the destination MAC address is the MAC address of the receiver. The process of determining the destination MAC address by the destination IP address is IP-MAC address resolution. The traditional IP-MAC address resolution needs to be completed through the inter-node communication process. The MAC address synthesis method designed by the embodiment of the present invention directly generates the MAC address of the receiver based on the IP address of the receiver, thereby eliminating the process of communication between the nodes. Improve the efficiency of IP-MAC address resolution.
其中,接收方的MAC地址合成方法包括:The method for synthesizing the MAC address of the receiver includes:
设置接收方的MAC地址的最高字节的最低两位指示接收方的MAC地址为局部单播地址,以及将指定的端口号记录在接收方的MAC地址的次高字节中,将接收方IP地址进行格式转换后记录在接收方的MAC地址的除最高字节和次高字节的其他字节中。Setting the lowest two bits of the highest byte of the receiver's MAC address indicates that the recipient's MAC address is a local unicast address, and recording the specified port number in the next highest byte of the receiver's MAC address, the recipient IP The address is formatted and recorded in the other bytes except the highest byte and the next highest byte of the recipient's MAC address.
上述接收方的MAC地址的合成方法只是一个优选的方案,另外还可以采用以下合成方法。The method for synthesizing the MAC address of the above-mentioned receiver is only a preferred solution, and the following synthesis method can also be employed.
设置接收方的MAC地址的最高字节的最低两位指示接收方的MAC地址为局部单播地址,以及将指定的端口号和接收方的IP地址记录在接收方的MAC地址的除最高字节的最低两位之外的其他任意指定的字节中。Setting the lowest two bits of the highest byte of the recipient's MAC address indicates that the recipient's MAC address is a local unicast address, and recording the specified port number and the recipient's IP address in the highest byte of the recipient's MAC address. The lowest two digits are in the arbitrarily specified bytes.
接收方预先根据本发明设计的MAC地址合成方法将网络接口的MAC地址进行重配置,而发送方在与接收方进行通信时,发送方也按照本发明设计的MAC地址合成方法,根据接收方的IP地址和指定的接收方端口号合成接收方的MAC地址,从而实现根据接收方的IP地址获取接收方的MAC地址的过程,即完成IP-MAC地址解析。The receiving party pre-configures the MAC address of the network interface according to the MAC address synthesis method designed in accordance with the present invention, and when the sender communicates with the receiver, the sender also performs the MAC address synthesis method according to the present invention, according to the receiver The IP address and the specified receiver port number are combined with the MAC address of the receiver, so that the process of obtaining the MAC address of the receiver according to the IP address of the receiver is completed, that is, the IP-MAC address resolution is completed.
指定的接收方端口号可以设置为根据协议规定的端口号,例如,可以设置为0。当接收方为绑定使用的多个网络接口共享IP地址,并且每一个网络接口使用独立的MAC地址时,每一个网络接口都重配置了一个合成后的MAC地址,而发送方合成的接收方的MAC地址中,可将接收方端口号始终设置为0。The specified recipient port number can be set to the port number specified by the protocol, for example, can be set to 0. When the receiver shares IP addresses for multiple network interfaces used for binding, and each network interface uses a separate MAC address, each network interface is reconfigured with a synthesized MAC address, and the sender synthesizes the receiver. In the MAC address, the recipient port number can always be set to 0.
发送方在合成接收方的MAC地址后,将接收方的IP地址与接收方的MAC地址的映射关系在本地进行缓存。After the sender synthesizes the MAC address of the receiver, the sender caches the mapping between the IP address of the receiver and the MAC address of the receiver locally.
步骤720:发送方基于生成的接收方的MAC地址,向接收方发送数据。Step 720: The sender sends data to the receiver based on the generated MAC address of the recipient.
具体地,发送方向接收方发送的数据中包含其生成的接收方的MAC地址,以及发送方自身的MAC地址。Specifically, the data sent by the sender to the receiver includes the MAC address of the receiver that it generates, and the sender's own MAC address.
其中,发送方的MAC地址根据本发明实施例的MAC地址合成方法合成后预先配置到本地网络接口的。 The MAC address of the sender is pre-configured to the local network interface according to the MAC address synthesis method of the embodiment of the present invention.
发送方的MAC地址中最高字节的最低两位指示发送方MAC地址为局部单播地址,发送方的MAC地址的次高字节中记录指定的端口号,发送方的MAC地址中除最高字节和次高字节的其他字节中记录发送方的IP地址。The lowest two bits of the highest byte of the sender's MAC address indicate that the sender's MAC address is a local unicast address, and the specified port number is recorded in the next highest byte of the sender's MAC address, except for the highest word in the sender's MAC address. The sender's IP address is recorded in the other bytes of the section and the next highest byte.
若发送方的端口为多个端口绑定使用但各端口不共享IP地址或端口为多个端口绑定使用且各端口共享IP地址和MAC地址,则指定的端口号为0;若端口为多个端口绑定使用且各端口共享IP地址但不共享MAC地址,则指定的端口号为端口的编号。If the port of the sender is bound to multiple ports but each port does not share an IP address or the port is used for multiple port bindings and each port shares an IP address and a MAC address, the specified port number is 0; if the port is more If a port is used for binding and each port shares an IP address but does not share a MAC address, the specified port number is the port number.
进一步地,在接收到接收方的反馈数据时,若反馈数据中包含的接收方的MAC地址与生成的接收方的MAC地址不一致,获取接收方的IP地址与接收方的MAC地址的最新映射关系,并将最新映射关系在本地进行缓存。Further, when receiving the feedback data of the receiver, if the MAC address of the receiver included in the feedback data does not match the MAC address of the generated receiver, the latest mapping relationship between the IP address of the receiver and the MAC address of the receiver is obtained. And cache the latest mappings locally.
其中,接收方的反馈数据中,携带有接收方自身的IP地址以及MAC地址,该反馈数据中携带的MAC地址可能与发送方之前合成的MAC地址相同,也可能不同。例如,当接收方绑定使用多个网络接口共享IP地址,且使用独立MAC地址时,每一个网络接口都使用独立的MAC地址,发送方始终按照端口号0来生成接收方的MAC地址,那么,当接收方使用端口号1来反馈数据时,则发送方接收到接收方的反馈数据后,将最新的接收方的IP地址与接收方的MAC地址的映射关系在本地缓存。The receiving party's feedback data carries the recipient's own IP address and MAC address. The MAC address carried in the feedback data may be the same as or different from the MAC address synthesized by the sender. For example, when the receiver binds to use multiple network interfaces to share IP addresses and uses independent MAC addresses, each network interface uses a separate MAC address, and the sender always generates the recipient's MAC address according to port number 0, then When the receiver uses the port number 1 to feed back the data, the sender receives the feedback data of the receiver and caches the mapping relationship between the latest recipient's IP address and the recipient's MAC address.
另外,在步骤710之前,发送方检查本地是否存在包含接收方的IP地址的IP地址和MAC地址的映射关系的缓存信息,以及在确定本地不存在时,确定后续生成接收方的MAC地址。In addition, before step 710, the sender checks whether there is cache information of the mapping relationship between the IP address and the MAC address including the IP address of the receiver, and determines that the MAC address of the receiver is subsequently generated when it is determined that the locality does not exist.
其中,若发送方确定本地存在包含接收方的IP地址的IP地址和MAC地址的映射关系的缓存信息,则直接基于本地存储的与接收方的IP地址对应的接收方的MAC地址,向所述接收方发送数据。Wherein, if the sender determines that the cache information including the mapping relationship between the IP address and the MAC address of the IP address of the receiver exists locally, the sender directly refers to the MAC address of the receiver corresponding to the IP address of the receiver locally stored, The receiver sends the data.
参阅图8所示,上述IP-MAC地址解析的流程如下:Referring to FIG. 8, the flow of the above IP-MAC address resolution is as follows:
步骤800:发送方获取目的网络地址,即目的IP地址。Step 800: The sender obtains the destination network address, that is, the destination IP address.
目的IP地址是与发送方通信的接收方的IP地址。The destination IP address is the IP address of the recipient communicating with the sender.
步骤810:发送方判断本地是否存在目的IP地址与目的MAC地址映射 的缓存信息,若是,则执行步骤820,否则执行步骤830。Step 810: The sender determines whether the local destination IP address and destination MAC address mapping exist. The cache information, if yes, proceeds to step 820, otherwise step 830 is performed.
步骤820:发送方根据缓存的目的IP地址与目的MAC地址映射信息,直接确定目的MAC地址。Step 820: The sender directly determines the destination MAC address according to the cached destination IP address and the destination MAC address mapping information.
其中,一般情况,本地只有一条目的IP地址与目的MAC地址映射信息的缓存,如果有多条缓存,则根据一定的预设规则选取其中一条,确定目的MAC地址。发送方还可以根据设定的规则对本地映射信息的缓存进行管理,具体规则的可自定义,本发明不做限制,例如,发送方可设置一定缓存时长,超过该缓存时长时将本地映射信息的缓存清空。Generally, in the local area, there is only one cache of mapping information between the destination IP address and the destination MAC address. If there are multiple caches, one of them is selected according to a certain preset rule to determine the destination MAC address. The sender can also manage the cache of the local mapping information according to the set rules. The specific rules can be customized, and the present invention does not impose restrictions. For example, the sender can set a certain cache duration, and the local mapping information is exceeded when the cache duration is exceeded. The cache is emptied.
步骤830:采用指定的端口号(比如,始终为0)和目的IP地址合成目的MAC地址。Step 830: Synthesize the destination MAC address by using the specified port number (for example, always 0) and the destination IP address.
步骤840:返回目的MAC地址。Step 840: Return to the destination MAC address.
至此,本发明实施例的IP-MAC地址解析的过程介绍完毕。So far, the process of IP-MAC address resolution in the embodiment of the present invention has been completed.
需要说明的是,本发明实施例设计的IP-MAC地址解析的方法可应用于其他两类地址之间解析,前提是其中一类地址允许自定义,则可通过一类地址合成另一类可自定义的地址。It should be noted that the method for IP-MAC address resolution designed by the embodiment of the present invention can be applied to the analysis between two other types of addresses, provided that one type of address allows customization, and another type can be synthesized through one type of address. Custom address.
基于同一发明构思,参阅图9所示,本发明实施例提供了另一种数据传输方法。Based on the same inventive concept, referring to FIG. 9, an embodiment of the present invention provides another data transmission method.
步骤900:接收方通过一个网络接口接收发送方发送的数据,并在发送方发送的数据中,获取接收方的MAC地址。Step 900: The receiver receives the data sent by the sender through a network interface, and obtains the MAC address of the receiver in the data sent by the sender.
其中,发送方与接收方在通信过程中,是以以太网帧的形式传输数据的。接收方在接收到发送方发送的以太网帧时,通过解析以太网帧的帧头,可以获取源MAC地址和目的MAC地址,源MAC地址即发送方自身的MAC地址,而目的MAC地址为发送方基于本发明实施例中的MAC地址合成方法,根据接收方的MAC地址和指定端口号(例如始终设置为0)生成的接收方的MAC地址。若发送方使用端口号0生成接收方的MAC地址,则接收方会通过端口号为0的网络接口接收发送方发送的数据。The sender and the receiver transmit data in the form of an Ethernet frame during the communication process. When receiving the Ethernet frame sent by the sender, the receiver can obtain the source MAC address and the destination MAC address by parsing the frame header of the Ethernet frame. The source MAC address is the sender's own MAC address, and the destination MAC address is sent. Based on the MAC address synthesis method in the embodiment of the present invention, the MAC address of the receiver generated according to the MAC address of the receiver and the designated port number (for example, always set to 0). If the sender uses the port number 0 to generate the MAC address of the receiver, the receiver will receive the data sent by the sender through the network interface with port number 0.
步骤910:接收方在确定获取的接收方的MAC地址,与针对该网络接口 预配的MAC地址相同时,确认该数据为发送给所述接收方的数据。Step 910: The receiver determines the acquired MAC address of the receiver, and interfaces with the network. When the pre-configured MAC addresses are the same, it is confirmed that the data is data transmitted to the recipient.
其中,预配的MAC地址是接收方采用上述MAC地址重配置的方法,根据接收方的IP地址和该网络接口对应的端口号生成并配置到所述网络接口的。The pre-configured MAC address is a method for the receiver to reconfigure the MAC address, and is generated and configured to the network interface according to the IP address of the receiver and the port number corresponding to the network interface.
下面结合具体的应用场景对本发明实施例作进一步详细的说明。The embodiments of the present invention are further described in detail below in conjunction with specific application scenarios.
场景一、一个主机节点的单个网络接口使用单个IP地址和单个MAC地址。Scenario 1. A single network interface of a host node uses a single IP address and a single MAC address.
参阅图10所示,通信双方为主机节点A和主机节点B,假设当前数据传输的发送方为主机节点A,接收方为主机节点B。在通信之前,主机节点A和主机节点B已根据本发明设计的MAC合成方法将网络接口的MAC地址进行重配置。Referring to FIG. 10, the two communicating parties are the host node A and the host node B, and it is assumed that the sender of the current data transmission is the host node A, and the receiver is the host node B. Prior to communication, Host Node A and Host Node B have reconfigured the MAC address of the network interface in accordance with the MAC synthesis method designed in accordance with the present invention.
假设主机节点A的网络接口的IP地址为192.168.1.10,根据本发明实施例设计的MAC地址的配置机制,其网络接口的MAC地址被重配为02:00:C0:A8:01:0A;主机节点B的网络接口的IP地址为192.168.1.20,同理,根据本发明实施例设计的MAC地址的配置机制,其网络接口的MAC地址被重配为02:00:C0:A8:01:14。Assuming that the IP address of the network interface of the host node A is 192.168.1.10, the MAC address of the network interface is reconfigured to 02:00:C0:A8:01:0A according to the MAC address configuration mechanism designed according to the embodiment of the present invention; The IP address of the network interface of the host node B is 192.168.1.20. Similarly, according to the MAC address configuration mechanism designed according to the embodiment of the present invention, the MAC address of the network interface is reconfigured to 02:00:C0:A8:01: 14.
当主机节点A要向主机节点B发送数据时,主机节点A根据本发明实施例所述的IP-MAC地址解析机制,采用主机节点B的IP地址192.168.1.20和端口号0,合成对应的MAC地址02:00:C0:A8:01:14,实现地址解析。When the host node A wants to send data to the host node B, the host node A synthesizes the corresponding MAC address according to the IP-MAC address resolution mechanism of the embodiment of the present invention, using the IP address 192.168.1.20 and port number 0 of the host node B. Address 02:00: C0: A8: 01: 14 for address resolution.
主机节点A在合成目的MAC地址后,将主机节点B的IP-MAC映射信息在本地缓存。可在下次与主机节点B的通信过程中,使用缓存中目的MAC地址,也可再次合成目的MAC地址。但是,一旦在主机节点B的IP地址改变,则主机节点A不能使用缓存中的目的MAC地址,必须重新合成目的MAC地址。After synthesizing the destination MAC address, the host node A caches the IP-MAC mapping information of the host node B locally. The destination MAC address in the cache may be used in the next communication with the host node B, or the destination MAC address may be synthesized again. However, once the IP address of the host node B changes, the host node A cannot use the destination MAC address in the cache and must resynthesize the destination MAC address.
其中,当同一主机节点的多个网络接口绑定使用,并同时共享单个IP和单个MAC地址时,将绑定后的多个网络接口视为一个网络接口看待,此种情况下的IP-MAC地址解析过程与上述过程相同。 Wherein, when multiple network interfaces of the same host node are used in combination and share a single IP address and a single MAC address, the plurality of network interfaces after the binding are regarded as one network interface, and the IP-MAC in this case The address resolution process is the same as the above process.
场景二、一个主机节点多个网络接口绑定使用,共享IP地址,但使用独立的MAC地址。Scenario 2: A host node uses multiple network interfaces for binding, sharing IP addresses, but using independent MAC addresses.
参阅图11所示,通信双方为主机节点A和主机节点B,假设当前数据传输的发送方为主机节点A,接收方为主机节点B。在通信之前,主机节点A和主机节点B已根据本发明设计的MAC合成方法对网络接口的MAC地址进行重配置。Referring to FIG. 11, the two communicating parties are the host node A and the host node B, and it is assumed that the sender of the current data transmission is the host node A, and the receiver is the host node B. Prior to communication, Host Node A and Host Node B have reconfigured the MAC address of the network interface in accordance with the MAC synthesis method designed in accordance with the present invention.
假设主机节点A的两个网络接口分别为网络接口卡(Network Interface Card,NIC)NIC-A0和NIC-A1,它们共享IP地址192.168.1.10,但使用独立的MAC地址。根据本发明实施例中的MAC地址的配置机制,网络的接口NIC-A0的MAC地址被重配为02:00:C0:A8:01:0A,网络的接口NIC-A1的MAC地址被重配为02:01:C0:A8:01:0A;Assume that the two network interfaces of host node A are Network Interface Card (NIC) NIC-A0 and NIC-A1, which share the IP address 192.168.1.10, but use a separate MAC address. According to the MAC address configuration mechanism in the embodiment of the present invention, the MAC address of the interface NIC-A0 of the network is reconfigured to 02:00:C0:A8:01:0A, and the MAC address of the interface NIC-A1 of the network is reconfigured. Is 02:01:C0:A8:01:0A;
主机节点B的两个网络接口分别为NIC-B0和NIC-B1,它们共享IP地址192.168.1.20,同理,根据本发明实施例中的MAC地址的配置机制,网络的接口NIC-B0的MAC地址被重配为02:00:C0:A8:01:14,网络的接口NIC-B1的MAC地址被重配为02:01:C0:A8:01:14。The two network interfaces of the host node B are NIC-B0 and NIC-B1, respectively, which share the IP address 192.168.1.20. Similarly, according to the MAC address configuration mechanism in the embodiment of the present invention, the MAC address of the network interface NIC-B0 The address is reconfigured to 02:00:C0:A8:01:14, and the MAC address of the network interface NIC-B1 is reconfigured to 02:01:C0:A8:01:14.
当主机节点A要向主机节点B发送数据时,主机节点A根据本发明实施例中所述的IP-MAC地址解析机制,采用主机节点B的IP地址192.168.1.20以及端口号0,合成对应的MAC地址02:00:C0:A8:01:14,实现地址解析。When the host node A wants to send data to the host node B, the host node A synthesizes the corresponding IP address of the host node B by using the IP address 192.168.1.20 and the port number 0 of the host node B according to the IP-MAC address resolution mechanism described in the embodiment of the present invention. MAC address 02:00: C0: A8: 01: 14, for address resolution.
主机节点A在合成目的MAC地址后,将主机节点B的IP-MAC映射信息在本地缓存。以便后续再次向主机节点B发送数据时,直接使用缓存的目的MAC地址,当然,在本地有主机节点B的IP-MAC映射信息时,主机节点A也可以合成目的MAC地址,但是,一旦在主机节点B的IP地址改变,则主机节点A不能使用缓存中的目的MAC地址,必须重新合成目的MAC地址。After synthesizing the destination MAC address, the host node A caches the IP-MAC mapping information of the host node B locally. In order to send data to the host node B again, the cached destination MAC address is directly used. Of course, when there is host-side node B's IP-MAC mapping information, the host node A can also synthesize the destination MAC address, but once on the host If the IP address of the node B changes, the host node A cannot use the destination MAC address in the cache, and must resynthesize the destination MAC address.
当主机节点A向主机节点B发送以数据(数据为以太网帧的形式)时,可能使用其网络接口NIC-A0,也可能使用其网络接口NIC-A1,假设使用其网络接口NIC-A1,如果主机节点A本地未缓存过主机节点B的IP-MAC的 映射信息,主机节点A会采用主机节点B的IP地址和端口0合成目的MAC地址,生成的目的MAC地址为02:00:C0:A8:01:14。主机节点A通过网络接口NIC-A1向主机节点B发送的以太网帧会采用目的地址MAC地址02:00:C0:A8:01:14,源MAC地址02:01:C0:A8:01:0A。When host node A sends data to host node B (data is in the form of an Ethernet frame), it may use its network interface NIC-A0, or its network interface NIC-A1, assuming its network interface NIC-A1, If host node A does not cache the IP-MAC of host node B locally Mapping information, host node A will use the IP address of host node B and port 0 to synthesize the destination MAC address, and the generated destination MAC address is 02:00:C0:A8:01:14. The Ethernet frame sent by host node A to host node B through network interface NIC-A1 will use destination address MAC address 02:00:C0:A8:01:14, source MAC address 02:01:C0:A8:01:0A .
当主机节点B收到数据后,根据数据能够获得主机节点A的MAC地址02:01:C0:A8:01:0A,将主机节点A的IP-MAC地址的映射信息在本地进行缓存,则在后续主机节点B向主机节点A发送数据时,可以使用本地缓存的主机节点A的MAC地址02:01:C0:A8:01:0A。After receiving the data, the host node B can obtain the MAC address 02:01:C0:A8:01:0A of the host node A according to the data, and cache the mapping information of the IP-MAC address of the host node A locally. When the subsequent host node B sends data to the host node A, the MAC address of the locally cached host node A can be used: 02:01:C0:A8:01:0A.
当主机节点B向主机节点A反馈数据时,可能使用其网络接口NIC-B0,也可能使用其网络接口NIC-B1。假设使用其网络接口NIC-B1,则主机节点A在接收到主机节点B的反馈数据时,根据该反馈数据,获得最新的主机节点B的IP-MAC映射信息,并在本地进行缓存。When host node B feeds back data to host node A, it may use its network interface NIC-B0 or its network interface NIC-B1. Assuming that the network interface NIC-B1 is used, when receiving the feedback data of the host node B, the host node A obtains the latest IP-MAC mapping information of the host node B according to the feedback data, and caches it locally.
在下次主机节点A向主机节点B发送数据的时候,主机节点A可根据最新的主机节点B的IP-MAC映射信息,确定目的MAC地址。At the next time the host node A sends data to the host node B, the host node A can determine the destination MAC address according to the latest IP-MAC mapping information of the host node B.
于此,最终主机节点A和主机节点B可以记录到对方所有的MAC地址,并建立相应的IP-MAC地址映射缓存。Here, the final host node A and the host node B can record all the MAC addresses of the other party and establish a corresponding IP-MAC address mapping cache.
基于上述实施例,参阅图12所示,本发明还提供了一种数据传输装置1200,包括:Based on the above embodiment, referring to FIG. 12, the present invention further provides a data transmission apparatus 1200, including:
获取单元1201,用于获取接收方的IP地址;The obtaining unit 1201 is configured to obtain an IP address of the receiver.
合成单元1202,用于根据所述接收方的IP地址和指定的端口号生成所述接收方的MAC地址;a synthesizing unit 1202, configured to generate, according to the IP address of the receiver and the specified port number, the MAC address of the receiver;
发送单元1203,用于基于生成的所述接收方的MAC地址,向所述接收方发送数据。The sending unit 1203 is configured to send data to the receiver based on the generated MAC address of the receiver.
可选地,在合成单元1203生成接收方的MAC地址之前,缓存单元1204进一步用于:Optionally, before the synthesizing unit 1203 generates the MAC address of the receiver, the buffer unit 1204 is further configured to:
确定本地不存在包含所述接收方的IP地址的IP地址和MAC地址的映射关系的缓存信息。 It is determined that there is no cache information of a mapping relationship between the IP address and the MAC address including the IP address of the recipient.
可选地,发送单元1203进一步用于:Optionally, the sending unit 1203 is further configured to:
若所述缓存单元本地存在包含所述接收方的IP地址的IP地址和MAC地址的映射关系的缓存信息,则基于所述缓存消息中与所述接收方的IP地址对应的接收方的MAC地址,向所述接收方发送数据。If the cache unit locally has cache information including a mapping relationship between the IP address and the MAC address of the IP address of the receiver, based on the MAC address of the receiver corresponding to the IP address of the receiver in the cache message. Sending data to the recipient.
可选地,在根据所述接收方的IP地址和指定的端口号生成接收方的MAC地址时,合成单元1202具体用于:Optionally, when generating the MAC address of the receiver according to the IP address of the receiver and the specified port number, the synthesizing unit 1202 is specifically configured to:
设置所述接收方的MAC地址的最高字节的最低两位指示所述接收方的MAC地址为局部单播地址,以及将所述指定的端口号记录在所述接收方的MAC地址的次高字节中;Setting a minimum two bits of the highest byte of the MAC address of the receiver indicates that the MAC address of the receiver is a local unicast address, and recording the specified port number to the second highest of the MAC address of the receiver Byte
将所述接收方的IP地址记录在所述接收方的MAC地址的除最高字节和次高字节的其他字节中。The recipient's IP address is recorded in the other bytes of the recipient's MAC address except the highest byte and the next highest byte.
可选地,装置1200的MAC地址中最高字节的最低两位指示装置1200的MAC地址为局部单播地址,装置1200的MAC地址的次高字节中记录指定的端口号,装置1200的MAC地址中除最高字节和次高字节的其他字节中记录所述装置的IP地址。Optionally, the lowest two bits of the highest byte of the MAC address of the device 1200 indicate that the MAC address of the device 1200 is a local unicast address, and the designated port number is recorded in the next highest byte of the MAC address of the device 1200, and the MAC of the device 1200 The IP address of the device is recorded in the other bytes of the address except the highest byte and the next highest byte.
可选地,缓存单元1204进一步用于:Optionally, the cache unit 1204 is further configured to:
在接收到所述接收方的反馈数据时,若所述反馈数据中包含的所述接收方的MAC地址与生成的所述接收方的MAC地址不一致,获取所述接收方的IP地址与所述接收方的MAC地址的最新映射关系,并将所述最新映射关系在本地进行缓存。When receiving the feedback data of the receiver, if the MAC address of the receiver included in the feedback data does not match the generated MAC address of the receiver, acquiring the IP address of the receiver and the The latest mapping relationship of the recipient's MAC address, and caches the latest mapping relationship locally.
可选地,在合成单元1203生成的所述接收方的MAC地址中,所述指定的端口号为0。Optionally, in the MAC address of the receiver generated by the synthesizing unit 1203, the specified port number is 0.
可选地,若装置1200的端口为多个端口绑定使用但各端口不共享IP地址或所述端口为多个端口绑定使用且各端口共享IP地址和MAC地址,则所述指定的端口号为0;若所述端口为多个端口绑定使用且各端口共享IP地址但不共享MAC地址,则所述指定的端口号为所述端口的编号。Optionally, if the port of the device 1200 is used for binding multiple ports, but each port does not share an IP address or the port is used for binding multiple ports, and each port shares an IP address and a MAC address, the specified port The number is 0. If the port is used for binding of multiple ports and each port shares an IP address but does not share a MAC address, the specified port number is the number of the port.
基于上述实施例,参阅图13所示,本发明实施例还提供另一种数据传输 装置1300,包括:Based on the foregoing embodiment, referring to FIG. 13, the embodiment of the present invention further provides another data transmission. Apparatus 1300, comprising:
接收单元1301,用于通过一个网络接口接收发送方发送的数据;The receiving unit 1301 is configured to receive data sent by the sender through a network interface;
获取单元1302,用于在所述发送方发送的数据中,获取接收方的MAC地址;The obtaining unit 1302 is configured to obtain, by using data sent by the sender, a MAC address of the receiver.
对比单元1303,用于在确定获取的接收方的MAC地址,与针对所述网络接口预配的MAC地址相同时,确认所述数据为发送给所述装置1300的数据;The comparing unit 1303 is configured to: when determining that the acquired MAC address of the receiver is the same as the MAC address pre-configured for the network interface, confirm that the data is data sent to the device 1300;
其中,预配的MAC地址是所述装置1300根据所述接收方的IP地址,和所述网络接口对应的端口号生成并配置到所述网络接口的。The pre-configured MAC address is generated by the device 1300 according to the IP address of the receiver and the port number corresponding to the network interface, and configured to the network interface.
基于上述实施例,如图14所示,本发明实施例还提供了另一种数据传输装置,包括:Based on the foregoing embodiment, as shown in FIG. 14, the embodiment of the present invention further provides another data transmission apparatus, including:
处理器1401,用于读取存储器1403中的程序,执行下列过程:The processor 1401 is configured to read a program in the memory 1403 and perform the following process:
获取接收方的IP地址;Obtain the IP address of the recipient;
根据所述接收方的IP地址和指定的端口号生成所述接收方的MAC地址;Generating the MAC address of the receiver according to the IP address of the receiver and the specified port number;
基于生成的所述接收方的MAC地址,通过收发机1402向所述接收方发送数据。Data is transmitted to the recipient via the transceiver 1402 based on the generated MAC address of the recipient.
收发机1402,用于在处理器1401的控制下收发数据。The transceiver 1402 is configured to send and receive data under the control of the processor 1401.
可选地,在生成接收方的MAC地址之前,处理器1401进一步用于:Optionally, before generating the MAC address of the receiver, the processor 1401 is further configured to:
确定本地不存在包含所述接收方的IP地址的IP地址和MAC地址的映射关系的缓存信息。It is determined that there is no cache information of a mapping relationship between the IP address and the MAC address including the IP address of the recipient.
可选地,处理器1401进一步用于:Optionally, the processor 1401 is further configured to:
若所述缓存单元本地存在包含所述接收方的IP地址的IP地址和MAC地址的映射关系的缓存信息,则基于所述缓存消息中与所述接收方的IP地址对应的接收方的MAC地址,通过收发机1402向所述接收方发送数据。If the cache unit locally has cache information including a mapping relationship between the IP address and the MAC address of the IP address of the receiver, based on the MAC address of the receiver corresponding to the IP address of the receiver in the cache message. The data is transmitted to the recipient via the transceiver 1402.
可选地,在根据所述接收方的IP地址和指定的端口号生成接收方的MAC地址时,处理器1401具体用于:Optionally, when generating the MAC address of the receiver according to the IP address of the receiver and the specified port number, the processor 1401 is specifically configured to:
设置所述接收方的MAC地址的最高字节的最低两位指示所述接收方的 MAC地址为局部单播地址,以及将所述指定的端口号记录在所述接收方的MAC地址的次高字节中;Setting the lowest two bits of the highest byte of the recipient's MAC address to indicate the recipient's The MAC address is a local unicast address, and the specified port number is recorded in the next highest byte of the MAC address of the receiver;
将所述接收方的IP地址记录在所述接收方的MAC地址的除最高字节和次高字节的其他字节中。The recipient's IP address is recorded in the other bytes of the recipient's MAC address except the highest byte and the next highest byte.
可选地,本数据传输装置的MAC地址中最高字节的最低两位指示本数据传输装置的MAC地址为局部单播地址,本数据传输装置的MAC地址的次高字节中记录指定的端口号,本数据传输装置的MAC地址中除最高字节和次高字节的其他字节中记录所述装置的IP地址。Optionally, the lowest two bits of the highest byte of the MAC address of the data transmission device indicate that the MAC address of the data transmission device is a local unicast address, and the designated port is recorded in the next highest byte of the MAC address of the data transmission device. No. The IP address of the device is recorded in the other bytes of the MAC address of the data transmission device except the highest byte and the next highest byte.
可选地,处理器1401进一步用于:Optionally, the processor 1401 is further configured to:
在接收到所述接收方的反馈数据时,若所述反馈数据中包含的所述接收方的MAC地址与生成的所述接收方的MAC地址不一致,获取所述接收方的IP地址与所述接收方的MAC地址的最新映射关系,并将所述最新映射关系在本地进行缓存。When receiving the feedback data of the receiver, if the MAC address of the receiver included in the feedback data does not match the generated MAC address of the receiver, acquiring the IP address of the receiver and the The latest mapping relationship of the recipient's MAC address, and caches the latest mapping relationship locally.
可选地,在处理器1401生成的所述接收方的MAC地址中,所述指定的端口号为0。Optionally, in the MAC address of the receiver generated by the processor 1401, the specified port number is 0.
可选地,若本数据传输装置的端口为多个端口绑定使用但各端口不共享IP地址或所述端口为多个端口绑定使用且各端口共享IP地址和MAC地址,则所述指定的端口号为0;若所述端口为多个端口绑定使用且各端口共享IP地址但不共享MAC地址,则所述指定的端口号为所述端口的编号。Optionally, if the port of the data transmission device is used for binding of multiple ports, but each port does not share an IP address or the port is used for binding of multiple ports, and each port shares an IP address and a MAC address, the designation The port number is 0. If the port is used for binding of multiple ports and each port shares an IP address but does not share a MAC address, the specified port number is the number of the port.
其中,在图14中,总线架构可以包括任意数量的互联的总线和桥,具体由处理器1401代表的一个或多个处理器和存储器1403代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供接口。收发机1402可以是多个元件,即包括发送机和接收机,提供用于在传输介质上与各种其他装置通信的单元。针对不同的用户设备,网络接口1404还可以是能够外接内接需要设备的接口,连接的设备包括但不限于小键盘、显示器、扬声器、麦克风、操纵杆等。 Wherein, in FIG. 14, the bus architecture may include any number of interconnected buses and bridges, specifically linked by one or more processors represented by processor 1401 and various circuits of memory represented by memory 1403. The bus architecture can also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and, therefore, will not be further described herein. The bus interface provides an interface. Transceiver 1402 can be a plurality of components, including a transmitter and a receiver, providing means for communicating with various other devices on a transmission medium. For different user equipments, the network interface 1404 may also be an interface capable of externally connecting the required devices, including but not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.
处理器1401负责管理总线架构和通常的处理,存储器1403可以存储处理器1401在执行操作时所使用的数据。The processor 1401 is responsible for managing the bus architecture and general processing, and the memory 1403 can store data used by the processor 1401 in performing operations.
基于上述实施例,参阅图15所示,本发明实施例还提供了另一种数据传输装置,包括:Based on the foregoing embodiment, referring to FIG. 15, the embodiment of the present invention further provides another data transmission apparatus, including:
处理器1501,用于读取存储器1503中的程序,执行下列过程:The processor 1501 is configured to read a program in the memory 1503 and perform the following process:
通过一个网络接口1504接收发送方发送的数据,在所述发送方发送的数据中,获取接收方的MAC地址,以及在确定获取的接收方的MAC地址,与针对所述网络接口1504预配的MAC地址相同时,确认所述数据为发送给所述装置的数据;Receiving data sent by the sender through a network interface 1504, obtaining a MAC address of the receiver in the data sent by the sender, and determining a MAC address of the obtained receiver, and pre-provisioning with the network interface 1504 When the MAC addresses are the same, confirm that the data is data sent to the device;
其中,预配的MAC地址是所述装置根据所述接收方的IP地址,和所述网络接口1504对应的端口号生成并配置到所述网络接口1504的。The pre-configured MAC address is generated by the device according to the IP address of the receiver and the port number corresponding to the network interface 1504, and is configured to the network interface 1504.
其中,在图15中,总线架构可以包括任意数量的互联的总线和桥,具体由处理器1501代表的一个或多个处理器和存储器1503代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供接口。收发机1502可以是多个元件,即包括发送机和接收机,提供用于在传输介质上与各种其他装置通信的单元。针对不同的用户设备,网络接口1504还可以是能够外接内接需要设备的接口,连接的设备包括但不限于小键盘、显示器、扬声器、麦克风、操纵杆等。In FIG. 15, the bus architecture may include any number of interconnected buses and bridges, specifically linked by one or more processors represented by processor 1501 and various circuits of memory represented by memory 1503. The bus architecture can also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and, therefore, will not be further described herein. The bus interface provides an interface. Transceiver 1502 can be a plurality of components, including a transmitter and a receiver, providing means for communicating with various other devices on a transmission medium. For different user equipments, the network interface 1504 may also be an interface capable of externally connecting the required devices, including but not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.
处理器1501负责管理总线架构和通常的处理,存储器1503可以存储处理器1501在执行操作时所使用的数据。The processor 1501 is responsible for managing the bus architecture and general processing, and the memory 1503 can store data used by the processor 1501 when performing operations.
综上所述,本发明实施例中,发送方获取接收方的IP地址,并根据接收方的IP地址和指定的端口号生成接收方的MAC地址,发送方基于生成的接收方的MAC地址,向接收方发送数据。这样,在没有增加新的硬件和硬件功能的情况下,避免了IP-MAC地址解析的广播通信或目录服务通信,消除了由此引入的带宽开销和通信延迟,提高了二层以太网的可扩展性。总之,实现了IP-MAC地址解析的低成本、低开销以及高效率。 In summary, in the embodiment of the present invention, the sender acquires the IP address of the receiver, and generates a MAC address of the receiver according to the IP address of the receiver and the specified port number, and the sender is based on the generated MAC address of the receiver. Send data to the receiver. In this way, the broadcast communication or directory service communication of IP-MAC address resolution is avoided without adding new hardware and hardware functions, thereby eliminating the bandwidth overhead and communication delay introduced thereby, and improving the availability of Layer 2 Ethernet. Scalability. In summary, low cost, low overhead, and high efficiency of IP-MAC address resolution are achieved.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。While the preferred embodiment of the invention has been described, it will be understood that Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and the modifications and
显然,本领域的技术人员可以对本发明实施例进行各种改动和变型而不脱离本发明实施例的精神和范围。这样,倘若本发明实施例的这些修改和变 型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。 It is apparent that those skilled in the art can make various modifications and variations to the embodiments of the invention without departing from the spirit and scope of the embodiments of the invention. Thus, if these modifications and changes are made to the embodiments of the present invention The type of the invention is intended to be included within the scope of the appended claims and the equivalents thereof.

Claims (17)

  1. 一种数据传输方法,其特征在于,包括:A data transmission method, comprising:
    发送方获取接收方的IP地址;The sender obtains the IP address of the receiver;
    所述发送方根据所述接收方的IP地址和指定的端口号生成所述接收方的MAC地址;Transmitting, by the sender, the MAC address of the receiver according to the IP address of the receiver and the specified port number;
    所述发送方基于生成的所述接收方的MAC地址,向所述接收方发送数据。The sender transmits data to the recipient based on the generated MAC address of the recipient.
  2. 如权利要求1所述的方法,其特征在于,所述发送方在生成所述接收方的MAC地址之前,进一步包括:The method according to claim 1, wherein the sender further comprises: before generating the MAC address of the receiver:
    所述发送方确定本地不存在包含所述接收方的IP地址的IP地址和MAC地址的映射关系的缓存信息。The sender determines that there is no cache information of a mapping relationship between the IP address and the MAC address including the IP address of the receiver.
  3. 如权利要求2所述的方法,其特征在于,进一步包括:The method of claim 2, further comprising:
    若所述发送方确定本地存在包含所述接收方的IP地址的IP地址和MAC地址的映射关系的缓存信息,则基于所述缓存消息中与所述接收方的IP地址对应的接收方的MAC地址,向所述接收方发送数据。If the sender determines that the cache information of the mapping relationship between the IP address and the MAC address of the IP address of the receiver is locally present, based on the MAC address of the receiver corresponding to the IP address of the receiver in the cache message An address that sends data to the recipient.
  4. 如权利要求1、2或3所述的方法,其特征在于,根据所述接收方的IP地址和指定的端口号生成所述接收方的MAC地址,包括:The method of claim 1, 2 or 3, wherein the generating the MAC address of the recipient according to the IP address of the recipient and the specified port number comprises:
    设置所述接收方的MAC地址的最高字节的最低两位指示所述接收方的MAC地址为局部单播地址,以及将所述指定的端口号记录在所述接收方的MAC地址的次高字节中;Setting a minimum two bits of the highest byte of the MAC address of the receiver indicates that the MAC address of the receiver is a local unicast address, and recording the specified port number to the second highest of the MAC address of the receiver Byte
    将所述接收方的IP地址记录在所述接收方的MAC地址的除最高字节和次高字节的其他字节中。The recipient's IP address is recorded in the other bytes of the recipient's MAC address except the highest byte and the next highest byte.
  5. 如权利要求1-4任一项所述的方法,其特征在于,所述发送方的MAC地址中最高字节的最低两位指示所述发送方的MAC地址为局部单播地址,所述发送方的MAC地址的次高字节中记录指定的端口号,所述发送方的MAC地址中除最高字节和次高字节的其他字节中记录所述发送方的IP地址。 The method according to any one of claims 1 to 4, wherein the lowest two bits of the highest byte of the sender's MAC address indicate that the sender's MAC address is a local unicast address, and the sending The specified port number is recorded in the next highest byte of the MAC address of the party, and the sender's IP address is recorded in the other bytes of the sender's MAC address except the highest byte and the next highest byte.
  6. 如权利要求2所述的方法,其特征在于,进一步包括:The method of claim 2, further comprising:
    在接收到所述接收方的反馈数据时,若所述反馈数据中包含的所述接收方的MAC地址与生成的所述接收方的MAC地址不一致,获取所述接收方的IP地址与所述接收方的MAC地址的最新映射关系,并将所述最新映射关系在本地进行缓存。When receiving the feedback data of the receiver, if the MAC address of the receiver included in the feedback data does not match the generated MAC address of the receiver, acquiring the IP address of the receiver and the The latest mapping relationship of the recipient's MAC address, and caches the latest mapping relationship locally.
  7. 如权利要求4所述的方法,其特征在于,所述生成的所述接收方的MAC地址中,所述指定的端口号为0。The method according to claim 4, wherein said designated port number of said generated MAC address of said recipient is zero.
  8. 如权利要求5所述的方法,其特征在于,若所述发送方的端口为多个端口绑定使用但各端口不共享IP地址或所述端口为多个端口绑定使用且各端口共享IP地址和MAC地址,则所述指定的端口号为0;若所述端口为多个端口绑定使用且各端口共享IP地址但不共享MAC地址,则所述指定的端口号为所述端口的编号。The method according to claim 5, wherein if the port of the sender is used for binding of multiple ports, each port does not share an IP address or the port is used for binding of multiple ports and each port shares IP. Address and MAC address, the specified port number is 0; if the port is used for binding of multiple ports and each port shares an IP address but does not share a MAC address, the specified port number is the port Numbering.
    接收方的MAC地址接收方的MAC地址接收方的IP地址。The IP address of the recipient of the MAC address of the recipient's MAC address.
  9. 一种数据传输装置,其特征在于,包括:A data transmission device, comprising:
    获取单元,用于获取接收方的IP地址;An obtaining unit, configured to obtain an IP address of the receiver;
    合成单元,用于根据所述接收方的IP地址和指定的端口号生成所述接收方的MAC地址;a synthesizing unit, configured to generate, according to the IP address of the receiver and the specified port number, the MAC address of the receiver;
    发送单元,用于基于生成的所述接收方的MAC地址,向所述接收方发送数据。And a sending unit, configured to send data to the receiver based on the generated MAC address of the receiver.
  10. 如权利要求9所述的装置,其特征在于,在所述合成单元生成接收方的MAC地址之前,所述缓存单元进一步用于:The apparatus according to claim 9, wherein before the synthesizing unit generates the MAC address of the receiver, the buffer unit is further configured to:
    确定本地不存在包含所述接收方的IP地址的IP地址和MAC地址的映射关系的缓存信息。It is determined that there is no cache information of a mapping relationship between the IP address and the MAC address including the IP address of the recipient.
  11. 如权利要求10所述的装置,其特征在于,所述发送单元进一步用于:The apparatus according to claim 10, wherein said transmitting unit is further configured to:
    若所述缓存单元本地存在包含所述接收方的IP地址的IP地址和MAC地址的映射关系的缓存信息,则基于所述缓存消息中与所述接收方的IP地址对应的接收方的MAC地址,向所述接收方发送数据。 If the cache unit locally has cache information including a mapping relationship between the IP address and the MAC address of the IP address of the receiver, based on the MAC address of the receiver corresponding to the IP address of the receiver in the cache message. Sending data to the recipient.
  12. 如权利要求9、10或11所述的装置,其特征在于,在根据所述接收方的IP地址和指定的端口号生成所述接收方的MAC地址时,所述合成单元具体用于:The apparatus according to claim 9, 10 or 11, wherein, when the MAC address of the receiver is generated according to the IP address of the receiver and the specified port number, the synthesizing unit is specifically configured to:
    设置所述接收方的MAC地址的最高字节的最低两位指示所述接收方的MAC地址为局部单播地址,以及将所述指定的端口号记录在所述接收方的MAC地址的次高字节中;Setting a minimum two bits of the highest byte of the MAC address of the receiver indicates that the MAC address of the receiver is a local unicast address, and recording the specified port number to the second highest of the MAC address of the receiver Byte
    将所述接收方的IP地址记录在所述接收方的MAC地址的除最高字节和次高字节的其他字节中。The recipient's IP address is recorded in the other bytes of the recipient's MAC address except the highest byte and the next highest byte.
  13. 如权利要求9-12任一项所述的装置,其特征在于,所述装置的MAC地址中最高字节的最低两位指示所述装置的MAC地址为局部单播地址,所述装置的MAC地址的次高字节中记录指定的端口号,所述装置的MAC地址中除最高字节和次高字节的其他字节中记录所述装置的IP地址。Apparatus according to any one of claims 9-12, wherein the lowest two bits of the highest byte of the MAC address of the device indicate that the MAC address of the device is a local unicast address, the MAC of the device The specified port number is recorded in the next highest byte of the address, and the IP address of the device is recorded in the other bytes of the device's MAC address except the highest byte and the next highest byte.
  14. 如权利要求9所述的装置,其特征在于,所述缓存单元进一步用于:The apparatus according to claim 9, wherein said buffer unit is further configured to:
    在接收到所述接收方的反馈数据时,若所述反馈数据中包含的所述接收方的MAC地址与生成的所述接收方的MAC地址不一致,获取所述接收方的IP地址与所述接收方的MAC地址的最新映射关系,并将所述最新映射关系在本地进行缓存。When receiving the feedback data of the receiver, if the MAC address of the receiver included in the feedback data does not match the generated MAC address of the receiver, acquiring the IP address of the receiver and the The latest mapping relationship of the recipient's MAC address, and caches the latest mapping relationship locally.
  15. 如权利要求12所述的装置,其特征在于,在所述合成单元生成的所述接收方的MAC地址中,所述指定的端口号为0。The apparatus according to claim 12, wherein said designated port number is 0 in said recipient's MAC address generated by said synthesizing unit.
  16. 如权利要求13所述的装置,其特征在于,若所述装置的端口为多个端口绑定使用但各端口不共享IP地址或所述端口为多个端口绑定使用且各端口共享IP地址和MAC地址,则所述指定的端口号为0;若所述端口为多个端口绑定使用且各端口共享IP地址但不共享MAC地址,则所述指定的端口号为所述端口的编号。The device according to claim 13, wherein if the port of the device is used for binding of a plurality of ports, each port does not share an IP address or the port is used for binding of multiple ports and each port shares an IP address. And the MAC address, the specified port number is 0; if the port is used for binding of multiple ports and each port shares an IP address but does not share a MAC address, the specified port number is the number of the port. .
  17. 一种数据传输装置,包括网络接口、存储器以及处理器,其中,所述存储器中存储一组程序,且所述处理器用于调用所述存储器中存储的程序,使得所述数据传输装置执行如权利要求1至8任一所述的方法。 A data transmission apparatus includes a network interface, a memory, and a processor, wherein the memory stores a set of programs, and the processor is configured to invoke a program stored in the memory, such that the data transmission apparatus performs the right The method of any of 1 to 8 is claimed.
PCT/CN2015/079718 2015-05-25 2015-05-25 Data transmission method and device WO2016187783A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2015/079718 WO2016187783A1 (en) 2015-05-25 2015-05-25 Data transmission method and device
CN201580001272.6A CN106489252B (en) 2015-05-25 2015-05-25 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/079718 WO2016187783A1 (en) 2015-05-25 2015-05-25 Data transmission method and device

Publications (1)

Publication Number Publication Date
WO2016187783A1 true WO2016187783A1 (en) 2016-12-01

Family

ID=57392377

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/079718 WO2016187783A1 (en) 2015-05-25 2015-05-25 Data transmission method and device

Country Status (2)

Country Link
CN (1) CN106489252B (en)
WO (1) WO2016187783A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108600788A (en) * 2018-05-14 2018-09-28 广州市千钧网络科技有限公司 A kind of broadcast address acquisition methods and device
CN113746714A (en) * 2021-11-05 2021-12-03 深圳艾灵网络有限公司 Communication method, communication system and communication device based on master station and slave station

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113630300B (en) * 2020-05-09 2023-08-08 华为技术有限公司 Method and node for message transmission

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1490991A (en) * 2002-10-18 2004-04-21 华为技术有限公司 Method for virtual Ethernet adapter card
CN101119290A (en) * 2006-08-01 2008-02-06 华为技术有限公司 Ethernet supporting source specific multicast forwarding method and system
CN103152269A (en) * 2013-02-26 2013-06-12 杭州华三通信技术有限公司 NAT (Network Address Translation)-based message forwarding method and equipment
US20130151667A1 (en) * 2011-12-13 2013-06-13 Delta Electronics, Inc. Method for automatic installation and setting of server and application program for the same
CN103685608A (en) * 2013-12-24 2014-03-26 北京启明星辰信息技术股份有限公司 Method and device for automatically configuring IP (Internet Protocol) address of security virtual machine

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102469170B (en) * 2010-11-03 2014-04-16 英业达集团(天津)电子技术有限公司 Method for generating static Internet protocol (IP) address under disk operating system (DOS)
CN102118283B (en) * 2011-03-30 2013-03-13 大唐移动通信设备有限公司 Method and device for testing communication equipment
US20140112130A1 (en) * 2012-10-23 2014-04-24 Electronics And Telecommunications Research Institute Method for setting packet forwarding rule and control apparatus using the method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1490991A (en) * 2002-10-18 2004-04-21 华为技术有限公司 Method for virtual Ethernet adapter card
CN101119290A (en) * 2006-08-01 2008-02-06 华为技术有限公司 Ethernet supporting source specific multicast forwarding method and system
US20130151667A1 (en) * 2011-12-13 2013-06-13 Delta Electronics, Inc. Method for automatic installation and setting of server and application program for the same
CN103152269A (en) * 2013-02-26 2013-06-12 杭州华三通信技术有限公司 NAT (Network Address Translation)-based message forwarding method and equipment
CN103685608A (en) * 2013-12-24 2014-03-26 北京启明星辰信息技术股份有限公司 Method and device for automatically configuring IP (Internet Protocol) address of security virtual machine

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108600788A (en) * 2018-05-14 2018-09-28 广州市千钧网络科技有限公司 A kind of broadcast address acquisition methods and device
CN113746714A (en) * 2021-11-05 2021-12-03 深圳艾灵网络有限公司 Communication method, communication system and communication device based on master station and slave station

Also Published As

Publication number Publication date
CN106489252A (en) 2017-03-08
CN106489252B (en) 2020-09-04

Similar Documents

Publication Publication Date Title
US11283650B2 (en) Method for sending virtual extensible local area network packet, computer device, and computer readable medium
WO2019201043A1 (en) Network communication method, system and device, and storage medium
US8767737B2 (en) Data center network system and packet forwarding method thereof
US6834311B2 (en) Method, system, and program for enabling communication between devices using dynamic addressing
US10742697B2 (en) Packet forwarding apparatus for handling multicast packet
US9419940B2 (en) IPv4 data center support for IPv4 and IPv6 visitors
US11438427B2 (en) Discovery of resources in a local network
JP2002525944A (en) System and method for resolving a Fiber Channel device address on a network using a fully qualified domain name of the device
EP2605486A1 (en) Method and system for handling a domain name service request
WO2016091009A1 (en) Address allocation and acquisition method and device
TW200934198A (en) Method and apparatus for dynamically configuring virtual internet protocol addresses
WO2019101056A1 (en) Configuration method and apparatus
US20090052346A1 (en) Method and Apparatus for Enabling an Adapter in a Network Device to Discover the Name of Another Adapter of Another Network Device in a Network System
CN110798541B (en) Interface sharing method, message forwarding method, interface sharing device, message forwarding device, electronic equipment and storage medium
KR20140007363A (en) Site-aware distributed file system access from outside enterprise network
WO2016065611A1 (en) File access method, system and host
WO2016187783A1 (en) Data transmission method and device
CN111711705B (en) Method and device for realizing network connection based on bidirectional NAT (network Address translation) by proxy node
US9565276B2 (en) Transparent redirection of clients to a surrogate payload server through the use of a proxy location server
JP6104406B2 (en) Method and processing device for handling network protocol addresses
CN109450768B (en) Method for interconnecting containers and system for interconnecting containers
US10574579B2 (en) End to end quality of service in storage area networks
JP5832970B2 (en) DNS server client system and DNS query response control method
CN109788075B (en) Private network system, data acquisition method and edge server
TW201818699A (en) Data transmission method, equipment, device and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15892864

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15892864

Country of ref document: EP

Kind code of ref document: A1