Hi - 

The vnet is up and running.  Check it out.  You'll need to do a world
rebuild, thanks to a header change (increased the size of struct ceq,
which helps us watch FD taps for all possible kernel FDs).

Highlights include:
- The guest and host can both use the network
- Port forwarding from the host to the guest
- Guest and host can contact one another
- Protocol 'bypass' command in the kernel
- You can run snoopy on #srv/snoop-PID to see all the VM's traffic.

There's a bunch of other bug fixes, library helpers, and minor
enhancements.  Check out the commits.

To test it, you'll need to rebuild the world (at least glibc and
probably most apps).  Pass -n VNET_OPTS_FILE to set up things like port
forwarding.  (see kern/kfs/vnet_opts_example for details).

Example, from my workstation:

$ ssh linux-guest
   ( '>')
  /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY.
 (/-_--_-\)           www.tinycorelinux.net

tc@box:~$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:01:02:03:04:0B  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::201:2ff:fe03:40b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:255 errors:0 dropped:0 overruns:0 frame:0
          TX packets:190 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:31197 (30.4 KiB)  TX bytes:27483 (26.8 KiB)

tc@box:~$ wget www.akaros.org/files/test.html
Connecting to www.akaros.org (146.148.59.222:80)
test.html            100% |**********************|    24   0:00:00 ETA

tc@box:~$ cat test.html 
Nanwan says, "Ship it!"

tc@box:~$ ssh host
Warning: Permanently added '10.0.2.2' (RSA) to the list of known hosts.
-sh: can't access tty; job control turned off
/ $ draw_nanwan 

             .-.  .-.
             |  \/  |
            /,   ,_  `'-.
          .-|\   /`\     '. 
        .'  0/   | 0\  \_  `".  
     .-'  _,/    '--'.'|#''---'
      `--'  |       /   \#
            |      /     \#
            \     ;|\    .\#
            |' ' //  \   ::\# 
            \   /`    \   ':\#
             `"`       \..   \#
                        \::.  \#
                         \::   \#
                          \'  .:\#
                           \  :::\#
                            \  '::\#
                             \     \#
                              \:.   \#
                               \::   \#
                                \'   .\#
                             jgs \   ::\#
                                  \      
/ $ Connection to 10.0.2.2 closed.
tc@box:~$ Connection to 127.0.0.1 closed.

>From akaros, let's see the NAT mappings:

bash-4.3$ notify 278 9

The VMM prints (to its stderr):

VNET NAT maps:
---------------
        proto 17, host 27865, guest 48723, FD   22, stale 0, static 0, ref 1
        proto  6, host    23, guest    22, FD   14, stale 0, static 1, ref 1
        proto  6, host  6401, guest 53622, FD   23, stale 0, static 0, ref 1
        proto  6, host  6402, guest 37956, FD   24, stale 0, static 0, ref 1

Wait a little while, print them again.  Unused maps are eventually reaped:

VNET NAT maps:
---------------
        proto  6, host    23, guest    22, FD   14, stale 0, static 1, ref 1

I have a few more fixups to do (like track down a VMCS unload bug and
do other vmm cleanup), but for now I think the vnet/NAT stuff is fine.

Barret


----------------------------------------------------------------
The following changes since commit 1ec18f3e0435a20843162a9e1cb32d3aec8a093a:

  mmu64: for completeness sake, define PML4_REACH (XCC) (2017-01-09 12:07:15 
-0500)

are available in the git repository at:

  [email protected]:brho/akaros.git net

for you to fetch changes up to 4b2d04931bc9b8e941de0b99c06c60688b8b4a4f:

  vmm: Add a virtual networking layer (2017-01-09 15:24:15 -0500)

----------------------------------------------------------------
View this online at:
https://github.com/brho/akaros/compare/1ec18f3e0435...4b2d04931bc9

