Address encoding in encapsulated packets
In a computer networking system, data is transmitted between network devices in packets. The disclosure provides mechanisms for preserving address data in a stateless manner by storing a unique identifier, corresponding to an address of an endpoint targeted by an original source device, in a header field of an encapsulated packet. The unique identifier may be persisted in an encapsulated return packet transmitted back to the original source device and used to recover the address of the endpoint for inclusion in a source header field of the return packet that is transmitted to the original source device.
1 . A computing system comprising:
a central control layer system storing and managing a data structure mapping unique IDs to Internet Protocol (IP) addresses in a network;
an endpoint device in the network;
an edge device in the network, the edge device comprising a packet decapsulation component and configured to route data toward the endpoint device; and
a host device, the host device comprising:
a processor,
a storage device storing a copy of the data structure mapping unique IDs to the IP addresses in the network, and
a packet encapsulation component configured to, responsive to receiving a packet specifying a destination IP address from a user device:
map the destination IP address to an associated unique ID;
encapsulate the packet to form an encapsulated packet including an outer packet and an inner packet;
insert the unique ID in a Media Access Control (MAC) address header field of the inner packet;
modify a destination address field of the inner packet to specify an internal IP address for the endpoint device used by the network; and
transmit the encapsulated packet to the edge device for routing to the endpoint device.
2 . The computing system of claim 1 , wherein the outer packet specifies a host address of the host device in a source header field and an edge address of the edge device in a destination header field.
3 . The computing system of claim 1 , wherein the encapsulated packet further comprises a middle packet specifying an edge address of the edge device in a source header field and the internal IP address for the endpoint device in a destination header field.
4 . The computing system of claim 1 , wherein the MAC address header field is one of a source MAC address field or a destination MAC address field, and wherein the packet encapsulation component is further configured to insert a port of the endpoint device in the other of the source MAC address field or the destination MAC address field.
5 . The computing system of claim 1 , wherein the unique ID is a first unique ID and the destination IP address is a first destination IP address, and wherein the packet encapsulation component is further configured to, responsive to receiving a return packet including a second unique ID in a return MAC address header field of the return packet:
map the second unique ID to an associated second destination IP address;
generate a modified return packet by updating a source address header field of the return packet to specify the second destination IP address; and
transmit the modified return packet to the user device, wherein the user device is specified in a destination header field of the return packet.
6 . The computing system of claim 1 , wherein the IP address for the endpoint device in the network comprises an IPv6 address.
7 . A method comprising:
receiving a packet indicating a destination address, the destination address being a network address of a network device of a network;
determining a unique identifier (ID) corresponding to the destination address, the unique ID being shorter than the destination address, and the unique ID being uniquely mapped to the network address of the network device;
updating and routing the packet through the network to an endpoint, wherein the unique ID is included in a header field of the packet;
receiving an encapsulated return packet including the unique ID in a header field of an innermost packet of the encapsulated return packet;
mapping the unique ID to the destination address using a mapping structure;
replacing a source address of the innermost packet of the encapsulated return packet with the destination address mapped to the unique ID to form a modified return packet; and
transmitting the modified return packet to a user device specified in a destination address field of the innermost packet of the encapsulated return packet.
8 . The method of claim 7 , wherein the unique ID is included in a Media Access Control (MAC) address header field of the packet.
9 . The method of claim 8 , further comprising encapsulating the packet to generate an encapsulated packet, and wherein the MAC address header field is in an innermost packet of the encapsulated packet.
10 . The method of claim 9 , wherein the destination address is a first IP address corresponding to the network device, and wherein the encapsulated packet specifies a second IP address for the endpoint in an IP address field of the innermost packet.
11 . The method of claim 9 , wherein the unique ID is included in a first one of a destination MAC address header field or a source MAC address header field, and wherein a port specified in the destination address for the network device is included in a second, different one of the destination MAC address header field or the source MAC address header field.
12 . The method of claim 7 , wherein determining the unique ID includes using the mapping data structure configured to provide a one-to-one unique mapping of unique IDs to IP addresses for network devices in the network, and wherein the mapping data structure is received from a central control plane of the network.
13 . The method of claim 12 , wherein
the unique ID is included in a Media Access Control (MAC) address header field of the innermost packet of the encapsulated return packet.
14 . The method of claim 12 , wherein the mapping data structure comprises a lookup table or a distributed hash table.
15 . The method of claim 7 , wherein the header field is a variable length options field of a Geneve header.
16 . A system comprising:
a host device of a network, the host device comprising a packet encapsulation service configured to execute instructions stored on the host device to:
receive, from an edge device of the network, a return packet specifying an address of a user device in an IP destination address field, a private address of an endpoint in the network in an IP source destination address field, and a unique identifier (ID) in a Media Access Control (MAC) address field;
map, using a mapping data structure stored in the host device, the unique ID to a public address;
modify the IP source address field to replace the private address with the public address; and
transmit the return packet with the modified IP source address to the user device.
17 . The system of claim 16 , wherein the unique ID comprises a 6 byte value uniquely mapped to the public address, and wherein the public address is larger than 6 bytes.
18 . The system of claim 17 , wherein the public address is an IPv6 address.
19 . The system of claim 16 , wherein the return packet is an encapsulated packet, and wherein the packet encapsulation service is further configured to execute instructions stored on the host device to strip an outermost packet of the return packet prior to transmitting the return packet with the modified IP source address to the user device.
20 . The system of claim 16 , wherein the mapping data structure is received from a central control plane of the network, and wherein the host device is configured to receive updates to the mapping data structure as network devices or public destination addresses are added to or removed from the network.