WO2012149839A1 - 发送因特网协议分组的方法及装置 - Google Patents

发送因特网协议分组的方法及装置 Download PDF

Info

Publication number
WO2012149839A1
WO2012149839A1 PCT/CN2012/072251 CN2012072251W WO2012149839A1 WO 2012149839 A1 WO2012149839 A1 WO 2012149839A1 CN 2012072251 W CN2012072251 W CN 2012072251W WO 2012149839 A1 WO2012149839 A1 WO 2012149839A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
network element
router
entry
packet
Prior art date
Application number
PCT/CN2012/072251
Other languages
English (en)
French (fr)
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 EP12779588.8A priority Critical patent/EP2750329B1/en
Publication of WO2012149839A1 publication Critical patent/WO2012149839A1/zh
Priority to US14/188,176 priority patent/US9467376B2/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/7452Multiple parallel or consecutive lookup operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/033Topology update or discovery by updating distance vector protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/22Alternate routing

Definitions

  • Embodiments of the present invention relate to communication technologies, and, in particular, to a method and apparatus for transmitting an Internet Protocol packet.
  • the Internet connects many network elements in different regions.
  • the router divides the entire network into different network segments.
  • the network elements in the same network segment can communicate.
  • the network elements on different network segments cannot communicate directly. It is necessary for the router to forward Internet Protocol (IP) packets.
  • IP Internet Protocol
  • the network elements on different network segments implement communication with each other by running routing protocols, such as the Internal Gateway Protocol (IGP) and the Border Gateway Protocol (BGP).
  • IGP Internal Gateway Protocol
  • BGP Border Gateway Protocol
  • the local device communicates with the remote device on the same network segment as the local device.
  • the router needs to discover the local device through the routing protocol and dynamically establish and maintain the destination IP address in the routing table according to the information provided by the routing message.
  • the entry of the local device increases the overhead of the router.
  • the embodiment of the invention provides a method and a device for transmitting an IP packet.
  • the network element communicates with the external network, the network element does not need to run a routing protocol, thereby reducing the overhead of the network element.
  • a method for transmitting an Internet Protocol IP packet includes:
  • the control plane of the router obtains the IP address of the first network element and the media access control MAC address through the point-to-point protocol PPPoE on the Ethernet;
  • the control plane of the router sends the IP address of the first network element to the data level of the router.
  • the routing table of the surface is configured to generate a first entry.
  • the destination IP address of the first entry is the IP address of the first network element, and the next hop IP address of the first entry is the IP address of the first network element. address;
  • the control plane of the router sends the IP address and the MAC address of the first network element to the address resolution protocol ARP cache table of the data plane of the router to generate a second entry, where the destination IP address of the second entry is An IP address of the first network element, where the destination MAC address of the second entry is a MAC address of the first network element;
  • the router advertises a routing message to the neighboring router of the router, where the routing message includes an IP address of the first network element.
  • the source IP address of the first IP packet is an IP address of the second network element
  • the destination IP address of the first IP packet is an IP address of the first network element, where The IP address of the second network element is in a different network segment from the IP address of the first network element
  • the router searches for the first entry according to the destination IP address of the first IP packet, and the router searches for the second entry according to the next hop IP address of the first entry, and the router according to the purpose of the second entry
  • the MAC address forwards the first IP packet.
  • another method for transmitting an IP packet includes: obtaining, by a PPPoE, a control plane of the first network element, an IP address and a MAC address of the router; and a control plane of the first network element, the router
  • the IP address is sent to the routing table of the data plane of the first network element to generate a third entry.
  • the destination IP address of the third entry is the first network segment address, and the first network segment address covers the second
  • the IP address of the network element, the next hop IP address of the third entry is the IP address of the router, and the IP address of the second network element and the IP address of the first network element are in different network segments;
  • the control plane of the first network element sends the IP address and the MAC address of the router to the ARP cache table of the data plane of the first network element to generate a fourth entry, where the destination IP address of the fourth entry is IP address of the router.
  • the destination MAC address of the fourth entry is the MAC address of the router.
  • the first network element sends a second IP packet to the second network element by using the router, where the first network element
  • the third entry is searched according to the destination IP address of the second IP packet, and the first network element searches for the fourth entry according to the next hop IP address of the third entry, where the first network element is according to the fourth
  • the destination IP address of the entry sends the second IP packet, and the destination IP address of the second IP packet is the IP address of the second network element.
  • an apparatus for transmitting an IP packet includes: a first acquiring unit, where a control plane of a router is configured to obtain an IP address and a MAC address of the first network element by using PPPoE;
  • control plane of the router is configured to send the IP address of the first network element to a routing forwarding table of the data plane of the router, to generate a first entry, and the destination IP address of the first entry
  • the address is the IP address of the first network element, and the next hop IP address of the first entry is the IP address of the first network element;
  • control plane of the router is configured to send the IP address and the MAC address of the first network element to an address resolution protocol ARP cache table of the data plane of the router to generate a second entry, where The destination IP address of the second entry is the IP address of the first network element, and the destination MAC address of the second entry is the MAC address of the first network element.
  • a routing message issuing unit the router is configured to advertise a routing message to the neighboring router of the router, where the routing message includes an IP address of the first network element;
  • a receiving unit configured to receive a first IP packet forwarded by the neighboring router, where a source IP address of the first IP packet is an IP address of the second network element, and a destination IP address of the first IP packet is the first network element An IP address, where the IP address of the second network element is in a different network segment from the IP address of the first network element;
  • the router is configured to search for the first entry according to the destination IP address of the first IP packet, and the router searches for the second entry according to the next hop IP address of the first entry, where the router is configured according to the The destination MAC address of the second entry forwards the first IP packet.
  • the apparatus for transmitting an IP packet includes: a second acquiring unit, where a control plane of the first network element is configured to acquire an IP of the router by using PPPoE Address and MAC address;
  • the control plane of the first network element is configured to send the IP address of the router to a routing forwarding table of the data plane of the first network element, to generate a third entry, the third entry
  • the destination IP address is the first network segment address
  • the first network segment address covers the IP address of the second network element
  • the next hop IP address of the third entry is the IP address of the router
  • the second network element The IP address and the IP address of the first network element are in different network segments.
  • a fourth entry generating unit wherein the control plane of the first network element is configured to send the IP address and the MAC address of the router to the ARP cache table of the data plane of the first network element to generate a fourth entry, where the The destination IP address of the fourth entry is the IP address of the router, and the destination MAC address of the fourth entry is the MAC address of the router.
  • the first network element is configured to send, by using the router, a second IP packet to the second network element, where the first network element searches for the third entry according to the destination IP address of the second IP packet, where The first network element searches for the fourth entry according to the next hop IP address of the third entry, where the first network element sends the second IP packet according to the destination MAC address of the fourth entry, the second IP packet
  • the destination IP address is the IP address of the second network element.
  • the router communicates with the remote device that is not on the same network segment as the local device. The router does not need to discover the access device through the routing protocol.
  • the destination IP address is dynamically established and maintained in the routing table based on the information provided by the routing message. The entry of the device, which reduces the overhead of the router.
  • FIG. 1 is a structural diagram of a network for applying a method and apparatus for transmitting an IP packet to a certain scenario according to an embodiment of the present invention
  • 2 is a flowchart of a method for transmitting an IP packet according to an embodiment of the present invention
  • FIG. 3 is a flowchart of another method for transmitting an IP packet according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of another apparatus for transmitting an IP packet according to an embodiment of the present invention.
  • the embodiment of the invention provides a method and a device for transmitting an IP packet.
  • the local device communicates with the remote device that is not on the same network segment as the local device, and the router does not need to discover the local device through the routing protocol, and provides the local device according to the routing message.
  • the information is dynamically created and maintained in the routing and forwarding table.
  • the destination IP address is the entry of the local device, which reduces the overhead of the router.
  • FIG. 1 is a structural diagram of networking of an application scenario according to an embodiment of the present invention.
  • the networking diagram of Figure 1 includes three network elements and the Internet.
  • the three network elements are mobile phones, base stations, and routers.
  • the mobile phone establishes a wireless link with the base station, and the base station establishes a wired link with the router, and the router accesses the Internet.
  • the mobile phone can access the Internet through the base station and the router.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • FIG. 2 is a flowchart of a method for sending an IP packet according to an embodiment of the present invention, where the method includes:
  • the control plane of the router acquires the IP address of the first network element and the media access control MAC address through the point-to-point protocol PPPoE on the Ethernet.
  • the first network element may be a fixed network element or a mobile network element.
  • fixed network The element can be a router or a switch.
  • the mobile network element can be a mobile terminal or a virtual machine.
  • the mobile terminal can be a mobile phone, a Personal Digital Assistant (PDA) or a Portable Personal Computer (Portable Personal Computer).
  • PDA Personal Digital Assistant
  • Portable Personal Computer Portable Personal Computer
  • the first network element can be directly connected to the router.
  • the first network element can also be connected to the router through the IP layer access device.
  • the control plane of the router obtains the IP address of the first network element and the Media Access Control (MAC) address through Point-to-Point Protocol over Ethernet (PPPoE) on the Ethernet.
  • the first network element may broadcast a discovery message defined by the PPPoE in the broadcast domain.
  • the router is in the broadcast domain of the first network element.
  • the discovery packet carries the IP address and MAC address of the first network element.
  • the router can send a response message to the first network element.
  • the response can carry the IP address of the router and the MAC address.
  • the IP address and MAC address of the first network element can be obtained by extending the existing protocol.
  • DHCP Dynamic Host Configuration Protocol
  • a reserved option type of DHCP can be defined as a new address acquisition protocol.
  • the router can obtain the IP address and MAC address of the first network element through the new address acquisition protocol.
  • the reserved Option type may include five fields, namely, a subtype, a source IP address, a source MAC address, a destination IP address, and a destination MAC address.
  • the subtype can include 2 types. When the subtype value is 1, the DHCP packet is the first packet. When the value of the subtype is 2, the DHCP packet is the second packet.
  • the router broadcasts the first discovery message in the broadcast domain.
  • the first network element is in the broadcast domain.
  • the first network element After receiving the discovery packet, the first network element returns a corresponding response packet to the router.
  • the source MAC address of the first discovery packet is the MAC address of the router.
  • the source MAC address of the response packet corresponding to the first discovery packet is the MAC address of the first network element, the source IP address is the IP address of the first network element, the destination MAC address is the MAC address of the router, and the destination IP address is the IP address of the router. address.
  • the destination IP address of the response packet corresponding to the first discovery packet is the first network element assigned to the router.
  • the router receives the response corresponding to the first discovery message. After the packet is sent, a second discovery message is sent to the first network element.
  • the source MAC address, source IP address, destination MAC address, and destination IP address of the second discovery packet are the MAC address of the router, the IP address of the router, the MAC address of the first network element, and the IP address of the first network element.
  • the first network element After receiving the second discovery packet, the first network element checks the source MAC address, source IP address, destination MAC address, and destination IP address of the second discovery packet. If the source MAC address, the source IP address, the destination MAC address, and the destination IP address are the MAC address of the router, the IP address of the router, the MAC address of the first network element, and the IP address of the first network element, the first network element is forwarded to the router. Returns the corresponding response message. In this way, the router obtains the IP address and MAC address of the first network element through the extended DHCP. At the same time, the first network element also obtains the IP address and MAC address of the router.
  • the IP address of the first network element may be the IP address of the interface of the first network element, or may be the IP address of the service of the first network element.
  • the service may be a video stream service of the first network element or an audio stream service of the first network element.
  • the interface of the first network element may be a physical interface or a logical interface.
  • the logical interface may be a loopback interface or a tunnel interface.
  • the tunnel may be a Layer 2 Tunneling Protocol (L2TP) tunnel, a Generic Route Encapsulation (GRE) tunnel, or a Multi-Protocol Label Switching (MPLS) P-channel.
  • L2TP Layer 2 Tunneling Protocol
  • GRE Generic Route Encapsulation
  • MPLS Multi-Protocol Label Switching
  • the MAC address of the first network element may be the MAC address of the interface of the first network element.
  • the MAC address of the interface of the first network element may be the MAC address of the physical interface of the first network element, or the MAC address of the logical interface of the first network element.
  • the logical interface may be a virtual Ethernet (VE) interface, or may be a physical interface corresponding to the first network element.
  • VE virtual Ethernet
  • the sub-interface can be determined according to an IP address of a physical interface of the first network element and a virtual local area network (VLAN) label.
  • VLAN virtual local area network
  • the mobile phone is the first network element.
  • the control plane of the router obtains the mobile phone through PPPoE IP address and MAC address.
  • the mobile phone is connected to the router through the base station.
  • the control plane of the router sends the IP address of the first network element to the routing forwarding table of the data plane of the router to generate a first entry, where the destination IP address of the first entry is the first network element. IP address, the next hop IP address of the first entry is the IP address of the first network element.
  • the control plane of the router sends the IP address of the first network element to the routing table of the data plane of the first network element, so that the routing entry table of the first network element has the first entry.
  • the destination IP address of the first entry is the IP address of the first network element
  • the next hop IP address of the first entry is the IP address of the first network element.
  • control plane of the router sends the IP address of the mobile phone to the routing table of the data plane of the router.
  • the control plane of the router sends the IP address and the MAC address of the first network element to the address resolution protocol ARP cache table of the data plane of the router to generate a second entry.
  • the destination IP address of the second entry is the IP address of the first network element.
  • the destination MAC address of the second entry is the MAC address of the first network element.
  • the control plane of the router sends the IP address and the MAC address of the first network element to the address resolution protocol (ARP) cache table of the data plane of the router, so that the ARP cache table of the first network element has the second
  • the destination IP address of the second entry is the IP address of the first NE.
  • the destination MAC address of the second entry is the MAC address of the first network element.
  • control plane of the router sends the IP address of the mobile phone and the MAC to the ARP cache table of the data plane of the router.
  • the router advertises a routing message to the neighbor router of the router.
  • the routing message includes the IP address of the first network element.
  • the router advertises a routing message to the neighboring router, where the routing message includes the IP address of the first network element. Address. In this way, when the neighboring router forwards the IP packet whose destination IP address is the IP address of the first network element, the next hop IP address of the IP packet can be obtained through the routing forwarding table of the neighboring router.
  • the router advertises routing messages to neighboring routers, and advertises routing messages to neighboring routers through routing protocols. Specifically, the routing message may be advertised through BGP, or the routing message may be advertised through the IGP.
  • the router advertises a routing message to the neighboring router through BGP.
  • the router message contains the IP address of the mobile phone.
  • the neighboring router forwards the IP packet whose destination IP address is the IP address of the mobile phone, the next hop IP address of the IP packet can be obtained through the routing table of the neighboring router.
  • the 205 Receive the first IP packet forwarded by the neighbor router.
  • the source IP address of the first IP packet is the IP address of the second network element.
  • the destination IP address of the first IP packet is an IP address of the first network element.
  • the IP address of the second network element is in a different network segment from the IP address of the first network element.
  • the neighbor router queries the routing forwarding table and forwards the first IP packet to the router.
  • the router receives the first IP packet.
  • the router receives the first IP packet forwarded by the neighbor router.
  • the destination IP address of the first IP packet is the IP address of the first network element.
  • the source IP address of the first IP packet is the IP address of the second network element.
  • the second network element and the first network element are in different network segments.
  • the first network element and the second network element may be in different network segments of the Internet Protocol version 4 (IPv4) network, or the first network element and the second network element may be in the Internet respectively. Different network segments of the Internet Protocol version 6 (IPv6) network.
  • IPv4 Internet Protocol version 4
  • IPv6 Different network segments of the Internet Protocol version 6
  • the server is the second network element.
  • the server is connected to the neighbor router via the Internet.
  • the server and the phone are on different network segments.
  • the server sends the first IP packet to the handset over the Internet.
  • the destination IP address of the first IP packet is the IP address of the mobile phone.
  • the neighbor router receives the first IP packet.
  • the router searches for the first entry according to the destination IP address of the first IP packet.
  • the router searches for the second entry according to the next hop IP address of the first entry.
  • the router forwards the first IP packet according to the destination MAC address of the second entry.
  • the router searches for the first entry according to the destination IP address of the first IP packet.
  • the router searches for the second entry according to the next hop IP address of the first entry.
  • the router MAC address according to the purpose of the second entry The address sends the first IP packet.
  • the router searches for the first entry according to the destination IP address of the first IP packet.
  • the router searches for the second entry according to the next hop IP address of the first entry.
  • the router sends the first IP packet according to the destination MAC address of the second entry. In this way, the phone can receive the first IP packet sent by the server.
  • the router obtains the IP address and the MAC address of the local device by using the PPPoE protocol. Based on the IP address and MAC address of the local device, the router establishes the corresponding routing forwarding table entry and the ARP cache table entry.
  • a remote device that is not on the same network segment as the local device can send IP packets to the local device through the router.
  • the router obtains the IP address and MAC address of the local device through the PPPoE protocol. In this way, the router does not need to discover the local device through the routing protocol, and dynamically establishes and maintains the destination IP address of the local device in the routing and forwarding table according to the information provided by the routing message, thereby reducing the overhead of the router.
  • the method for transmitting an IP packet obtained by the embodiment of the present invention obtains an IP address and a MAC address of the local device by using the PPPoE protocol.
  • the method of sending an IP packet does not have any special requirements and restrictions on the IP address of the local device. Therefore, the IP address of the local device can be the IP address of a specific network segment and can remain unchanged. This means that when the local device is a mobile network element, the local device that spans different network segments can communicate with the remote device using a fixed IP address.
  • the IP address of the first network element is the IP address of the first interface of the first network element
  • the MAC address of the first network element is the MAC address of the first interface of the first network element
  • the control plane of the router obtains the IP address of the first network element and the media access control MAC address through PPPoE, including:
  • the router receives the discovery discovery packet sent by the first network element, and the discovery packet
  • the IP address of the first network element and the MAC address of the first network element are carried.
  • the router and the first network element are connected through an IP layer network access device.
  • the IP layer network access device can transparently transmit IP packets.
  • the IP layer network access device may be a base station. Referring to Figure 1, the base station is an IP layer network access device. The router and mobile phone are connected through the base station.
  • Embodiment 2 :
  • FIG. 3 is a flowchart of a method for sending an IP packet according to an embodiment of the present invention, where the method includes:
  • the control plane of the first network element obtains the IP address and MAC address of the router through PPPoE.
  • the control plane of the first network element obtains the IP address and the MAC address of the router through the PPPoE. For details, refer to 201 in the first embodiment.
  • the IP address of the router can be the IP address of the interface of the router or the IP address of the router's service.
  • the service may be a video stream service of a router or an audio stream service of a router.
  • the interface of the router can be either a physical interface or a logical interface.
  • the logical interface can be a loopback interface, or a tunnel interface.
  • the tunnel may be an L2TP tunnel, a GRE tunnel, or an MPLS tunnel.
  • the router's MAC address can be the MAC address of the router's interface.
  • the MAC address of the interface of the router can be the MAC address of the physical interface of the router or the MAC address of the logical interface of the router.
  • the logical interface may be a VE interface or a sub-interface corresponding to the physical interface of the router.
  • the sub-interface can be determined according to the IP address of the physical interface of the router and the VLAN tag of the virtual local area network.
  • the control plane of the first network element sends the IP address of the router to the routing forwarding table of the data plane of the first network element to generate a third entry.
  • the destination IP address of the third entry is first.
  • Network segment address covers the IP address of the second network element.
  • the next hop IP address of the third entry is the IP address of the router.
  • the IP address of the second network element and the IP address of the first network element are in different network segments.
  • the control plane of the first network element sends the IP address of the router to the routing table of the data plane of the first network element to generate a third entry.
  • the destination IP address of the third entry is the first network segment address, and the first network segment address covers the IP address of the second network element.
  • the process of generating a third entry is similar to the process of generating a first entry. For details, please refer to 202 in the first embodiment.
  • the control plane of the first network element sends the IP address and the MAC address of the router to the ARP cache table of the data plane of the first network element to generate a fourth entry, and the destination IP address of the fourth entry
  • the IP address of the router, the destination MAC address of the fourth entry is the MAC address of the router
  • the control plane of the first network element sends the IP address and the MAC address of the router to the ARP cache table of the data plane of the first network element to generate a fourth entry.
  • the destination IP address of the fourth entry is the IP address of the router.
  • the destination MAC address of the fourth entry is the MAC address of the router.
  • the process of generating the fourth entry is similar to the process of generating the second entry. For details, please refer to 203 in the first embodiment.
  • the first network element sends a second IP packet to the second network element by using the router, where the first network element searches for the third entry according to the destination IP address of the second IP packet, where the first network element is configured according to the third network element.
  • the next hop IP address of the third entry is used to search for the fourth entry, and the first network element sends the second IP packet according to the destination MAC address of the fourth entry, and the destination IP address of the second IP packet is IP address of the second network element.
  • the first network element searches for the third entry according to the destination IP address of the second IP packet, and the first network element searches for the fourth entry according to the next hop IP address of the third entry, the first network
  • the element sends the second IP packet according to the destination MAC address of the fourth entry.
  • the process of the first network element transmitting the second IP packet is similar to the process of the router forwarding the first IP packet.
  • the local device obtains the IP address and the MAC address of the router through the PPPoE protocol.
  • the local device establishes the corresponding routing forwarding table entry and the ARP cache table entry according to the IP address and MAC address of the router.
  • the local device can send IP packets to the remote device that is not on the same network segment as the local device through the router.
  • the local device obtains the IP address and MAC address of the router through the PPPoE protocol. In this manner, the local device does not need to discover the router through the routing protocol, and dynamically establishes and maintains the destination IP address as the remote device entry in the routing table of the local device according to the information provided by the routing message, thereby reducing the local device. s expenses.
  • the local device obtains the IP address and the MAC address of the router through the PPPoE protocol.
  • the method of sending an IP packet does not have any special requirements and restrictions on the IP address of the local device. Therefore, the IP address of the local device can be the IP address of a specific network segment and can remain unchanged. This means that when the local device is a mobile network element, the local device that spans different network segments can communicate with the remote device using a fixed IP address.
  • the IP address of the router is the IP address of the second interface of the router.
  • the MAC address of the router is the MAC address of the second interface of the router, and the first network element communicates with the router through the second interface.
  • the router and the first network element are connected through an IP layer network access device.
  • the base station is an IP layer network access device.
  • the router and mobile phone are connected through the base station.
  • Embodiment 3 :
  • FIG. 4 is a schematic diagram of an apparatus for transmitting an IP packet according to an embodiment of the present invention.
  • the first obtaining unit 401 is configured to acquire an IP address and a MAC address of the first network element by using PPPoE.
  • the first network element may be a fixed network element or a mobile network element.
  • the fixed network element may be a router or a switch.
  • the mobile network element can be a mobile terminal or a virtual machine.
  • the mobile terminal can be a mobile phone, a PDA or a Portable PC.
  • the first network element can be directly connected to the router.
  • the first network element can also be connected to the router through the IP layer access device.
  • the control plane of the router obtains the IP address and MAC address of the first network element through PPPoE.
  • the first network element may broadcast a PPPoE-defined discovery packet in the broadcast domain.
  • the router is in the broadcast domain of the first network element.
  • the discovery packet carries the IP address and MAC address of the first network element.
  • the router can send a response packet to the first NE.
  • the response message can carry the IP address and MAC address of the router.
  • the IP address and MAC address of the first network element can be obtained by extending the existing protocol.
  • existing DHCP can be extended.
  • a reserved Option type of DHCP can be defined as a new address acquisition protocol.
  • the router can obtain the IP address and MAC address of the first network element through the new address acquisition protocol.
  • the specific Option type can contain five fields, namely subtype, source IP address, source MAC address, destination IP address, and destination MAC address.
  • the subtype can include 2 types. When the subtype value is 1, the DHCP packet is the first packet. When the value of the subtype is 2, the DHCP packet is the second packet.
  • the router broadcasts the first discovery message in the broadcast domain.
  • the first network element is in the broadcast domain.
  • the first network element After receiving the discovery packet, the first network element returns a corresponding response packet to the router.
  • the source MAC address of the first discovery packet is the MAC address of the router.
  • the source MAC address of the response packet corresponding to the first discovery packet is the MAC address of the first network element
  • the source IP address is the IP address of the first network element
  • the destination MAC address is the MAC address of the router
  • the destination IP address is the IP address of the router. address.
  • the destination IP address of the response packet corresponding to the first discovery packet is allocated by the first network element to the router.
  • the router After receiving the response packet corresponding to the first discovery packet, the router sends a second discovery packet to the first network element.
  • the source MAC address, source IP address, destination MAC address, and destination IP address of the second discovery packet are the MAC address of the router, the IP address of the router, the MAC address of the first network element, and the IP address of the first network element.
  • the network element checks the source MAC address, source IP address, destination MAC address, and destination IP address of the second discovery packet. If the source MAC address, the source IP address, the destination MAC address, and the destination IP address are the MAC address of the router, the IP address of the router, the MAC address of the first network element, and the IP address of the first network element, the first network element is forwarded to the router. Returns the corresponding response message. In this way, the router obtains the IP address and MAC address of the first network element through the extended DHCP. At the same time, the first network element also obtains the IP address and MAC address of the router.
  • the IP address of the first network element may be the IP address of the interface of the first network element, or may be the IP address of the service of the first network element.
  • the service may be a video stream service of the first network element or an audio stream service of the first network element.
  • the interface of the first network element may be a physical interface or a logical interface.
  • the logical interface can be a loopback interface or a tunnel interface.
  • the tunnel may be an L2TP tunnel, a GRE tunnel, or an MPLS tunnel.
  • the MAC address of the first network element may be the MAC address of the interface of the first network element.
  • the MAC address of the interface of the first network element may be the MAC address of the physical interface of the first network element, or the MAC address of the logical interface of the first network element.
  • the logical interface may be a VE interface or a sub-interface corresponding to the physical interface of the first network element.
  • the sub-interface can be determined according to an IP address of a physical interface of the first network element and a VLAN tag.
  • the mobile phone is the first network element.
  • the control plane of the router obtains the IP address and MAC address of the mobile phone through PPPoE.
  • the mobile phone is connected to the router through the base station.
  • the first entry generating unit 402 is configured to send the IP address of the first network element to the routing forwarding table of the data plane of the router to generate a first entry.
  • the destination IP address of the first entry is the IP address of the first network element.
  • the next hop IP address of the first entry is the IP address of the first network element.
  • the control plane of the router sends the IP address of the first network element to the data plane of the first network element.
  • the routing forwarding table has the first entry in the routing forwarding table of the first network element.
  • the destination IP address of the first entry is the IP address of the first network element
  • the next hop IP address of the first entry is the IP address of the first network element.
  • control plane of the router sends the IP address of the mobile phone to the routing table of the data plane of the router.
  • the second entry generating unit 403 is configured to send the IP address and the MAC address of the first network element to the address resolution protocol ARP cache table of the data plane of the router to generate a second entry.
  • the destination IP address of the second entry is the IP address of the first network element.
  • the destination MAC address of the second entry is the MAC address of the first network element.
  • the control plane of the router sends the IP address and the MAC address of the first network element to the ARP cache table of the data plane of the router, so that the ARP cache table of the first network element has the second entry, and the purpose of the second entry is
  • the IP address is the IP address of the first network element.
  • the destination MAC address of the second entry is the MAC address of the first NE. In this way, when the router forwards the IP packet whose IP address is the IP address of the first network element, the next hop MAC address can be obtained through the second entry.
  • control plane of the router sends the IP address of the mobile phone and the MAC to the ARP cache table of the data plane of the router.
  • the routing message issuance unit 404 is configured to issue a routing message to the neighboring router of the router.
  • the routing message includes an IP address of the first network element.
  • the router advertises a routing message to the neighboring router.
  • the routing message contains the IP address of the first network element. In this way, when the neighboring router forwards the IP packet whose destination IP address is the IP address of the first network element, the next hop IP address of the IP packet can be obtained through the routing forwarding table of the neighboring router.
  • the router advertises routing messages to neighboring routers, and can advertise routing messages to neighboring routers through routing protocols. Specifically, the routing message may be advertised through BGP, or the routing message may be advertised through the IGP.
  • the router advertises a routing message to the neighboring router through BGP.
  • the router message contains the IP address of the mobile phone.
  • the neighbor router forwards the destination IP address to the IP address of the mobile phone.
  • the next hop IP address of the IP packet can be obtained through the routing forwarding table of the neighbor router.
  • the receiving unit 405 is configured to receive the first IP packet forwarded by the neighboring router.
  • the source IP address of the first IP packet is the IP address of the second network element.
  • the destination IP address of the first IP packet is an IP address of the first network element.
  • the IP address of the second network element is in different network segments from the IP address of the first network element.
  • the neighbor router queries the routing forwarding table and forwards the first IP packet to the router.
  • the router receives the first IP packet.
  • the router receives the first IP packet forwarded by the neighbor router.
  • the destination IP address of the first IP packet is the IP address of the first network element.
  • the source IP address of the first IP packet is the IP address of the second network element.
  • the second network element and the first network element are in different network segments. In a specific implementation, the first network element and the second network element are respectively in different network segments of the IPv4 network, and the first network element and the second network element are respectively in different network segments of the IPv6 network.
  • the server is the second network element.
  • the server is connected to the neighbor router via the Internet.
  • the server and the phone are on different network segments.
  • the server sends the first IP packet to the handset over the Internet.
  • the destination IP address of the first IP packet is the IP address of the mobile phone.
  • the neighbor router receives the first IP packet.
  • the first transmitter 406 is configured to search for the first entry according to the destination IP address of the first IP packet.
  • the router searches for the second entry according to the next hop IP address of the first entry.
  • the router forwards the first IP packet according to the destination MAC address of the second entry.
  • the router searches for the first entry according to the destination IP address of the first IP packet.
  • the router searches for the second entry according to the next hop IP address of the first entry.
  • the router sends the first IP packet according to the destination MAC address of the second entry.
  • the router searches for the first entry according to the destination IP address of the first IP packet.
  • the router searches for the second entry according to the next hop IP address of the first entry.
  • the router sends the first IP packet according to the destination MAC address of the second entry. In this way, the phone can receive the first IP packet sent by the server.
  • the router passes the PPPoE.
  • the protocol obtains the IP address and MAC address of the local device.
  • the router establishes the corresponding routing forwarding table entry and the ARP cache table entry according to the IP address and MAC address of the local device.
  • a remote device that is not on the same network segment as the local device can send IP packets to the local device through the router.
  • the router obtains the IP address and MAC address of the local device through the PPPoE protocol. In this way, the router does not need to discover the local device through the routing protocol, and dynamically establishes and maintains the destination IP address of the local device in the routing and forwarding table according to the information provided by the routing message, thereby reducing the overhead of the router.
  • the device that sends the IP packet obtained by the embodiment of the present invention obtains the IP address and the MAC address of the local device by using the PPPoE protocol.
  • the device that sends the IP packet does not have any special requirements and restrictions on the IP address of the local device. Therefore, the IP address of the local device can be the IP address of a specific network segment and can remain unchanged. This means that when the local device is a mobile network element, the local device that spans different network segments can communicate with the remote device using a fixed IP address.
  • Embodiment 4 is a diagrammatic representation of Embodiment 4:
  • FIG. 5 is a schematic diagram of an apparatus for transmitting an IP packet according to an embodiment of the present invention.
  • the apparatus includes:
  • the second obtaining unit 501 is configured to obtain, by using PPPoE, a router's IP address and a MAC address.
  • the control plane of the first network element obtains the IP address and the MAC address of the router through the PPPoE. For details, refer to 301 in the second embodiment.
  • the IP address of the router can be the IP address of the interface of the router or the IP address of the router's service.
  • the service may be a video stream service of a router or an audio stream service of a router.
  • the interface of the router can be either a physical interface or a logical interface.
  • the logical interface can be a loopback interface, or a tunnel interface.
  • the tunnel may be an L2TP tunnel, a GRE tunnel, or an MPLS tunnel.
  • the MAC address of the router can be the MAC address of the interface of the router.
  • Router interface The MAC address can be the MAC address of the physical interface of the router or the MAC address of the logical interface of the router.
  • the logical interface may be a VE interface or a sub-interface corresponding to the physical interface of the router.
  • the sub-interface can be determined according to the IP address of the physical interface of the router and the VLAN tag of the virtual local area network.
  • the third entry generating unit 502 is configured to send the IP address of the router to the routing forwarding table of the data plane of the first network element to generate a third entry.
  • the destination IP address of the third entry is the first network segment address.
  • the first network segment address covers the IP address of the second network element.
  • the next hop IP address of the third entry is the IP address of the router.
  • the IP address of the second network element and the IP address of the first network element are in different network segments.
  • the control plane of the first network element sends the IP address of the router to the routing table of the data plane of the first network element to generate a third entry.
  • the destination IP address of the third entry is the first network segment address, and the first network segment address covers the IP address of the second network element.
  • For the procedure for generating the third entry please refer to 302 in the second embodiment.
  • the fourth entry generating unit 503 is configured to send the IP address and the MAC address of the router to the ARP cache table of the data plane of the first network element to generate a fourth entry.
  • the destination IP address of the fourth entry is the IP address of the router.
  • the destination MAC address of the fourth entry is the MAC address of the router.
  • the control plane of the first network element sends the IP address and the MAC address of the router to the ARP cache table of the data plane of the first network element to generate a fourth entry.
  • the destination IP address of the fourth entry is the IP address of the router.
  • the destination MAC address of the fourth entry is the MAC address of the router.
  • the first network element is configured to send, by using the router, a second IP packet to the second network element, where the first network element searches for the third entry according to the destination IP address of the second IP packet.
  • the first network element searches for the fourth entry according to the next hop IP address of the third entry, where the first network element sends the second IP packet according to the destination MAC address of the fourth entry, the second IP address.
  • Grouped item The IP address is the IP address of the second network element.
  • the first network element searches for the third entry according to the destination IP address of the second IP packet, and the first network element searches for the fourth entry according to the next hop IP address of the third entry, the first network
  • the element sends the second IP packet according to the destination MAC address of the fourth entry.
  • For the process of sending the second IP packet by the first network element refer to 304 in the second embodiment.
  • the local device obtains the IP address and the MAC address of the router through the PPPoE protocol.
  • the local device establishes the corresponding routing forwarding table entry and the ARP cache table entry according to the IP address and MAC address of the router.
  • the local device can send IP packets to the remote device that is not on the same network segment as the local device through the router.
  • the local device obtains the IP address and MAC address of the router through the PPPoE protocol.
  • the local device does not need to discover the router through the routing protocol, and dynamically establishes and maintains the destination IP address as the remote device entry in the routing table of the local device according to the information provided by the routing message, thereby reducing the local device. s expenses.
  • the device that sends the IP packet obtained by the embodiment of the present invention obtains the IP address and the MAC address of the router through the PPPoE protocol.
  • the device that sends the IP packet does not have any special requirements and restrictions on the IP address of the local device. Therefore, the IP address of the local device can be the IP address of a specific network segment and can remain unchanged. This means that when the local device is a mobile network element, the local device that spans different network segments can communicate with the remote device using a fixed IP address.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Description