----------------------------------------------------------------
Barret Rhoden (39):
      fdtap: Check for bad event queues
      qio: Live with Qmsg
      net: Remove unused qlock from UDP and ICMP6
      net: Remove the newconv() function pointer
      net: Don't pretend the proto qlock is thread safe
      net: Add a protocol 'bypass' command for convs
      net: Pull up the header to determine IP version
      net: Checksum loopback packets
      iplib: Clang-format iplib C files
      iplib: Refactor announce9(), add clone9()
      iplib: Add helpers for bypass
      iplib: Add a helper for IP checksums
      iplib: Fix thread-unsafeness in myipaddr
      iplib: Add get_first_noloop_iplifc() helper
      iplib: Allow v4parsecidr() to take longer masks
      iplib: Add a helper for finding the IP router
      iplib: Add protocol constants to iplib.h
      iplib: Make netmkaddr() threadsafe
      Swap library dependencies for tests
      Build all user libraries with -Werror
      Use make -jX by default
      parlib: Add parlib_assert_perror()
      parlib: Include event type headers in event.h
      parlib: Add krefs
      parlib: Have all processes listen for diagnostics
      parlib: Add IOVEC helpers
      vmm: Use a helper for stripping the iovec
      pipe: Add a ctl and "oneblock" command
      Don't attempt namec_from from non-O_PATH FDs
      Add a synth_buf to chan
      ip: Use a synthetic buffer for iproute
      Allow larger CEQs (XCC)
      epoll: Support very large CEQ sets
      Make chan->flag 32 bits
      Set CEXTERNAL_FLAGS early on create()
      Do not allow setting O_REMCLO with fcntl()
      srv: Support remove on close
      parlib: Add option file parsing helper
      vmm: Add a virtual networking layer

 Makefile                            |   11 +-
 Makelocal.template                  |    3 +
 kern/drivers/dev/mem.c              |   12 +-
 kern/drivers/dev/pipe.c             |   43 +-
 kern/drivers/dev/srv.c              |   30 +-
 kern/include/ip.h                   |    7 +-
 kern/include/ns.h                   |    7 +-
 kern/include/ros/ceq.h              |    1 +
 kern/src/ceq.c                      |   14 +-
 kern/src/fdtap.c                    |    8 +-
 kern/src/net/devip.c                |  155 +++-
 kern/src/net/icmp6.c                |   10 -
 kern/src/net/ip.c                   |    1 +
 kern/src/net/loopbackmedium.c       |    1 +
 kern/src/net/tcp.c                  |   39 +-
 kern/src/net/udp.c                  |   35 +-
 kern/src/ns/chan.c                  |   10 +-
 kern/src/ns/qio.c                   |    5 +-
 kern/src/ns/sysfile.c               |    4 +
 tests/Makefile                      |    2 +-
 tests/ping.c                        |    4 +-
 tests/ttcp.c                        |    4 +-
 tests/vmm/vmrunkernel.c             |   89 ++-
 tools/apps/ipconfig/ipconfig.h      |    4 -
 user/iplib/announce.c               |  240 ++++--
 user/iplib/bo.c                     |   68 +-
 user/iplib/classmask.c              |   28 +-
 user/iplib/dial.c                   |   65 +-
 user/iplib/epoll.c                  |   27 +-
 user/iplib/equivip.c                |   22 +-
 user/iplib/getfields.c              |   22 +-
 user/iplib/include/iplib/iplib.h    |   70 +-
 user/iplib/ipaux.c                  |   19 +-
 user/iplib/myetheraddr.c            |   23 +-
 user/iplib/myipaddr.c               |  105 ++-
 user/iplib/netmkaddr.c              |   63 +-
 user/iplib/parseether.c             |   19 +-
 user/iplib/parseip.c                |  140 ++--
 user/iplib/poll.c                   |    4 +-
 user/iplib/ptclbsum.c               |   63 +-
 user/iplib/readipifc.c              |  142 ++--
 user/iplib/select.c                 |   38 +-
 user/iplib/tokenize.c               |   46 +-
 user/parlib/ceq.c                   |   25 +-
 user/parlib/include/parlib/assert.h |   10 +
 user/parlib/include/parlib/event.h  |    3 +
 user/parlib/include/parlib/iovec.h  |   31 +
 user/parlib/include/parlib/kref.h   |   57 ++
 user/parlib/include/parlib/opts.h   |   12 +
 user/parlib/iovec.c                 |  202 +++++
 user/parlib/opts.c                  |   63 ++
 user/parlib/uthread.c               |    4 +
 user/vmm/include/vmm/net.h          |   45 ++
 user/vmm/include/vmm/virtio_net.h   |    2 +-
 user/vmm/nat.c                      | 1441 +++++++++++++++++++++++++++++++++++
 user/vmm/virtio_net.c               |   92 +--
 56 files changed, 2999 insertions(+), 691 deletions(-)
 mode change 100755 => 100644 user/iplib/announce.c
 mode change 100755 => 100644 user/iplib/bo.c
 mode change 100755 => 100644 user/iplib/classmask.c
 mode change 100755 => 100644 user/iplib/dial.c
 mode change 100755 => 100644 user/iplib/equivip.c
 mode change 100755 => 100644 user/iplib/getfields.c
 mode change 100755 => 100644 user/iplib/ipaux.c
 mode change 100755 => 100644 user/iplib/myetheraddr.c
 mode change 100755 => 100644 user/iplib/myipaddr.c
 mode change 100755 => 100644 user/iplib/netmkaddr.c
 mode change 100755 => 100644 user/iplib/parseether.c
 mode change 100755 => 100644 user/iplib/parseip.c
 mode change 100755 => 100644 user/iplib/ptclbsum.c
 mode change 100755 => 100644 user/iplib/readipifc.c
 mode change 100755 => 100644 user/iplib/tokenize.c
 create mode 100644 user/parlib/include/parlib/iovec.h
 create mode 100644 user/parlib/include/parlib/kref.h
 create mode 100644 user/parlib/include/parlib/opts.h
 create mode 100644 user/parlib/iovec.c
 create mode 100644 user/parlib/opts.c
 create mode 100644 user/vmm/include/vmm/net.h
 create mode 100644 user/vmm/nat.c

-- 
You received this message because you are subscribed to the Google Groups 
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to