28.08.2015 Views

The Design and Implementation of the Anykernel and Rump Kernels

1F3KDce

1F3KDce

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

142<br />

# ifconfig tap0 create<br />

# ifconfig tap0 up<br />

# ifconfig bridge0 create<br />

# brconfig bridge0 add tap0 add re0<br />

# brconfig bridge0 up<br />

Figure 3.22: Bridging a tap interface to <strong>the</strong> host’s re0. <strong>The</strong> allows <strong>the</strong> tap<br />

device to send <strong>and</strong> receive network packets via re0.<br />

<strong>The</strong> comm<strong>and</strong>s for bridging a tap interface on NetBSD are provided in Figure 3.22.<br />

Note that IP addresses are not configured for <strong>the</strong> tap interface on <strong>the</strong> host.<br />

<strong>The</strong> virt (manual page virt.4 at A–49) network interface driver we implemented uses<br />

hypercalls to open <strong>the</strong> tap device on <strong>the</strong> host <strong>and</strong> to transmit packets via it. <strong>The</strong><br />

source code for <strong>the</strong> driver is located in sys/rump/net/lib/libvirtif.<br />

Full network stack without host network access<br />

Essentially, we need an unprivileged E<strong>the</strong>rnet-like bus. All interfaces which are<br />

attached to <strong>the</strong> same bus will be able to talk to each o<strong>the</strong>r directly, while o<strong>the</strong>r<br />

nodes may be reached via routers. Accessing <strong>the</strong> host’s network is possible if one<br />

rump kernel in <strong>the</strong> network uses <strong>the</strong> virt driver <strong>and</strong> routes traffic between <strong>the</strong> rumponly<br />

network <strong>and</strong> <strong>the</strong> real network.<br />

One option for implementing packet distribution is to use a userl<strong>and</strong> daemon which<br />

listens on a local domain socket [26]. <strong>The</strong> client kernels use hypercalls to access<br />

<strong>the</strong> local domain socket <strong>of</strong> <strong>the</strong> daemon. <strong>The</strong> daemon takes care <strong>of</strong> passing E<strong>the</strong>rnet<br />

frames to <strong>the</strong> appropriate listeners. <strong>The</strong> downside <strong>of</strong> <strong>the</strong> daemon is that <strong>the</strong>re is an<br />

extra program to install, start <strong>and</strong> stop. Extra management is in conflict with <strong>the</strong><br />

goals <strong>of</strong> rump kernels, <strong>and</strong> that is why we chose ano<strong>the</strong>r implementation strategy.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!