发送因特网协议分组的方法及装置 技术领域 本发明实施例涉及通信技术, 尤其涉及发送因特网协议分组的方法及 装置。
背景技术 当前, 因特网将很多处于不同地域的网元连接起来。 为减小网络的规 模, 降低管理和维护的成本, 路由器将整个网络划分为不同的网段, 处于 同一网段内的网元可以进行通信, 处于不同网段的网元不能直接进行通信, 而是需要路由器对因特网协议(Internet Protocol, IP )分组进行转发。 通过 运行路由协议, 例如内部网关协议(Internal Gateway Protocol, IGP )和边 界网关协议(Border Gateway Protocol, BGP ) , 处于不同网段的网元实现 了相互通信。
发明人发现现有技术存在如下问题:
本端设备通过路由器和与本端设备不在同一网段的远端设备通信, 路 由器需要通过路由协议发现本端设备, 并根据路由消息提供的信息在路由 转发表中动态建立并维护目的 IP地址为本端设备的表项, 增加了路由器的 开销。
发明内容
本发明实施例提供发送 IP分组的方法及装置,网元与外网进行通信时, 网元不需要运行路由协议, 从而降低了网元的开销。
一方面, 本发明实施例提供的一种发送因特网协议 IP分组的方法, 包 括:
路由器的控制平面通过以太网上的点对点协议 PPPoE获取第一网元的 IP地址和媒体接入控制 MAC地址;
该路由器的控制平面将该第一网元的 IP地址下送至该路由器的数据平 面的路由转发表, 生成第一表项, 该第一表项的目的 IP地址为该第一网元 的 IP地址, 该第一表项的下一跳 IP地址为该第一网元的 IP地址;
该路由器的控制平面将该第一网元的 IP地址以及 MAC地址下送至该 路由器的数据平面的地址解析协议 ARP緩存表, 生成第二表项, 该第二表 项的目的 IP地址为该第一网元的 IP地址, 该第二表项的目的 MAC地址为 该第一网元的 MAC地址;
该路由器向该路由器的邻居路由器发布路由消息, 该路由消息中包含 该第一网元的 IP地址;
收到该邻居路由器转发的第一 IP分组, 该第一 IP分组的源 IP地址为 第二网元的 IP地址,该第一 IP分组的目的 IP地址为该第一网元的 IP地址, 该第二网元的 IP地址与该第一网元的 IP地址处于不同网段;
该路由器根据该第一 IP分组的目的 IP地址查找该第一表项,该路由器 根据该第一表项的下一跳 IP地址查找该第二表项, 该路由器根据该第二表 项的目的 MAC地址转发该第一 IP分组。
另一方面, 本发明实施例提供的另一种发送 IP分组的方法, 包括: 第一网元的控制平面通过 PPPoE获取路由器的 IP地址和 MAC地址; 该第一网元的控制平面将该路由器的 IP地址下送至该第一网元的数据 平面的路由转发表, 生成第三表项, 该第三表项的目的 IP地址为第一网段 地址, 该第一网段地址覆盖第二网元的 IP地址, 该第三表项的下一跳 IP地 址为该路由器的 IP地址, 该第二网元的 IP地址和该第一网元的 IP地址处 于不同网段;
该第一网元的控制平面将该路由器的 IP地址以及 MAC地址下送至该 第一网元的数据平面的 ARP緩存表, 生成第四表项, 该第四表项的目的 IP 地址为该路由器的 IP 地址, 该第四表项的目的 MAC地址为该路由器的 MAC地址;
该第一网元通过该路由器向该第二网元发送第二 IP分组, 该第一网元 根据该第二 IP分组的目的 IP地址查找该第三表项,该第一网元根据该第三 表项的下一跳 IP地址查找该第四表项, 该第一网元根据该第四表项的目的 MAC地址发送该第二 IP分组,该第二 IP分组的目的 IP地址为该第二网元 的 IP地址。
又一方面, 本发明实施例提供的一种发送 IP分组的装置, 包括: 第一获取单元, 路由器的控制平面用于通过 PPPoE获取第一网元的 IP 地址和 MAC地址;
第一表项生成单元, 该路由器的控制平面用于将该第一网元的 IP地址 下送至该路由器的数据平面的路由转发表, 生成第一表项, 该第一表项的 目的 IP地址为该第一网元的 IP地址, 该第一表项的下一跳 IP地址为该第 一网元的 IP地址;
第二表项生成单元, 该路由器的控制平面用于将该第一网元的 IP地址 以及 MAC地址下送至该路由器的数据平面的地址解析协议 ARP緩存表, 生成第二表项, 该第二表项的目的 IP地址为该第一网元的 IP地址, 该第二 表项的目的 MAC地址为该第一网元的 MAC地址;
路由消息发布单元, 该路由器用于向该路由器的邻居路由器发布路由 消息, 该路由消息中包含该第一网元的 IP地址;
接收单元, 用于接收该邻居路由器转发的第一 IP分组, 该第一 IP分组 的源 IP地址为第二网元的 IP地址, 该第一 IP分组的目的 IP地址为该第一 网元的 IP地址, 该第二网元的 IP地址与该第一网元的 IP地址处于不同网 段;
第一发送器,该路由器用于根据该第一 IP分组的目的 IP地址查找该第 一表项, 该路由器根据该第一表项的下一跳 IP地址查找该第二表项, 该路 由器根据该第二表项的目的 MAC地址转发该第一 IP分组。
又一方面, 本发明实施例提供的另一种发送 IP分组的装置, 包括: 第二获取单元, 第一网元的控制平面用于通过 PPPoE获取路由器的 IP 地址和 MAC地址;
第三表项生成单元, 该第一网元的控制平面用于将该路由器的 IP地址 下送至该第一网元的数据平面的路由转发表, 生成第三表项, 该第三表项 的目的 IP地址为第一网段地址, 该第一网段地址覆盖第二网元的 IP地址, 该第三表项的下一跳 IP地址为该路由器的 IP地址, 该第二网元的 IP地址 和该第一网元的 IP地址处于不同网段;
第四表项生成单元, 该第一网元的控制平面用于将该路由器的 IP地址 以及 MAC地址下送至该第一网元的数据平面的 ARP緩存表, 生成第四表 项, 该第四表项的目的 IP地址为该路由器的 IP地址, 该第四表项的目的 MAC地址为该路由器的 MAC地址;
第二发送器, 该第一网元用于通过该路由器向该第二网元发送第二 IP 分组, 该第一网元根据该第二 IP分组的目的 IP地址查找该第三表项, 该第 一网元根据该第三表项的下一跳 IP地址查找该第四表项, 该第一网元根据 该第四表项的目的 MAC地址发送该第二 IP分组,该第二 IP分组的目的 IP 地址为该第二网元的 IP地址。 过路由器和与本端设备不在同一网段的远端设备通信, 路由器不需要通过 路由协议发现接入设备, 并根据路由消息提供的信息在路由转发表中动态 建立并维护目的 IP地址为本端设备的表项, 从而降低了路由器的开销。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对 实施例或现有技术描述中所需要使用的附图作一简单地介绍, 显而易见地, 下面描述中的附图是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1是本发明实施例提供发送 IP分组的方法及装置应用于某一场景的 组网结构图; 图 2是本发明实施例提供的一种发送 IP分组的方法的流程图; 图 3是本发明实施例提供的另一种发送 IP分组的方法的流程图; 图 4是本发明实施例提供的一种发送 IP分组的装置的示意图; 图 5是本发明实施例提供的另一种发送 IP分组的装置的示意图。
具体实施方式 为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本 发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描 述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作出创造性劳动前提 下所获得的所有其他实施例, 都属于本发明保护的范围。
本发明实施例提供了发送 IP分组的方法及装置, 本端设备通过路由器 和与本端设备不在同一网段的远端设备通信, 路由器不需要通过路由协议 发现本端设备, 并根据路由消息提供的信息在路由转发表中动态建立并维 护目的 IP地址为本端设备的表项, 从而降低了路由器的开销。 图 1为本发 明实施例某一应用场景的组网结构图。
图 1 的组网结构图包括三个网元以及因特网, 三个网元分别是手机、 基站以及路由器。 手机与基站建立了无线链路, 基站与路由器建立了有线 链路, 路由器接入到因特网。 手机可以通过基站以及路由器对因特网进行 访问。
实施例一:
本发明实施例提供了一种发送 IP分组的方法,可以用于移动 IP场景中, 参见图 2, 图 2是本发明实施例提供的发送 IP分组的方法的流程图, 该方 法包括:
201 :路由器的控制平面通过以太网上的点对点协议 PPPoE获取第一网 元的 IP地址和媒体接入控制 MAC地址。
具体实现时, 第一网元可以是固定网元或者移动网元。 其中, 固定网 元可以是路由器或者交换机。 移动网元可以是移动终端或者虚拟机。 移动 终端可以是手机、 个人数字助理( Personal Digital Assistant, PDA )或者便 携个人电脑 ( Portable Personal Computer, Portable PC ) 。 第一网元可以和 路由器直连。 第一网元也可以通过 IP层接入设备和路由器相连。 路由器的 控制平面通过以太网上的点对点十办议 ( Point-to-Point Protocol over Ethernet , PPPoE )获取第一网元的 IP地址以及媒体接入控制 ( Media Access Control, MAC )地址。 具体实现时, 第一网元可以在广播域内广播 PPPoE定义的发 现(discovery )报文。 路由器处于第一网元的广播域。 discovery报文中承 载第一网元的 IP地址以及 MAC地址。 路由器收到 discovery报文后, 可以 向第一网元发送响应 4艮文。 该响应 4艮文中可以承载路由器的 IP 地址以及 MAC地址。
另外,可以通过扩展现有协议获取第一网元的 IP地址以及 MAC地址。 例如, 可以扩展现有的动态主机配置协议 ( Dynamic Host Configuration Protocol, DHCP ) 。 例如, 可以将 DHCP 的一个保留的选项 (Option )类 型定义为一个新的地址获取协议。 路由器可以通过这个新的地址获取协议 获取第一网元的 IP地址以及 MAC地址。 具体实现时, 该保留的 Option类 型可以包含 5个字段, 分别是子类型 (subtype ) 、 源 IP地址、 源 MAC地 址、 目的 IP地址、 目的 MAC地址。 subtype可以包括 2个类型。 当 subtype 的值为 1时, DHCP报文为首次报文; 当 subtype的值为 2时, DHCP报文 为第二次报文。 路由器在广播域内广播首次 discovery报文。 第一网元处于 该广播域。 第一网元收到该 discovery报文后, 向路由器返回对应的响应报 文。首次 discovery报文的源 MAC地址为路由器的 MAC地址。首次 discovery 报文对应的响应报文的源 MAC地址为第一网元的 MAC地址, 源 IP地址 为第一网元的 IP地址, 目的 MAC地址为路由器的 MAC地址, 目的 IP地 址为路由器的 IP地址。其中,首次 discovery报文对应的响应报文的目的 IP 地址是第一网元为路由器分配的。 路由器收到首次 discovery报文对应的响 应报文后, 向第一网元发出第二次 discovery报文。 第二次 discovery报文的 源 MAC地址、 源 IP地址、 目的 MAC地址、 目的 IP地址分别是路由器的 MAC地址、 路由器的 IP地址、 第一网元 MAC地址以及第一网元的 IP地 址。 第一网元收到第二次 discovery报文后, 分别对第二次 discovery报文的 源 MAC地址、 源 IP地址、 目的 MAC地址、 目的 IP地址进行核对。 如果 源 MAC地址、 源 IP地址、 目的 MAC地址、 目的 IP地址分别为路由器的 MAC地址、 路由器的 IP地址、 第一网元的 MAC地址以及第一网元的 IP 地址, 第一网元向路由器返回相应的响应报文。 这样, 路由器就通过扩展 后的 DHCP获得第一网元的 IP地址以及 MAC地址。 同时, 第一网元也获 得路由器的 IP地址以及 MAC地址。
第一网元的 IP地址可以是第一网元的接口的 IP地址,也可以是第一网 元的业务的 IP地址。 所述业务可以是第一网元的视频流业务, 也可以是第 一网元的音频流业务。当第一网元的 IP地址是第一网元的接口的 IP地址时 , 第一网元的接口可以是物理接口, 也可以是逻辑接口。 所述逻辑接口可以 是环回( Loopback )接口, 或者隧道( Tunnel )接口。 所述隧道可以是第二 层协议( Layer 2 Tunneling Protocol, L2TP )隧道、通用路由封装协议( Generic Route Encapsulation, GRE )隧道或者多协议标签交换( Multi-Protocol Label Switching, MPLS ) P遂道。
第一网元的 MAC地址可以是第一网元的接口的 MAC地址。 第一网元 的接口的 MAC地址可以是第一网元的物理接口的 MAC地址, 也可以是第 一网元的逻辑接口的 MAC地址。 当第一网元的 MAC地址是第一网元的逻 辑接口的 MAC地址时 , 所述逻辑接口可以是虚拟以太网( Virtual Ethernet , VE )接口, 也可以是第一网元的物理接口对应的子接口。 所述子接口可以 根据第一网元的物理接口的 IP 地址以及虚拟局域网 (Virtual Local Area Network, VLAN )标签确定。
参见图 1 , 手机为第一网元。 路由器的控制平面通过 PPPoE获取手机 的的 IP地址以及 MAC地址。 手机通过基站和路由器相连。
202:该路由器的控制平面将该第一网元的 IP地址下送至该路由器的数 据平面的路由转发表, 生成第一表项, 该第一表项的目的 IP地址为该第一 网元的 IP地址 , 该第一表项的下一跳 IP地址为该第一网元的 IP地址。
路由器的控制平面将第一网元的 IP地址下送至该第一网元的数据平面 的路由转发表, 使第一网元的路由转发表中具有了第一表项。 第一表项的 目的 IP地址为第一网元的 IP地址, 第一表项的下一跳 IP地址为第一网元 的 IP地址。 这样, 路由器转发目的 IP地址为第一网元的 IP地址的 IP分组 时, 可以通过查询第一表项获得下一跳 IP地址。
参见图 1 , 路由器的控制平面将手机的 IP地址下送至路由器的数据平 面的路由转发表。
203:该路由器的控制平面将该第一网元的 IP地址以及 MAC地址下送 至该路由器的数据平面的地址解析协议 ARP緩存表, 生成第二表项。 该第 二表项的目的 IP地址为该第一网元的 IP地址。 该第二表项的目的 MAC地 址为该第一网元的 MAC地址。
路由器的控制平面将第一网元的 IP地址以及 MAC地址下送至该路由 器的数据平面的地址解析协议( Address Resolution Protocol, ARP )緩存表, 使得第一网元的 ARP緩存表具备了第二表项 ,第二表项的目的 IP地址为第 一网元的 IP地址。 第二表项的目的 MAC地址为第一网元的 MAC地址。 这样, 路由器转发下一跳 IP地址为第一网元的 IP地址的 IP分组时, 可以 通过第二表项获得下一跳 MAC地址。
参见图 1 , 路由器的控制平面将手机的 IP地址以及 MAC下送至路由 器的数据平面的 ARP緩存表。
204: 该路由器向该路由器的邻居路由器发布路由消息。 该路由消息中 包含该第一网元的 IP地址。
路由器向邻居路由器发布路由消息, 路由消息中包含第一网元的 IP地 址。 这样, 邻居路由器转发目的 IP地址为第一网元的 IP地址的 IP分组时, 可以通过邻居路由器的路由转发表获得该 IP分组的下一跳 IP地址。路由器 向邻居路由器发布路由消息, 可以通过路由协议向邻居路由器发布路由消 息。具体可以是通过 BGP发布路由消息,也可以是通过 IGP发布路由消息。
参见图 1 , 路由器通过 BGP向邻居路由器发布路由消息, 该路由器消 息中包含手机的 IP地址。 这样, 邻居路由器转发目的 IP地址为手机的 IP 地址的 IP分组时,可以通过邻居路由器的路由转发表获得该 IP分组的下一 跳 IP地址。
205: 收到该邻居路由器转发的第一 IP分组。 该第一 IP分组的源 IP地 址为第二网元的 IP地址。 该第一 IP分组的目的 IP地址为该第一网元的 IP 地址。 该第二网元的 IP地址与该第一网元的 IP地址处于不同网段。
邻居路由器查询路由转发表, 将第一 IP分组转发到路由器。 路由器收 到第一 IP分组。 路由器收到邻居路由器转发的第一 IP分组。 第一 IP分组 的目的 IP地址为第一网元的 IP地址。 第一 IP分组的源 IP地址为第二网元 的 IP地址。 第二网元与第一网元处于不同网段。 具体实现时, 可以是第一 网元和第二网元分别处于因特网协议版本 4 ( Internet Protocol version 4 , IPv4 )网络的不同网段,也可以是第一网元和第二网元分别处于因特网协议 版本 6 ( Internet Protocol version 6 , IPv6 ) 网络的不同网段。
参见图 1 , 服务器为第二网元。 服务器通过因特网与邻居路由器相连。 服务器与手机处于不同网段。 服务器通过因特网向手机发送第一 IP分组。 第一 IP分组的目的 IP地址为手机的 IP地址。邻居路由器收到第一 IP分组。
206: 该路由器根据该第一 IP分组的目的 IP地址查找该第一表项。 该 路由器根据该第一表项的下一跳 IP地址查找该第二表项。 该路由器根据该 第二表项的目的 MAC地址转发该第一 IP分组。
路由器根据第一 IP分组的目的 IP地址查找第一表项。路由器根据第一 表项的下一跳 IP地址查找第二表项。 路由器根据第二表项的目的 MAC地 址发送第一 IP分组。
参见图 1 , 路由器根据第一 IP分组的目的 IP地址查找第一表项。 路由 器根据第一表项的下一跳 IP地址查找第二表项。 路由器根据第二表项的目 的 MAC地址发送第一 IP分组。 这样, 手机可以收到服务器发送的第一 IP 分组。
可见,通过本发明实施例提供的发送 IP分组的方法,路由器通过 PPPoE 协议获得了本端设备的 IP地址以及 MAC地址。 路由器根据本端设备的 IP 地址以及 MAC地址, 建立了相应的路由转发表的表项以及 ARP緩存表的 表项。 与本端设备不在同一网段的远端设备可以通过路由器向本端设备发 送 IP分组。路由器通过 PPPoE协议获得了本端设备的 IP地址以及 MAC地 址。 这样, 路由器不需要通过路由协议发现本端设备, 并根据路由消息提 供的信息在路由转发表中动态建立并维护目的 IP地址为本端设备的表项, 从而降低了路由器的开销。
另外,通过本发明实施例提供的发送 IP分组的方法,路由器通过 PPPoE 协议获得本端设备的 IP地址以及 MAC地址。发送 IP分组的方法没有对本 端设备的 IP地址有特别的要求和限定。因此本端设备的 IP地址可以是特定 网段的 IP地址, 并且可以保持不变。 这意味着, 当本端设备是移动网元时, 跨越不同的网段的本端设备可以使用固定 IP地址与远端设备通信。
可选的,
该第一网元的 IP地址为该第一网元的第一接口的 IP地址,该第一网元 的 MAC地址为该第一网元的第一接口的 MAC地址, 该路由器通过该第一 接口和该第一网元进行通信。
可选的,
该路由器的控制平面通过 PPPoE获取第一网元的 IP地址和媒体接入控 制 MAC地址具体包括:
该路由器接收该第一网元发送的发现 discovery报文,该 discovery报文 中承载了该第一网元的 IP地址以及第一网元的 MAC地址。
可选的,
该路由器和该第一网元通过 IP层网络接入设备相连。
IP层网络接入设备可以透传 IP分组。 IP层网络接入设备可以是基站。 参见图 1 , 基站是 IP层网络接入设备。 路由器和手机通过基站连接。 实施例二:
本发明实施例提供了另一种发送 IP分组的方法,可以用于移动 IP场景 中, 参见图 3 , 图 3是本发明实施例提供的发送 IP分组的方法的流程图, 该方法包括:
301 : 第一网元的控制平面通过 PPPoE获取路由器的 IP地址和 MAC 地址。
关于第一网元的控制平面通过 PPPoE获取路由器的 IP地址和 MAC地 址, 具体请参考实施例一中的 201。
路由器的 IP地址可以是路由器的接口的 IP地址,也可以是路由器的业 务的 IP地址。 所述业务可以是路由器的视频流业务, 也可以是路由器的音 频流业务。 当路由器的 IP地址是路由器的接口的 IP地址时,路由器的接口 可以是物理接口, 也可以是逻辑接口。 所述逻辑接口可以是环回接口, 或 者隧道接口。 所述隧道可以是 L2TP隧道、 GRE隧道或者 MPLS隧道。
路由器的 MAC地址可以是路由器的接口的 MAC地址。路由器的接口 的 MAC地址可以是路由器的物理接口的 MAC地址, 也可以是路由器的逻 辑接口的 MAC地址。 当路由器的 MAC地址是路由器的逻辑接口的 MAC 地址时, 所述逻辑接口可以是 VE接口,也可以是路由器的物理接口对应的 子接口。 所述子接口可以根据路由器的物理接口的 IP地址以及虚拟局域网 VLAN标签确定。
302:该第一网元的控制平面将该路由器的 IP地址下送至该第一网元的 数据平面的路由转发表, 生成第三表项。 该第三表项的目的 IP地址为第一 网段地址。 该第一网段地址覆盖第二网元的 IP地址。 该第三表项的下一跳 IP地址为该路由器的 IP地址。 该第二网元的 IP地址和该第一网元的 IP地 址处于不同网段。
第一网元的控制平面将路由器的 IP地址下送至该第一网元的数据平面 的路由转发表, 生成第三表项。 第三表项的目的 IP地址为第一网段地址, 该第一网段地址覆盖第二网元的 IP地址。 生成第三表项的过程与生成第一 表项的过程类似。 具体请参考实施例一中的 202。
303:该第一网元的控制平面将该路由器的 IP地址以及 MAC地址下送 至该第一网元的数据平面的 ARP緩存表, 生成第四表项, 该第四表项的目 的 IP地址为该路由器的 IP地址, 该第四表项的目的 MAC地址为该路由器 的 MAC地址;
该第一网元的控制平面将该路由器的 IP地址以及 MAC地址下送至该 第一网元的数据平面的 ARP緩存表, 生成第四表项。 该第四表项的目的 IP 地址为该路由器的 IP 地址。 该第四表项的目的 MAC地址为该路由器的 MAC地址。 生成第四表项的过程与生成第二表项的过程类似。 具体请参考 实施例一中的 203。
304: 该第一网元通过该路由器向该第二网元发送第二 IP分组,该第一 网元根据该第二 IP分组的目的 IP地址查找该第三表项,该第一网元根据该 第三表项的下一跳 IP地址查找该第四表项, 该第一网元根据该第四表项的 目的 MAC地址发送该第二 IP分组, 该第二 IP分组的目的 IP地址为该第 二网元的 IP地址。
该第一网元根据该第二 IP分组的目的 IP地址查找该第三表项,该第一 网元根据该第三表项的下一跳 IP地址查找该第四表项, 该第一网元根据该 第四表项的目的 MAC地址发送该第二 IP分组。 第一网元发送第二 IP分组 的过程与路由器转发第一 IP 分组的过程类似。 具体请参考实施例一中的 206。 可见, 通过本发明实施例提供的发送 IP 分组的方法, 本端设备通过 PPPoE协议获得了路由器的 IP地址以及 MAC地址。 本端设备根据路由器 的 IP地址以及 MAC地址,建立了相应的路由转发表的表项以及 ARP緩存 表的表项。 本端设备可以通过路由器向与本端设备不在同一网段的远端设 备发送 IP分组。本端设备通过 PPPoE协议获得了路由器的 IP地址以及 MAC 地址。 这样, 本端设备不需要通过路由协议发现路由器, 并根据路由消息 提供的信息在本端设备的路由转发表中动态建立并维护目的 IP地址为远端 设备的表项, 从而降低了本端设备的开销。
另外, 通过本发明实施例提供的发送 IP 分组的方法, 本端设备通过 PPPoE协议获得路由器的 IP地址以及 MAC地址。发送 IP分组的方法没有 对本端设备的 IP地址有特别的要求和限定。因此本端设备的 IP地址可以是 特定网段的 IP地址, 并且可以保持不变。 这意味着, 当本端设备是移动网 元时, 跨越不同的网段的本端设备可以使用固定 IP地址与远端设备通信。
可选的,
该路由器的 IP地址为该路由器的第二接口的 IP地址。该路由器的 MAC 地址为该路由器的第二接口的 MAC地址,该第一网元通过该第二接口和该 路由器进行通信。
可选的,
该路由器和该第一网元通过 IP层网络接入设备相连。
参见图 1 , 基站是 IP层网络接入设备。 路由器和手机通过基站连接。 实施例三:
本发明实施例提供了一种发送 IP分组的装置,可以用于移动 IP场景中。 该发送 IP分组的装置可以是图 1中的路由器。 参见图 4, 图 4是本发明实 施例提供的发送 IP分组的装置的示意图; 该装置包括:
第一获取单元 401 , 路由器的控制平面用于通过 PPPoE获取第一网元 的 IP地址和 MAC地址。 具体实现时, 第一网元可以是固定网元或者移动网元。 其中, 固定网 元可以是路由器或者交换机。 移动网元可以是移动终端或者虚拟机。 移动 终端可以是手机、 PDA或者 Portable PC。 第一网元可以和路由器直连。 第 一网元也可以通过 IP 层接入设备和路由器相连。 路由器的控制平面通过 PPPoE获取第一网元的 IP地址以及 MAC地址。 具体实现时, 第一网元可 以在广播域内广播 PPPoE定义的 discovery报文。路由器处于第一网元的广 播域。 discovery报文中承载第一网元的 IP地址以及 MAC地址。 路由器收 到 discovery报文后, 可以向第一网元发送响应报文。 该响应报文中可以承 载路由器的 IP地址以及 MAC地址。
另外,可以通过扩展现有协议获取第一网元的 IP地址以及 MAC地址。 例如, 可以扩展现有的 DHCP。 例如, 可以将 DHCP的一个保留的 Option 类型定义为一个新的地址获取协议。 路由器可以通过这个新的地址获取协 议获取第一网元的 IP地址以及 MAC地址。 具体实现时, 该保留的 Option 类型可以包含 5个字段, 分别是 subtype, 源 IP地址、 源 MAC地址、 目的 IP地址、 目的 MAC地址。 subtype可以包括 2个类型。 当 subtype的值为 1 时, DHCP报文为首次报文; 当 subtype的值为 2时, DHCP报文为第二次 报文。路由器在广播域内广播首次 discovery报文。第一网元处于该广播域。 第一网元收到该 discovery报文后, 向路由器返回对应的响应报文。 首次 discovery报文的源 MAC地址为路由器的 MAC地址。 首次 discovery报文 对应的响应报文的源 MAC地址为第一网元的 MAC地址 , 源 IP地址为第 一网元的 IP地址, 目的 MAC地址为路由器的 MAC地址, 目的 IP地址为 路由器的 IP地址。 其中, 首次 discovery报文对应的响应报文的目的 IP地 址是第一网元为路由器分配的。 路由器收到首次 discovery报文对应的响应 报文后, 向第一网元发出第二次 discovery报文。 第二次 discovery报文的源 MAC地址、源 IP地址、目的 MAC地址、目的 IP地址分别是路由器的 MAC 地址、 路由器的 IP地址、 第一网元 MAC地址以及第一网元的 IP地址。 第 一网元收到第二次 discovery报文后,分别对第二次 discovery报文的源 MAC 地址、 源 IP地址、 目的 MAC地址、 目的 IP地址进行核对。 如果源 MAC 地址、 源 IP地址、 目的 MAC地址、 目的 IP地址分别为路由器的 MAC地 址、 路由器的 IP地址、 第一网元的 MAC地址以及第一网元的 IP地址, 第 一网元向路由器返回相应的响应报文。这样,路由器就通过扩展后的 DHCP 获得第一网元的 IP地址以及 MAC地址。 同时, 第一网元也获得路由器的 IP地址以及 MAC地址。
第一网元的 IP地址可以是第一网元的接口的 IP地址,也可以是第一网 元的业务的 IP地址。 所述业务可以是第一网元的视频流业务, 也可以是第 一网元的音频流业务。当第一网元的 IP地址是第一网元的接口的 IP地址时 , 第一网元的接口可以是物理接口, 也可以是逻辑接口。 所述逻辑接口可以 是环回接口, 或者隧道接口。 所述隧道可以是 L2TP隧道、 GRE隧道或者 MPLS隧道。
第一网元的 MAC地址可以是第一网元的接口的 MAC地址。 第一网元 的接口的 MAC地址可以是第一网元的物理接口的 MAC地址, 也可以是第 一网元的逻辑接口的 MAC地址。 当第一网元的 MAC地址是第一网元的逻 辑接口的 MAC地址时 , 所述逻辑接口可以是 VE接口, 也可以是第一网元 的物理接口对应的子接口。 所述子接口可以根据第一网元的物理接口的 IP 地址以及 VLAN标签确定。
参见图 1 , 手机为第一网元。 路由器的控制平面通过 PPPoE获取手机 的的 IP地址以及 MAC地址。 手机通过基站和路由器相连。
第一表项生成单元 402, 该路由器的控制平面用于将该第一网元的 IP 地址下送至该路由器的数据平面的路由转发表, 生成第一表项。 该第一表 项的目的 IP地址为该第一网元的 IP地址。 该第一表项的下一跳 IP地址为 该第一网元的 IP地址。
路由器的控制平面将第一网元的 IP地址下送至该第一网元的数据平面 的路由转发表, 使第一网元的路由转发表中具有了第一表项。 第一表项的 目的 IP地址为第一网元的 IP地址, 第一表项的下一跳 IP地址为第一网元 的 IP地址。 这样, 路由器转发目的 IP地址为第一网元的 IP地址的 IP分组 时, 可以通过查询第一表项获得下一跳 IP地址。
参见图 1 , 路由器的控制平面将手机的 IP地址下送至路由器的数据平 面的路由转发表。
第二表项生成单元 403 , 该路由器的控制平面用于将该第一网元的 IP 地址以及 MAC地址下送至该路由器的数据平面的地址解析协议 ARP緩存 表, 生成第二表项。 该第二表项的目的 IP地址为该第一网元的 IP地址。 该 第二表项的目的 MAC地址为该第一网元的 MAC地址。
路由器的控制平面将第一网元的 IP地址以及 MAC地址下送至该路由 器的数据平面的 ARP緩存表 ,使得第一网元的 ARP緩存表具备了第二表项, 第二表项的目的 IP地址为第一网元的 IP地址。 第二表项的目的 MAC地址 为第一网元的 MAC地址。 这样, 路由器转发下一跳 IP地址为第一网元的 IP地址的 IP分组时, 可以通过第二表项获得下一跳 MAC地址。
参见图 1 , 路由器的控制平面将手机的 IP地址以及 MAC下送至路由 器的数据平面的 ARP緩存表。
路由消息发布单元 404,该路由器用于向该路由器的邻居路由器发布路 由消息。 该路由消息中包含该第一网元的 IP地址。
路由器向邻居路由器发布路由消息, 路由消息中包含第一网元的 IP地 址。 这样, 邻居路由器转发目的 IP地址为第一网元的 IP地址的 IP分组时, 可以通过邻居路由器的路由转发表获得该 IP分组的下一跳 IP地址。路由器 向邻居路由器发布路由消息, 可以通过路由协议向邻居路由器发布路由消 息。具体可以是通过 BGP发布路由消息,也可以是通过 IGP发布路由消息。
参见图 1 , 路由器通过 BGP向邻居路由器发布路由消息, 该路由器消 息中包含手机的 IP地址。 这样, 邻居路由器转发目的 IP地址为手机的 IP 地址的 IP分组时,可以通过邻居路由器的路由转发表获得该 IP分组的下一 跳 IP地址。
接收单元 405, 用于接收该邻居路由器转发的第一 IP分组。 该第一 IP 分组的源 IP地址为第二网元的 IP地址。 该第一 IP分组的目的 IP地址为该 第一网元的 IP地址。 该第二网元的 IP地址与该第一网元的 IP地址处于不 同网段。
邻居路由器查询路由转发表, 将第一 IP分组转发到路由器。 路由器收 到第一 IP分组。 路由器收到邻居路由器转发的第一 IP分组。 第一 IP分组 的目的 IP地址为第一网元的 IP地址。 第一 IP分组的源 IP地址为第二网元 的 IP地址。 第二网元与第一网元处于不同网段。 具体实现时, 可以是第一 网元和第二网元分别处于 IPv4网络的不同网段, 也可以是第一网元和第二 网元分别处于 IPv6网络的不同网段。
参见图 1 , 服务器为第二网元。 服务器通过因特网与邻居路由器相连。 服务器与手机处于不同网段。 服务器通过因特网向手机发送第一 IP分组。 第一 IP分组的目的 IP地址为手机的 IP地址。邻居路由器收到第一 IP分组。
第一发送器 406, 该路由器用于根据该第一 IP分组的目的 IP地址查找 该第一表项。 该路由器根据该第一表项的下一跳 IP地址查找该第二表项。 该路由器根据该第二表项的目的 MAC地址转发该第一 IP分组。
路由器根据第一 IP分组的目的 IP地址查找第一表项。路由器根据第一 表项的下一跳 IP地址查找第二表项。 路由器根据第二表项的目的 MAC地 址发送第一 IP分组。
参见图 1 , 路由器根据第一 IP分组的目的 IP地址查找第一表项。 路由 器根据第一表项的下一跳 IP地址查找第二表项。 路由器根据第二表项的目 的 MAC地址发送第一 IP分组。 这样, 手机可以收到服务器发送的第一 IP 分组。
可见,通过本发明实施例提供的发送 IP分组的装置,路由器通过 PPPoE 协议获得了本端设备的 IP地址以及 MAC地址。 路由器根据本端设备的 IP 地址以及 MAC地址, 建立了相应的路由转发表的表项以及 ARP緩存表的 表项。 与本端设备不在同一网段的远端设备可以通过路由器向本端设备发 送 IP分组。路由器通过 PPPoE协议获得了本端设备的 IP地址以及 MAC地 址。 这样, 路由器不需要通过路由协议发现本端设备, 并根据路由消息提 供的信息在路由转发表中动态建立并维护目的 IP地址为本端设备的表项, 从而降低了路由器的开销。
另外,通过本发明实施例提供的发送 IP分组的装置,路由器通过 PPPoE 协议获得本端设备的 IP地址以及 MAC地址。发送 IP分组的装置没有对本 端设备的 IP地址有特别的要求和限定。因此本端设备的 IP地址可以是特定 网段的 IP地址, 并且可以保持不变。 这意味着, 当本端设备是移动网元时, 跨越不同的网段的本端设备可以使用固定 IP地址与远端设备通信。
实施例四:
本发明实施例提供了另一种发送 IP分组的装置,可以用于移动 IP场景 中。 该发送 IP分组的装置可以是图 1中的路由器。 参见图 5, 图 5是本发 明实施例提供的发送 IP分组的装置的示意图; 该装置包括:
第二获取单元 501 , 第一网元的控制平面用于通过 PPPoE获取路由器 的 IP地址和 MAC地址。
关于第一网元的控制平面通过 PPPoE获取路由器的 IP地址和 MAC地 址, 具体请参考实施例二中的 301。
路由器的 IP地址可以是路由器的接口的 IP地址,也可以是路由器的业 务的 IP地址。 所述业务可以是路由器的视频流业务, 也可以是路由器的音 频流业务。 当路由器的 IP地址是路由器的接口的 IP地址时,路由器的接口 可以是物理接口, 也可以是逻辑接口。 所述逻辑接口可以是环回接口, 或 者隧道接口。 所述隧道可以是 L2TP隧道、 GRE隧道或者 MPLS隧道。
路由器的 MAC地址可以是路由器的接口的 MAC地址。路由器的接口 的 MAC地址可以是路由器的物理接口的 MAC地址, 也可以是路由器的逻 辑接口的 MAC地址。 当路由器的 MAC地址是路由器的逻辑接口的 MAC 地址时, 所述逻辑接口可以是 VE接口,也可以是路由器的物理接口对应的 子接口。 所述子接口可以根据路由器的物理接口的 IP地址以及虚拟局域网 VLAN标签确定。
第三表项生成单元 502, 该第一网元的控制平面用于将该路由器的 IP 地址下送至该第一网元的数据平面的路由转发表, 生成第三表项。 该第三 表项的目的 IP地址为第一网段地址。该第一网段地址覆盖第二网元的 IP地 址。 该第三表项的下一跳 IP地址为该路由器的 IP地址。 该第二网元的 IP 地址和该第一网元的 IP地址处于不同网段。
第一网元的控制平面将路由器的 IP地址下送至该第一网元的数据平面 的路由转发表, 生成第三表项。 第三表项的目的 IP地址为第一网段地址, 该第一网段地址覆盖第二网元的 IP地址。 关于生成第三表项的过程请参考 实施例二中的 302。
第四表项生成单元 503 , 该第一网元的控制平面用于将该路由器的 IP 地址以及 MAC地址下送至该第一网元的数据平面的 ARP緩存表, 生成第 四表项。该第四表项的目的 IP地址为该路由器的 IP地址。该第四表项的目 的 MAC地址为该路由器的 MAC地址。
该第一网元的控制平面将该路由器的 IP地址以及 MAC地址下送至该 第一网元的数据平面的 ARP緩存表, 生成第四表项。 该第四表项的目的 IP 地址为该路由器的 IP 地址。 该第四表项的目的 MAC地址为该路由器的 MAC地址。 关于生成第四表项的过程请参考实施例二中的 303。
第二发送器 504 ,该第一网元用于通过该路由器向该第二网元发送第二 IP分组, 该第一网元根据该第二 IP分组的目的 IP地址查找该第三表项, 该第一网元根据该第三表项的下一跳 IP地址查找该第四表项, 该第一网元 根据该第四表项的目的 MAC地址发送该第二 IP分组, 该第二 IP分组的目 的 IP地址为该第二网元的 IP地址。
该第一网元根据该第二 IP分组的目的 IP地址查找该第三表项,该第一 网元根据该第三表项的下一跳 IP地址查找该第四表项, 该第一网元根据该 第四表项的目的 MAC地址发送该第二 IP分组。 关于第一网元发送第二 IP 分组的过程请参考实施例二中的 304。
可见, 通过本发明实施例提供的发送 IP 分组的装置, 本端设备通过 PPPoE协议获得了路由器的 IP地址以及 MAC地址。 本端设备根据路由器 的 IP地址以及 MAC地址,建立了相应的路由转发表的表项以及 ARP緩存 表的表项。 本端设备可以通过路由器向与本端设备不在同一网段的远端设 备发送 IP分组。本端设备通过 PPPoE协议获得了路由器的 IP地址以及 MAC 地址。 这样, 本端设备不需要通过路由协议发现路由器, 并根据路由消息 提供的信息在本端设备的路由转发表中动态建立并维护目的 IP地址为远端 设备的表项, 从而降低了本端设备的开销。
另外, 通过本发明实施例提供的发送 IP 分组的装置, 本端设备通过 PPPoE协议获得路由器的 IP地址以及 MAC地址。发送 IP分组的装置没有 对本端设备的 IP地址有特别的要求和限定。因此本端设备的 IP地址可以是 特定网段的 IP地址, 并且可以保持不变。 这意味着, 当本端设备是移动网 元时, 跨越不同的网段的本端设备可以使用固定 IP地址与远端设备通信。
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步 骤可以通过程序指令相关的硬件来完成, 前述程序可以存储于一计算机可 读取存储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而 前述的存储介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序代 码的介质。
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对 其限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通 技术人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修 改, 或者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不 使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims

