tree: 286aebf05e21184e060f315519b20a2e0b6f96f3 [path history] [tgz]
  1. BUILD.gn
  2. OWNERS
  3. README.md
  4. client.cc
  5. dbus/
  6. ether_socket.cc
  7. ether_socket.h
  8. group.cc
  9. group.h
  10. group_manager.h
  11. group_manager_test.cc
  12. group_test.cc
  13. icmpv6_socket.cc
  14. icmpv6_socket.h
  15. interface_disable_labels.cc
  16. interface_disable_labels.h
  17. interface_disable_labels_test.cc
  18. ipv6_util.cc
  19. ipv6_util.h
  20. ipv6_util_test.cc
  21. ll_address.cc
  22. ll_address.h
  23. ll_address_test.cc
  24. mock_group.h
  25. nd_bpf.cc
  26. nd_bpf.h
  27. nd_msg.cc
  28. nd_msg.h
  29. nd_msg_test.cc
  30. nd_proxy.cc
  31. nd_proxy.h
  32. neighbor_cache.cc
  33. neighbor_cache.h
  34. neighbor_cache_test.cc
  35. network_socket.cc
  36. network_socket.h
  37. portier.cc
  38. portier.h
  39. portierd.cc
  40. portierd.h
  41. proto/
  42. proxy_interface.cc
  43. proxy_interface.h
  44. service.cc
  45. status.cc
  46. status.h
  47. status_test.cc
portier/README.md

Portier

A Multi-Network Neighbor Discovery Proxy (ND Proxy) service for Chrome OS. This is an expanded implementation of a ND Proxy as defined in RFC 4389.

Neighbor Discovery Proxy Summary

ND Proxy is used on a network node to bridge two IPv6 network segments, without any other part of the network being aware that there is a bridge. This is done through a combination of MAC address translation and IP packet proxying.

The main difference between proxying and forwarding is that the node that does the proxying does not advertise itself as a router and most proxied IPv6 packets do not have any of their fields modified (such as the Hop Limit). The only exception to not modifying IPv6 packets are certain ICMPv6 messages which are used in the Neighbor Discovery protocol.

The Neighbor Discovery (ND) protocol is defined in RFC 4861 and is critical for IPv6 connectivity on containers and VMs living in Chrome OS. However, the specification of ND is designed in such a way that bridging two networks cannot be implemented using the same methods used in IPv4. Some of the alternatives to bridging that are available in IPv4, such as NAT, are available in IPv6 though provide limited value on an IPv6 network.

About the Portier Service

The Portier service is intended to implement a subset of the ND Proxy protocol, while also providing some additional networking features which are needed by some other Chrome OS services (such as CrosVM and ARC++).

Due to limitations in the Linux kernel neighbor cache and the configuration available to the Linux user-space for networking processes, not all features of ND Proxy can be implemented. The key features that are not supported include some of the requirements of when to send ICMP error messages as the kernal will always send certain ones, even if their logical meaning is different under ND Proxy. There are also some ND processes which are not performed by Portier which are suggested by the ND Proxy specification.

The main additional feature between Portier and a ND Proxy specification is that proxy interfaces are grouped together to provide limited network scope. The specific usecase in Chrome OS is to allow VMs with multiple network interfaces to be individually bridged to physical network interfaces on the host.

Using Portier

Portier is currently in development. More information about its design and how to use it will be made available when ready.

Portier Library

The Portier library libportier contains several components, some specific to Portier and others generic for Linux networking.

Status

The Status object is used to return status codes and debugging messages from function calls in Portier. The error codes defined in Status::Code are specific for use in Portier, but can be modified and extended based on the needs of developers.

In general, if the Status is OK, then there should not be any message.

Example.

Status GetInterfaceIndex(const string& if_name, int* if_idx) {
  ...
  if ((*if_idx = if_nametoindex(if_name)) < 0) {
    return Status(Code::DOES_NOT_EXIST) << "Interface " << if_name
      << " does not exist";
  }
  ...
}

Status GetInterfaceInformation(const string& if_name) {
  ...
  PORTIER_RETURN_ON_FAILURE(GetInterfaceIndex(if_name, &if_idx))
    << "Failed to get interface index";
  ...
}

bool InitializeInterface(const string& if_name) {
  ...

  Status res = GetInterfaceInformation(if_name);
  if (!res) {
    LOG(ERROR) << res;
    return false;
  }
  ...
}

Output on failure (assume if_name = "eth0"):

[ERROR:my_program.cc(42)] Does Not Exist: Failed to get interface index: Interface eth0 does not exist