genode/repos/os/src/server/nic_bridge
Ehmry - a7a0d3fe63 Refactor Tup, flatten output directories
Make no attempt to replicate the depot layout.
2019-10-28 11:32:29 +01:00
..
README nic_bridge: fixed MAC addresses 2018-11-27 11:36:35 +01:00
Tupfile Refactor Tup, flatten output directories 2019-10-28 11:32:29 +01:00
address_node.h nic_router/nic_bridge: free MAC addresses 2019-04-01 19:33:48 +02:00
component.cc Clang: do not use angle brackets for local includes 2019-10-04 00:47:17 +02:00
component.h Clang: do not use angle brackets for local includes 2019-10-04 00:47:17 +02:00
config.xsd nic_bridge: fixed MAC addresses 2018-11-27 11:36:35 +01:00
mac_allocator.h os: avoid using deprecated APIs 2019-01-30 13:49:54 +01:00
main.cc Clang: do not use angle brackets for local includes 2019-10-04 00:47:17 +02:00
nic.cc Clang: do not use angle brackets for local includes 2019-10-04 00:47:17 +02:00
nic.h Clang: do not use angle brackets for local includes 2019-10-04 00:47:17 +02:00
packet_handler.cc Clang: do not use angle brackets for local includes 2019-10-04 00:47:17 +02:00
packet_handler.h Clang: do not use angle brackets for local includes 2019-10-04 00:47:17 +02:00
target.mk nic_bridge: verbose mode 2018-08-02 14:36:34 +02:00
vlan.h Clang: do not use angle brackets for local includes 2019-10-04 00:47:17 +02:00

README

The NIC bridge provides multiple sessions of the 'Nic' service while using a
single 'Nic' session for forwarding requests. It implements a flavour of the
Proxy-ARP protocol (rfc1027). That means it allocates a virtual MAC address for
each client. Whenever a client sends a packet, NIC bridge changes the sender's
MAC address to the one it memorized for the client. Moreover, it monitors DHCP
packets, and tracks the IP addresses assigned to each of its clients. Whenever
ARP packets come from the outside, NIC bridge will answer them with the
corresponding MAC address.

By adding a 'mac' attribute to the 'nic_bridge' config node: one can define the
first MAC address from which the NIC bridge will allocate MACs for its clients.
For example:
! <config mac="02:02:02:02:02:00"/>
Note that the least relevant byte will be ignored. NIC bridge will use it for
enumerating its clients, starting from 0.

A fixed MAC can be configured per client of the NIC bridge using the '<policy>'
tag. For example:

!<start name="nic_bridge">
!  ...
!  <config>
!    <policy label_prefix="lighttpd" mac="02:02:02:01:23:45"/>
!  </config>
!</start>

Note that the fixed MAC addresses must not fall in the range that is used for
runtime MAC allocation.

Normally, NIC bridge is expected to be used in scenarios where an DHCP server
is available. However, there are situations where the use of static IPs for
virtual NICs is useful. For example, when using the NIC bridge to create a
virtual network between the lighttpd web server and the Arora web browser, both
running as Genode processes without real network connectivity.

The static IP can be configured per client of the NIC bridge using a '<policy>'
node of the configuration. Of course, the client needs to configure its TCP/IP
stack to use the assigned IP address. As an example, the following policy assigns
a static address to a client with the session label "lighttpd".

!<start name="nic_bridge">
!  ...
!  <config>
!    <policy label_prefix="lighttpd" ip_addr="10.0.2.55"/>
!  </config>
!</start>


The verbosity mode of the NIC bridge can be toggled with the verbose attribute
(default value shown):

! <config verbose="no" />

If enabled, the NIC bridge logs sent and received packets as well as the
lifetime of interfaces connected to the bridge.