权利要求书
1.一种发送因特网协议 IP分组的方法, 其特征在于:
路由器的控制平面通过以太网上的点对点协议 PPPoE获取第一网元的 IP地址和媒体接入控制 MAC地址;
所述路由器的控制平面将所述第一网元的 IP地址下送至所述路由器的 数据平面的路由转发表, 生成第一表项, 所述第一表项的目的 IP地址为所 述第一网元的 IP地址,所述第一表项的下一跳 IP地址为所述第一网元的 IP 地址;
所述路由器的控制平面将所述第一网元的 IP地址以及 MAC地址下送 至所述路由器的数据平面的地址解析协议 ARP緩存表, 生成第二表项, 所 述第二表项的目的 IP地址为所述第一网元的 IP地址,所述第二表项的目的 MAC地址为所述第一网元的 MAC地址;
所述路由器向所述路由器的邻居路由器发布路由消息, 所述路由消息 中包含所述第一网元的 IP地址;
收到所述邻居路由器转发的第一 IP分组, 所述第一 IP分组的源 IP地 址为第二网元的 IP地址, 所述第一 IP分组的目的 IP地址为所述第一网元 的 IP地址, 所述第二网元的 IP地址与所述第一网元的 IP地址处于不同网 段;
所述路由器根据所述第一 IP分组的目的 IP地址查找所述第一表项,所 述路由器根据所述第一表项的下一跳 IP地址查找所述第二表项, 所述路由 器根据所述第二表项的目的 MAC地址转发所述第一 IP分组。
2.根据权利要求 1所述方法, 其特征在于:
所述第一网元的 IP地址为所述第一网元的第一接口的 IP地址,所述第 一网元的 MAC地址为所述第一网元的第一接口的 MAC地址, 所述路由器 通过所述第一接口和所述第一网元进行通信。
3.根据权利要求 1或 2所述方法, 其特征在于: 所述路由器的控制平面通过 PPPoE获取第一网元的 IP地址和媒体接入 控制 MAC地址具体包括:
所述路由器接收所述第一网元发送的发现 discovery 报文, 所述 discovery报文中承载了所述第一网元的 IP地址以及第一网元的 MAC地址。
4.根据权利要求 1或 2所述方法, 其特征在于:
所述路由器和所述第一网元通过 IP层网络接入设备相连。
5.—种发送 IP分组的方法, 其特征在于:
第一网元的控制平面通过 PPPoE获取路由器的 IP地址和 MAC地址; 所述第一网元的控制平面将所述路由器的 IP地址下送至所述第一网元 的数据平面的路由转发表, 生成第三表项, 所述第三表项的目的 IP地址为 第一网段地址, 所述第一网段地址覆盖第二网元的 IP地址, 所述第三表项 的下一跳 IP地址为所述路由器的 IP地址, 所述第二网元的 IP地址和所述 第一网元的 IP地址处于不同网段;
所述第一网元的控制平面将所述路由器的 IP地址以及 MAC地址下送 至所述第一网元的数据平面的 ARP緩存表, 生成第四表项, 所述第四表项 的目的 IP地址为所述路由器的 IP地址, 所述第四表项的目的 MAC地址为 所述路由器的 MAC地址;
所述第一网元通过所述路由器向所述第二网元发送第二 IP分组, 所述 第一网元根据所述第二 IP分组的目的 IP地址查找所述第三表项 ,所述第一 网元根据所述第三表项的下一跳 IP地址查找所述第四表项, 所述第一网元 根据所述第四表项的目的 MAC地址发送所述第二 IP分组, 所述第二 IP分 组的目的 IP地址为所述第二网元的 IP地址。
6.根据权利要求 5所述方法, 其特征在于:
所述路由器的 IP地址为所述路由器的第二接口的 IP地址。所述路由器 的 MAC地址为所述路由器的第二接口的 MAC地址, 所述第一网元通过所 述第二接口和所述路由器进行通信。
7.根据权利要求 5或 6所述方法, 其特征在于:
所述路由器和所述第一网元通过 IP层网络接入设备相连。
8.根据权利要求 5或 6所述方法, 其特征在于:
所述第一网元的控制平面通过 PPPoE获取路由器的 IP地址和 MAC地 址具体包括:
所述第一网元向所述路由器发送 discovery报文,所述 discovery报文中 承载了所述第一网元的 IP地址以及第一网元的 MAC地址。
9.一种发送 IP分组的装置, 其特征在于, 包括:
第一获取单元, 路由器的控制平面用于通过 PPPoE获取第一网元的 IP 地址和 MAC地址;
第一表项生成单元, 所述路由器的控制平面用于将所述第一网元的 IP 地址下送至所述路由器的数据平面的路由转发表, 生成第一表项, 所述第 一表项的目的 IP地址为所述第一网元的 IP地址,所述第一表项的下一跳 IP 地址为所述第一网元的 IP地址;
第二表项生成单元, 所述路由器的控制平面用于将所述第一网元的 IP 地址以及 MAC地址下送至所述路由器的数据平面的地址解析协议 ARP緩 存表, 生成第二表项, 所述第二表项的目的 IP地址为所述第一网元的 IP地 址, 所述第二表项的目的 MAC地址为所述第一网元的 MAC地址;
路由消息发布单元, 所述路由器用于向所述路由器的邻居路由器发布 路由消息, 所述路由消息中包含所述第一网元的 IP地址;
接收单元, 用于接收所述邻居路由器转发的第一 IP分组, 所述第一 IP 分组的源 IP地址为第二网元的 IP地址, 所述第一 IP分组的目的 IP地址为 所述第一网元的 IP地址, 所述第二网元的 IP地址与所述第一网元的 IP地 址处于不同网段;
第一发送器,所述路由器用于根据所述第一 IP分组的目的 IP地址查找 所述第一表项, 所述路由器根据所述第一表项的下一跳 IP地址查找所述第 二表项, 所述路由器根据所述第二表项的目的 MAC地址转发所述第一 IP 分组。
10.—种发送 IP分组的装置, 其特征在于, 包括:
第二获取单元, 第一网元的控制平面用于通过 PPPoE获取路由器的 IP 地址和 MAC地址;
第三表项生成单元, 所述第一网元的控制平面用于将所述路由器的 IP 地址下送至所述第一网元的数据平面的路由转发表, 生成第三表项, 所述 第三表项的目的 IP地址为第一网段地址 , 所述第一网段地址覆盖第二网元 的 IP地址, 所述第三表项的下一跳 IP地址为所述路由器的 IP地址, 所述 第二网元的 IP地址和所述第一网元的 IP地址处于不同网段;
第四表项生成单元, 所述第一网元的控制平面用于将所述路由器的 IP 地址以及 MAC地址下送至所述第一网元的数据平面的 ARP緩存表, 生成 第四表项, 所述第四表项的目的 IP地址为所述路由器的 IP地址, 所述第四 表项的目的 MAC地址为所述路由器的 MAC地址;
第二发送器, 所述第一网元用于通过所述路由器向所述第二网元发送 第二 IP分组, 所述第一网元根据所述第二 IP分组的目的 IP地址查找所述 第三表项, 所述第一网元根据所述第三表项的下一跳 IP地址查找所述第四 表项, 所述第一网元根据所述第四表项的目的 MAC地址发送所述第二 IP 分组, 所述第二 IP分组的目的 IP地址为所述第二网元的 IP地址。
PCT/CN2012/072251 2011-08-24 2012-03-13 发送因特网协议分组的方法及装置 WO2012149839A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP12779588.8A EP2750329B1 (en) 2011-08-24 2012-03-13 Method and device for sending internet protocol packets
US14/188,176 US9467376B2 (en) 2011-08-24 2014-02-24 Method and device for sending internet protocol packets

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110246933.5 2011-08-24
CN201110246933.5A CN102316028B (zh) 2011-08-24 2011-08-24 发送因特网协议分组的方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/188,176 Continuation US9467376B2 (en) 2011-08-24 2014-02-24 Method and device for sending internet protocol packets

Publications (1)

Publication Number Publication Date
WO2012149839A1 true WO2012149839A1 (zh) 2012-11-08

Family

ID=45428860

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/072251 WO2012149839A1 (zh) 2011-08-24 2012-03-13 发送因特网协议分组的方法及装置

Country Status (4)

Country Link
US (1) US9467376B2 (zh)
EP (1) EP2750329B1 (zh)
CN (1) CN102316028B (zh)
WO (1) WO2012149839A1 (zh)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102316028B (zh) 2011-08-24 2014-06-04 华为技术有限公司 发送因特网协议分组的方法及装置
CN103095546B (zh) * 2013-01-28 2015-10-07 华为技术有限公司 一种处理报文的方法、装置及数据中心网络
CN103139075B (zh) * 2013-03-13 2016-01-20 杭州华三通信技术有限公司 一种报文传输方法和设备
US8824299B1 (en) * 2014-02-28 2014-09-02 tw telecom holdings, inc. Selecting network services based on hostname
CN105407185A (zh) * 2015-12-10 2016-03-16 太仓市同维电子有限公司 一种局域网主机ip地址分配方法
CN106412142B (zh) * 2016-08-30 2020-07-28 浙江宇视科技有限公司 一种资源设备地址获取方法及装置
CN106488518B (zh) * 2016-11-16 2020-01-21 广东新岸线计算机系统芯片有限公司 一种跨多小区切换下实现用户数据接续传输的方法
BR112019009823A2 (pt) * 2016-11-16 2019-08-13 Huawei Tech Co Ltd método de migração de dados e aparelho
CN108259633B (zh) 2017-05-31 2020-05-12 新华三技术有限公司 实现管理报文三层通信的方法、系统及装置
CN108259453B (zh) 2017-05-31 2020-03-06 新华三技术有限公司 一种报文转发方法及装置
US10979300B2 (en) * 2019-06-20 2021-04-13 Kaloom Inc. Computing device and methods for synchronizing networking information with a topology server
CN113163276A (zh) * 2020-01-22 2021-07-23 华为技术有限公司 路由信息的发布方法、装置及系统
CN113285780B (zh) * 2020-02-20 2022-08-19 华为技术有限公司 配置传送管道的方法、装置及系统
US20220321560A1 (en) * 2021-04-02 2022-10-06 Arista Networks, Inc. System for assigning and distributing device security segment identification
US20230308484A1 (en) * 2022-03-08 2023-09-28 Arista Networks, Inc. Fallback segmentation security

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1549546A (zh) * 2003-05-09 2004-11-24 中兴通讯股份有限公司 使用dhcp协议实现pppoe用户动态获取ip地址的装置及方法
CN101286948A (zh) * 2008-05-30 2008-10-15 杭州华三通信技术有限公司 一种访问权限控制的方法和无线接入设备
CN101404619A (zh) * 2008-11-17 2009-04-08 杭州华三通信技术有限公司 一种实现服务器负载均衡的方法和一种三层交换机
CN102316028A (zh) * 2011-08-24 2012-01-11 华为技术有限公司 发送因特网协议分组的方法及装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7525949B1 (en) * 2002-05-07 2009-04-28 Cisco Technology, Inc. Forwarding for network devices
US7379423B1 (en) * 2003-03-20 2008-05-27 Occam Networks, Inc. Filtering subscriber traffic to prevent denial-of-service attacks
US7496955B2 (en) * 2003-11-24 2009-02-24 Cisco Technology, Inc. Dual mode firewall
US7822027B2 (en) * 2006-10-05 2010-10-26 Cisco Technology, Inc. Network routing to the socket
CN101068178B (zh) * 2007-06-08 2010-12-01 华为技术有限公司 使用、管理mac地址表的方法、系统、及搜索引擎
US7821970B2 (en) * 2007-09-26 2010-10-26 Cisco Technology, Inc. Protection of transit links in a network
CN100563215C (zh) * 2007-11-05 2009-11-25 福建星网锐捷网络有限公司 一种报文路由交换装置及其方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1549546A (zh) * 2003-05-09 2004-11-24 中兴通讯股份有限公司 使用dhcp协议实现pppoe用户动态获取ip地址的装置及方法
CN101286948A (zh) * 2008-05-30 2008-10-15 杭州华三通信技术有限公司 一种访问权限控制的方法和无线接入设备
CN101404619A (zh) * 2008-11-17 2009-04-08 杭州华三通信技术有限公司 一种实现服务器负载均衡的方法和一种三层交换机
CN102316028A (zh) * 2011-08-24 2012-01-11 华为技术有限公司 发送因特网协议分组的方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2750329A4 *

Also Published As

Publication number Publication date
EP2750329A4 (en) 2014-07-30
US20140169377A1 (en) 2014-06-19
CN102316028B (zh) 2014-06-04
US9467376B2 (en) 2016-10-11
EP2750329A1 (en) 2014-07-02
CN102316028A (zh) 2012-01-11
EP2750329B1 (en) 2015-11-25

Similar Documents

Publication Publication Date Title
WO2012149839A1 (zh) 发送因特网协议分组的方法及装置
US10952068B2 (en) System and method of fast roaming in enterprise fabric networks
US8743879B2 (en) Label switched routing to connect low power network domains
US9705706B2 (en) Multiple prefix connections with translated virtual local area network
US8898334B2 (en) System for network deployment and method for mapping and data forwarding thereof
JP2013504959A (ja) バーチャルプライベートネットワークの実現方法及びシステム
WO2011103781A2 (zh) 身份标识与位置分离的实现方法、设备及数据封装方法
WO2018214809A1 (zh) 消息发送方法及装置、存储介质
KR20120100927A (ko) 가상 전용 네트워크의 구현 방법 및 시스템
WO2007112645A1 (fr) Procédé et système de mise en oeuvre d'un réseau privé virtuel mobile
WO2006105718A1 (fr) Procede d'adaptation d'un mpls-vpn a un reseau hybride
WO2008014723A1 (fr) Procédé et dispositif permettant la mise en oeuvre d'un réseau privé virtuel (vpn) fondé sur une structure d'adresse ipv6
WO2012106935A1 (zh) 数据通信网络配置方法、网关网元及数据通信系统
US20140313933A1 (en) Method, apparatus, and system for layer 2 interworking based on ipv6
WO2013139270A1 (zh) 实现三层虚拟专用网络的方法、设备及系统
WO2013071866A1 (zh) 一种传递主机名的方法和装置
WO2014186978A1 (zh) 用于以太虚拟专用网的方法和设备
US20210119911A1 (en) Message sending and receiving method, apparatus, and system
KR101901341B1 (ko) 사용자 장치의 이동성을 지원하는 네트워크 접속 방법 및 장치
CN102045250B (zh) Vpls中组播报文的转发方法和服务提供商边缘设备
WO2012109864A1 (zh) 报文转发方法和装置
WO2022117018A1 (zh) 报文传输的方法和装置
WO2011116710A2 (zh) 一种邻居发现的方法,装置和系统
EP3021529B1 (en) Method and device for implementing layer 3 virtual private network
CN104348925A (zh) 一种处理原始ip报文的方法和相应装置

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2012779588

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE