<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Vsock on sgarzare&#39;s blog</title>
    <link>https://stefano-garzarella.github.io/tags/vsock/</link>
    <description>Recent content in Vsock on sgarzare&#39;s blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <managingEditor>sgarzare@redhat.com (Stefano Garzarella)</managingEditor>
    <webMaster>sgarzare@redhat.com (Stefano Garzarella)</webMaster>
    <lastBuildDate>Wed, 11 Feb 2026 18:00:00 +0100</lastBuildDate>
    
        <atom:link href="https://stefano-garzarella.github.io/tags/vsock/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>AF_VSOCK: network namespace support is here</title>
      <link>https://stefano-garzarella.github.io/posts/2026-02-11-vsock-netns/</link>
      <pubDate>Wed, 11 Feb 2026 18:00:00 +0100</pubDate>
      <author>sgarzare@redhat.com (Stefano Garzarella)</author>
      <guid>https://stefano-garzarella.github.io/posts/2026-02-11-vsock-netns/</guid>
      <description>&lt;p&gt;A missing piece for &lt;strong&gt;AF_VSOCK&lt;/strong&gt; in the Linux kernel has been
&lt;strong&gt;network namespace&lt;/strong&gt; support. We discussed it as a future challenge during the
&lt;a href=&#34;https://stefano-garzarella.github.io/posts/2019-11-08-kvmforum-2019-vsock/&#34;&gt;KVM Forum 2019&lt;/a&gt; talk
and it was mentioned in several conference discussions since then.&lt;/p&gt;
&lt;p&gt;I started working on namespace support back in
&lt;a href=&#34;https://lore.kernel.org/netdev/20200116172428.311437-1-sgarzare@redhat.com/&#34;&gt;2019&lt;/a&gt;,
but never had the chance to complete it. Last year, &lt;strong&gt;Bobby Eshleman&lt;/strong&gt; (Meta)
restarted the effort and drove it through 16 revisions of the patch series.
&lt;strong&gt;Daniel Berrangé&lt;/strong&gt;, &lt;strong&gt;Michael S. Tsirkin&lt;/strong&gt;, &lt;strong&gt;Paolo Abeni&lt;/strong&gt;, and I contributed with
reviews and suggestions that shaped the current user API.
The result has been merged into &lt;code&gt;net-next&lt;/code&gt; and will be available in
&lt;strong&gt;Linux 7.0&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Updated on 2026-04-17 to cover the write-once behavior of &lt;code&gt;child_ns_mode&lt;/code&gt;,
merged after the initial publication of this post.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;
&lt;p&gt;Network namespaces are a fundamental building block for containers in Linux.
They provide isolation of the network stack, so each namespace has its own
interfaces, routing tables, and sockets.&lt;/p&gt;
&lt;p&gt;Before Linux 7.0, AF_VSOCK was not namespace-aware. All vsock sockets lived in
the same global space, regardless of the network namespace they were created
in. This caused two problems:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No isolation&lt;/strong&gt;: a VM started inside a network namespace (or container)
was reachable via vsock from any other namespace on the host, breaking the
isolation that containers expect.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No CID reuse&lt;/strong&gt;: since CIDs were global, two VMs in different namespaces
could not use the same CID, even if they were completely isolated from
each other at the network level.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;design&#34;&gt;Design&lt;/h2&gt;
&lt;p&gt;The new implementation introduces two modes, configured per network namespace:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;global&lt;/strong&gt;: CIDs are shared across namespaces. This is the original behavior
and the default, so existing setups continue to work without any change.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;local&lt;/strong&gt;: namespaces are completely isolated. Sockets in a local-mode
namespace can only communicate with other sockets in the same namespace.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Two sysctl knobs are available since Linux 7.0:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/proc/sys/net/vsock/child_ns_mode&lt;/code&gt;: the parent namespace uses this to set
the mode that new child namespaces will inherit. Accepts &lt;code&gt;global&lt;/code&gt; or &lt;code&gt;local&lt;/code&gt;.
This sysctl is write-once: after the first write, it becomes immutable.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/proc/sys/net/vsock/ns_mode&lt;/code&gt;: read-only, shows the mode of the current
namespace. The mode is immutable after namespace creation.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This design ensures backward compatibility: the default is &lt;code&gt;global&lt;/code&gt;, matching
the previous behavior. Namespace isolation is opt-in.&lt;/p&gt;
&lt;p&gt;Each namespace gets its mode from the parent&amp;rsquo;s &lt;code&gt;child_ns_mode&lt;/code&gt; at
creation time. Once set, the namespace&amp;rsquo;s &lt;code&gt;ns_mode&lt;/code&gt; is immutable: every
socket and VM in that namespace follows it.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;child_ns_mode&lt;/code&gt; sysctl is also write-once: the first write locks
the value and any subsequent write of a different value returns &lt;code&gt;-EBUSY&lt;/code&gt;.
This guarantees that a namespace manager can set the value once and be
certain it won&amp;rsquo;t change before creating its namespaces, preventing races
where two administrator processes set conflicting modes and one ends up
with a namespace in the wrong mode.&lt;/p&gt;
&lt;h2 id=&#34;supported-vsock-transports&#34;&gt;Supported vsock transports&lt;/h2&gt;
&lt;p&gt;This series adds namespace support to two transports:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;vhost-vsock&lt;/strong&gt;: host-to-guest (H2G) transport, emulates the virtio-vsock
device for KVM guests&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;vsock-loopback&lt;/strong&gt;: local transport, useful for testing and debugging
without running VMs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The missing transports are the guest-to-host (G2H) ones (virtio, hyperv, vmci).
These run in the guest as device drivers, and we currently don&amp;rsquo;t have a way to
assign a vsock device to a specific namespace, since vsock devices are not
standard network devices. For now, G2H transports operate in &lt;code&gt;global&lt;/code&gt; mode, so
they are reachable from any &lt;code&gt;global&lt;/code&gt; namespace, but not from &lt;code&gt;local&lt;/code&gt; namespaces.
This means that sockets in a &lt;code&gt;local&lt;/code&gt; namespace cannot communicate with the host
through these transports. We plan to work on that in the future.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;h3 id=&#34;loopback&#34;&gt;Loopback&lt;/h3&gt;
&lt;p&gt;In the following examples, the commands without a namespace prefix run in the
initial network namespace (init_netns), which is the default namespace where
all processes start. The init_netns is always in &lt;code&gt;global&lt;/code&gt; mode.&lt;/p&gt;
&lt;p&gt;These examples use the vsock loopback device for local communication,
without any VM involved.&lt;/p&gt;
&lt;p&gt;Make sure the &lt;code&gt;vsock_loopback&lt;/code&gt; kernel module is loaded:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ sudo modprobe vsock_loopback
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;namespace-isolation-with-unshare&#34;&gt;Namespace isolation with unshare&lt;/h4&gt;
&lt;h5 id=&#34;global-mode-default&#34;&gt;Global mode (default)&lt;/h5&gt;
&lt;p&gt;By default, &lt;code&gt;child_ns_mode&lt;/code&gt; is set to &lt;code&gt;global&lt;/code&gt;. This is the same behavior
as before Linux 7.0: vsock sockets are shared across namespaces.&lt;/p&gt;
&lt;p&gt;A listener started in a new namespace is reachable from the init_netns
using the loopback CID (&lt;code&gt;VMADDR_CID_LOCAL = 1&lt;/code&gt;):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ unshare --user --net nc --vsock -l &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ nc --vsock &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# reachable - global mode, no isolation&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h5 id=&#34;local-mode&#34;&gt;Local mode&lt;/h5&gt;
&lt;p&gt;Setting &lt;code&gt;child_ns_mode&lt;/code&gt; to &lt;code&gt;local&lt;/code&gt; enables isolation. Since this sysctl
is write-once, we use a nested &lt;code&gt;unshare&lt;/code&gt; to avoid locking the
init_netns mode:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ unshare --user --map-root-user --net bash -c &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;    &lt;span class=&#34;s1&#34;&gt;&amp;#39;echo local &amp;gt; /proc/sys/net/vsock/child_ns_mode &amp;amp;&amp;amp; \
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;     unshare --net nc --vsock -l 1234&amp;#39;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ nc --vsock &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Ncat: Connection reset by peer.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;namespace-isolation-with-ip-netns&#34;&gt;Namespace isolation with ip netns&lt;/h4&gt;
&lt;p&gt;The same can be done with &lt;code&gt;ip netns&lt;/code&gt;, which requires root (or &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;First, create a &lt;code&gt;global&lt;/code&gt; namespace and check its mode:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ sudo ip netns add vsock_ns_global
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ sudo ip netns &lt;span class=&#34;nb&#34;&gt;exec&lt;/span&gt; vsock_ns_global cat /proc/sys/net/vsock/ns_mode
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;global
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A listener in the &lt;code&gt;global&lt;/code&gt; namespace is reachable from the init_netns:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ sudo ip netns &lt;span class=&#34;nb&#34;&gt;exec&lt;/span&gt; vsock_ns_global nc --vsock -l &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ nc --vsock &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# reachable - global mode, no isolation&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now create a &lt;code&gt;local&lt;/code&gt; namespace. Since &lt;code&gt;child_ns_mode&lt;/code&gt; is write-once, we
use &lt;code&gt;unshare&lt;/code&gt; to create a parent namespace and set its mode to &lt;code&gt;local&lt;/code&gt;
before creating the child:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ sudo unshare --net bash -c &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;    &lt;span class=&#34;s1&#34;&gt;&amp;#39;echo local &amp;gt; /proc/sys/net/vsock/child_ns_mode &amp;amp;&amp;amp; \
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;     ip netns add vsock_ns_local&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ sudo ip netns &lt;span class=&#34;nb&#34;&gt;exec&lt;/span&gt; vsock_ns_local cat /proc/sys/net/vsock/ns_mode
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;local&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A listener in the &lt;code&gt;local&lt;/code&gt; namespace is not reachable from the init_netns:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ sudo ip netns &lt;span class=&#34;nb&#34;&gt;exec&lt;/span&gt; vsock_ns_local nc --vsock -l &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ nc --vsock &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Ncat: Connection reset by peer.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But communication within the same namespace still works:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ sudo ip netns &lt;span class=&#34;nb&#34;&gt;exec&lt;/span&gt; vsock_ns_local nc --vsock &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# reachable - same namespace&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;vms-with-qemu&#34;&gt;VMs with QEMU&lt;/h3&gt;
&lt;p&gt;The vhost-vsock H2G transport exposes the &lt;code&gt;/dev/vhost-vsock&lt;/code&gt; device, which
QEMU opens at VM startup to emulate the virtio-vsock device for the guest.
Since namespace support applies to this transport, VMs inherit the namespace
mode as well.&lt;/p&gt;
&lt;p&gt;In the following examples, we reuse the &lt;code&gt;vsock_ns_global&lt;/code&gt; and &lt;code&gt;vsock_ns_local&lt;/code&gt;
namespaces created in the previous section.&lt;/p&gt;
&lt;h4 id=&#34;global-mode&#34;&gt;Global mode&lt;/h4&gt;
&lt;p&gt;With &lt;code&gt;global&lt;/code&gt; mode, the VM started in a &lt;code&gt;global&lt;/code&gt; namespace is reachable
from any other &lt;code&gt;global&lt;/code&gt; namespace, including the init_netns:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ sudo ip netns &lt;span class=&#34;nb&#34;&gt;exec&lt;/span&gt; vsock_ns_global &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;    qemu-system-x86_64 -m 1G -M q35,accel&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;kvm &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;    -drive &lt;span class=&#34;nv&#34;&gt;file&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;guest.qcow2,if&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;virtio,snapshot&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;on &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;    -device vhost-vsock-pci,guest-cid&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;42&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# start a listener in the guest (global namespace)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;guest_global$ nc --vsock -l &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# from the init_netns (global) - reachable&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ nc --vsock &lt;span class=&#34;m&#34;&gt;42&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;local-mode-1&#34;&gt;Local mode&lt;/h4&gt;
&lt;p&gt;With &lt;code&gt;local&lt;/code&gt; mode, the VM is only reachable from within the same namespace:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ sudo ip netns &lt;span class=&#34;nb&#34;&gt;exec&lt;/span&gt; vsock_ns_local &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;    qemu-system-x86_64 -m 1G -M q35,accel&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;kvm &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;    -drive &lt;span class=&#34;nv&#34;&gt;file&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;guest.qcow2,if&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;virtio,snapshot&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;on &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;    -device vhost-vsock-pci,guest-cid&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;42&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# start a listener in the guest (local namespace)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;guest_local$ nc --vsock -l &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# from the init_netns (global) - isolated&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ nc --vsock &lt;span class=&#34;m&#34;&gt;42&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Ncat: Connection reset by peer.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# from the same namespace - reachable&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ sudo ip netns &lt;span class=&#34;nb&#34;&gt;exec&lt;/span&gt; vsock_ns_local nc --vsock &lt;span class=&#34;m&#34;&gt;42&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;guest-to-host-g2h-behavior&#34;&gt;Guest-to-host (G2H) behavior&lt;/h4&gt;
&lt;p&gt;As mentioned in the &lt;a href=&#34;#supported-vsock-transports&#34;&gt;Supported vsock transports&lt;/a&gt;
section, the G2H virtio transport does not support namespaces yet. The
virtio-vsock device in the guest always operates in &lt;code&gt;global&lt;/code&gt; mode, so
only sockets in &lt;code&gt;global&lt;/code&gt; namespaces can communicate with the host.&lt;/p&gt;
&lt;p&gt;Using the VM started in &lt;code&gt;vsock_ns_global&lt;/code&gt;, a listener in the guest&amp;rsquo;s
init_netns is reachable from the host:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# start a listener in the guest&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;guest_global$ nc --vsock -l &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# from the host - reachable&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ nc --vsock &lt;span class=&#34;m&#34;&gt;42&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But a listener started in a &lt;code&gt;local&lt;/code&gt; namespace inside the guest is not
reachable from the host:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# create a local namespace in the guest and start a listener&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;guest_global$ unshare --user --map-root-user --net bash -c &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;    &lt;span class=&#34;s1&#34;&gt;&amp;#39;echo local &amp;gt; /proc/sys/net/vsock/child_ns_mode &amp;amp;&amp;amp; \
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;     unshare --net nc --vsock -l 1234&amp;#39;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# from the host - isolated&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ nc --vsock &lt;span class=&#34;m&#34;&gt;42&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Ncat: Connection reset by peer.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;cid-reuse&#34;&gt;CID reuse&lt;/h4&gt;
&lt;p&gt;Note that we used the same CID (&lt;code&gt;42&lt;/code&gt;) in both examples without turning off
the first VM. This is possible because the second VM is in a &lt;code&gt;local&lt;/code&gt;
namespace, so its CID space is isolated. With &lt;code&gt;global&lt;/code&gt; mode, QEMU would
fail to start the second VM because the CID is already in use.&lt;/p&gt;
&lt;h2 id=&#34;patches&#34;&gt;Patches&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://lore.kernel.org/netdev/20260121-vsock-vmtest-v16-0-2859a7512097@meta.com/&#34;&gt;[PATCH net-next v16 00/12] vsock: add namespace support to vhost-vsock and loopback&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://lore.kernel.org/netdev/20260223-vsock-ns-write-once-v3-0-c0cde6959923@meta.com/&#34;&gt;[PATCH net v3 0/3] vsock: add write-once semantics to child_ns_mode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://lore.kernel.org/netdev/20260401092153.28462-1-sgarzare@redhat.com/&#34;&gt;[PATCH net] vsock: initialize child_ns_mode_locked in vsock_net_init()&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    
    <item>
      <title>SOCAT now supports AF_VSOCK</title>
      <link>https://stefano-garzarella.github.io/posts/2021-01-22-socat-vsock/</link>
      <pubDate>Fri, 22 Jan 2021 15:16:04 +0100</pubDate>
      <author>sgarzare@redhat.com (Stefano Garzarella)</author>
      <guid>https://stefano-garzarella.github.io/posts/2021-01-22-socat-vsock/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.dest-unreach.org/isocat/&#34;&gt;SOCAT&lt;/a&gt;
is a CLI utility which enables the concatenation
of two sockets together.
It establishes two bidirectional byte streams and transfers data between them.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;socat&lt;/code&gt; supports several address types (e.g. TCP, UDP, UNIX domain sockets, etc.)
to construct the streams. The latest version &lt;strong&gt;1.7.4&lt;/strong&gt;, released earlier this
year [2021-01-04], supports also AF_VSOCK addresses:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;http://www.dest-unreach.org/socat/doc/socat.html#ADDRESS_VSOCK_LISTEN&#34;&gt;VSOCK-LISTEN&lt;/a&gt;:&lt;code&gt;&amp;lt;port&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Listen on &lt;code&gt;port&lt;/code&gt; and accepts a VSOCK connection.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;http://www.dest-unreach.org/socat/doc/socat.html#ADDRESS_VSOCK_CONNECT&#34;&gt;VSOCK-CONNECT&lt;/a&gt;:&lt;code&gt;&amp;lt;cid&amp;gt;:&amp;lt;port&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Establishes a VSOCK stream connection to the specified &lt;code&gt;cid&lt;/code&gt; and &lt;code&gt;port&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;fosdem-2021&#34;&gt;FOSDEM 2021&lt;/h2&gt;
&lt;p&gt;If you are interested on VSOCK, I&amp;rsquo;ll talk witn Andra Paraschiv (AWS) about it
at FOSDEM 2021.
The talk is titled
&lt;a href=&#34;https://fosdem.org/2021/schedule/event/vai_virtio_vsock&#34;&gt;Leveraging virtio-vsock in the cloud and containers&lt;/a&gt;
and it&amp;rsquo;s scheduled for Saturday, February 6th 2021 at 11:30 AM (CET).&lt;/p&gt;
&lt;p&gt;We will show cool VSOCK use cases and some demos about developing, debugging,
and measuring the VSOCK performance, including &lt;code&gt;socat&lt;/code&gt; demos.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;socat&lt;/code&gt; could be very useful for concatenating and redirecting sockets.
In this section we will see some examples.&lt;/p&gt;
&lt;p&gt;Examples below refer to a guest with &lt;code&gt;CID 42&lt;/code&gt; that we created using
&lt;a href=&#34;https://libguestfs.org/virt-builder.1.html&#34;&gt;virt-builder&lt;/a&gt;
and
&lt;a href=&#34;https://virt-manager.org/&#34;&gt;virt-install&lt;/a&gt;
.&lt;/p&gt;
&lt;h3 id=&#34;vm-setup&#34;&gt;VM setup&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;virt-builder&lt;/code&gt; is able to download the installer and create the disk image
with Fedora 33 or other distros.
It is also able to set the root password and inject the ssh public key,
simplifying the creation of guest disk image:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;VM_IMAGE&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;vsockguest_f33.qcow2&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;host$ virt-builder --root-password&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;password:mypassword &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;        --ssh-inject root:file:/home/user/.ssh/id_rsa.pub &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;        --output&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;VM_IMAGE&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;        --format&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;qcow2 --size 10G --selinux-relabel &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;        --update fedora-33
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once the disk image is ready, we create our VM with &lt;code&gt;virt-install&lt;/code&gt;.
We can specify the VM settings like the number of vCPUs, the amount of RAM,
and the &lt;code&gt;CID&lt;/code&gt; assigned to the VM [42]:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;host$ virt-install --name vsockguest &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;        --ram &lt;span class=&#34;m&#34;&gt;2048&lt;/span&gt; --vcpus &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt; --os-variant fedora33 &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;        --import --disk &lt;span class=&#34;nv&#34;&gt;path&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;VM_IMAGE&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;,bus&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;virtio &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;        --graphics none --vsock cid.address&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;42&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After the creation of the VM, we will remain attached to the console and
we can detach from it by pressing &lt;code&gt;ctrl-]&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We can reattach to the console in this way:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;host$ virsh console vsockguest
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the VM is turned off, we can boot it and attach directly to the console
in this way:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;host$ virsh start --console vsockguest
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;ncat-like&#34;&gt;ncat like&lt;/h3&gt;
&lt;p&gt;It&amp;rsquo;s possible to use &lt;code&gt;socat&lt;/code&gt; like &lt;code&gt;ncat&lt;/code&gt;, transferring &lt;code&gt;stdin&lt;/code&gt; and &lt;code&gt;stdout&lt;/code&gt; via VSOCK.&lt;/p&gt;
&lt;h4 id=&#34;guest-listening&#34;&gt;Guest listening&lt;/h4&gt;
&lt;p&gt;In this example we start &lt;code&gt;socat&lt;/code&gt; in the guest listening on port &lt;code&gt;1234&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;guest$ socat - VSOCK-LISTEN:1234
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we connect from the host using the &lt;code&gt;CID 42&lt;/code&gt; assigned to the VM:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;host$ socat - VSOCK-CONNECT:42:1234
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;At this point we can exchange characters between guest and host, since &lt;code&gt;stdin&lt;/code&gt;
and &lt;code&gt;stdout&lt;/code&gt; are linked through the VSOCK socket.&lt;/p&gt;
&lt;h4 id=&#34;host-listening&#34;&gt;Host listening&lt;/h4&gt;
&lt;p&gt;In this example we do the opposite, starting &lt;code&gt;socat&lt;/code&gt; in the host listening
on port &lt;code&gt;1234&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;host$ socat - VSOCK-LISTEN:1234
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, in the guest, we connect to the host using the &lt;em&gt;well defined&lt;/em&gt; &lt;code&gt;CID 2&lt;/code&gt;.
It&amp;rsquo;s always used to reach the host:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;guest$ socat - VSOCK-CONNECT:2:1234
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;ssh-over-vsock&#34;&gt;ssh over VSOCK&lt;/h3&gt;
&lt;p&gt;The coolest feature of &lt;code&gt;socat&lt;/code&gt; is to concatenate sockets of different address
families, so in this example we redirect ssh traffic through VSOCK socket
exposed by the VM.&lt;/p&gt;
&lt;p&gt;This example could be useful if the VM doesn&amp;rsquo;t have any NIC attached and
we want to provide some network connectivity, like the ssh access.&lt;/p&gt;
&lt;p&gt;First of all, in the guest we start &lt;code&gt;socat&lt;/code&gt; linking the VSOCK socket listening on
port 22, to a TCP socket which will connect to the local TCP port 22 where the
ssh server is listening:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;guest$ socat VSOCK-LISTEN:22,reuseaddr,fork TCP:localhost:22
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On the host we can use &lt;code&gt;socat&lt;/code&gt; as &lt;code&gt;ProxyCommand&lt;/code&gt; of &lt;code&gt;ssh&lt;/code&gt; to forward the connection
through the AF_VSOCK socket:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;host$ ssh -o &lt;span class=&#34;s2&#34;&gt;&amp;#34;ProxyCommand socat - VSOCK-CONNECT:42:22&amp;#34;&lt;/span&gt; root@localhost
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;socat&lt;/code&gt; redirects all the traffic and allow us to use ssh over VSOCK to reach
the guest.&lt;/p&gt;
&lt;h3 id=&#34;connecting-sibling-vms&#34;&gt;Connecting sibling VMs&lt;/h3&gt;
&lt;p&gt;Another scenario where socat can be very useful is connecting two sibling VMs
running on the same host.&lt;/p&gt;
&lt;p&gt;Currently this is not supported by &lt;code&gt;vhost-vsock&lt;/code&gt;, so we can use &lt;code&gt;socat&lt;/code&gt; to
concatenate the two VMs.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s see an example: suppose we launch another VM with &lt;code&gt;CID = 24&lt;/code&gt; on
the same host. Now we want to use &lt;code&gt;ncat&lt;/code&gt; in the VMs to communicate with each
other.&lt;/p&gt;
&lt;p&gt;Guest 42 will listen on port 1234 and guest 24 will initiate the connection.
But before we do this we need to set up the bridge in the host with &lt;code&gt;socat&lt;/code&gt; to
allow the two VMs to communicate:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;host$ socat VSOCK-LISTEN:1234 VSOCK-CONNECT:42:1234
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;At this point we can launch &lt;code&gt;ncat&lt;/code&gt; in the VMs and communicate:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;guest_42$ nc --vsock -l &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note: as destination CID we have to use the host&amp;rsquo;s well-known CID (2) because
we need to connect to the &lt;code&gt;socat&lt;/code&gt; bridge running in the host, that will
redirect packets correctly between the two machines:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;guest_24$ nc --vsock &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>AF_VSOCK: nested VMs and loopback support available</title>
      <link>https://stefano-garzarella.github.io/posts/2020-02-20-vsock-nested-vms-loopback/</link>
      <pubDate>Tue, 25 Feb 2020 20:30:21 +0100</pubDate>
      <author>sgarzare@redhat.com (Stefano Garzarella)</author>
      <guid>https://stefano-garzarella.github.io/posts/2020-02-20-vsock-nested-vms-loopback/</guid>
      <description>&lt;p&gt;During the last
&lt;a href=&#34;https://stefano-garzarella.github.io/posts/2019-11-08-kvmforum-2019-vsock/&#34;&gt;KVM Forum 2019&lt;/a&gt;,
we discussed some next steps and several requests came from the audience.&lt;/p&gt;
&lt;p&gt;In the last months, we worked on that and recent Linux releases contain
interesting new features that we will describe in this blog post:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#nested-vms&#34;&gt;Nested VMs support&lt;/a&gt;, available in Linux 5.5&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#local-communication&#34;&gt;Local communication support&lt;/a&gt;, available in Linux 5.6&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;devconfcz-2020&#34;&gt;DevConf.CZ 2020&lt;/h2&gt;
&lt;p&gt;These updates and an introduction to AF_VSOCK were presented at
&lt;strong&gt;DevConf.CZ 2020&lt;/strong&gt; during the
&amp;ldquo;&lt;a href=&#34;https://devconfcz2020a.sched.com/event/YOwb/vsock-vm-host-socket-with-minimal-configuration&#34;&gt;VSOCK: VM↔host socket with minimal configuration&lt;/a&gt;&amp;rdquo; talk.
&lt;a href=&#34;https://static.sched.com/hosted_files/devconfcz2020a/b1/DevConf.CZ_2020_vsock_v1.1.pdf&#34;&gt;Slides&lt;/a&gt; and &lt;a href=&#34;https://youtu.be/R5DQWdPUQSY&#34;&gt;recording&lt;/a&gt; are available.&lt;/p&gt;
&lt;h2 id=&#34;nested-vms&#34;&gt;Nested VMs&lt;/h2&gt;
&lt;p&gt;Before Linux 5.5, the AF_VSOCK core supported only one transport loaded at
run time. That was a limit for nested VMs, because we need multiple transports
loaded together.&lt;/p&gt;
&lt;h3 id=&#34;types-of-transport&#34;&gt;Types of transport&lt;/h3&gt;
&lt;p&gt;Under the AF_VSOCK core, that provides the socket interface to the user space
applications, we have several transports that implement the communication
channel between guest and host.&lt;/p&gt;

&lt;link rel=&#34;stylesheet&#34; href=&#34;https://stefano-garzarella.github.io/css/hugo-easy-gallery.css&#34; /&gt;
&lt;div class=&#34;box&#34; style=&#34;max-width:300px&#34;&gt;
  &lt;figure  itemprop=&#34;associatedMedia&#34; itemscope itemtype=&#34;http://schema.org/ImageObject&#34;&gt;
    &lt;div class=&#34;img&#34;&gt;
      &lt;img itemprop=&#34;thumbnail&#34; src=&#34;https://stefano-garzarella.github.io/img/2020-02-20-vsock-nested-vms-loopback/vsock_transports.png&#34; alt=&#34;/img/2020-02-20-vsock-nested-vms-loopback/vsock_transports.png&#34;/&gt;
    &lt;/div&gt;
    &lt;a href=&#34;https://stefano-garzarella.github.io/img/2020-02-20-vsock-nested-vms-loopback/vsock_transports.png&#34; itemprop=&#34;contentUrl&#34;&gt;&lt;/a&gt;
      &lt;figcaption&gt;&lt;h4&gt;vsock transports&lt;/h4&gt;
      &lt;/figcaption&gt;
  &lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;These transports depend on the hypervisor and we can put them in two groups:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;H2G&lt;/strong&gt; (host to guest) transports: they run in the host and
usually they provide the device emulation; currently we have &lt;em&gt;vhost&lt;/em&gt; and &lt;em&gt;vmci&lt;/em&gt;
transports.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;G2H&lt;/strong&gt; (guest to host) transports: they run in the guest and usually they are
device drivers; currently we have &lt;em&gt;virtio, vmci,&lt;/em&gt; and &lt;em&gt;hyperv&lt;/em&gt; transports.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;multi-transports&#34;&gt;Multi-transports&lt;/h3&gt;
&lt;p&gt;In a nested VM environment, we need to load both G2H and H2G transports
together in the L1 guest, for this reason, we implemented the multi-transports
support to use vsock through &lt;strong&gt;nested VMs&lt;/strong&gt;.&lt;/p&gt;


&lt;div class=&#34;box&#34; style=&#34;max-width:300px&#34;&gt;
  &lt;figure  itemprop=&#34;associatedMedia&#34; itemscope itemtype=&#34;http://schema.org/ImageObject&#34;&gt;
    &lt;div class=&#34;img&#34;&gt;
      &lt;img itemprop=&#34;thumbnail&#34; src=&#34;https://stefano-garzarella.github.io/img/2020-02-20-vsock-nested-vms-loopback/vsock_nested_vms.png&#34; alt=&#34;/img/2020-02-20-vsock-nested-vms-loopback/vsock_nested_vms.png&#34;/&gt;
    &lt;/div&gt;
    &lt;a href=&#34;https://stefano-garzarella.github.io/img/2020-02-20-vsock-nested-vms-loopback/vsock_nested_vms.png&#34; itemprop=&#34;contentUrl&#34;&gt;&lt;/a&gt;
      &lt;figcaption&gt;&lt;h4&gt;vsock and nested VMs&lt;/h4&gt;
      &lt;/figcaption&gt;
  &lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;Starting from Linux 5.5, the AF_VSOCK can handle two types of transports
loaded together at runtime:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;H2G&lt;/strong&gt; transport, to communicate with the guest&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;G2H&lt;/strong&gt; transport, to communicate with the host.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So in the QEMU/KVM environment, the L1 guest will load both &lt;em&gt;virtio-transport&lt;/em&gt;,
to communicate with L0, and &lt;em&gt;vhost-transport&lt;/em&gt; to communicate with L2.&lt;/p&gt;
&lt;h2 id=&#34;local-communication&#34;&gt;Local Communication&lt;/h2&gt;
&lt;p&gt;Another feature recently added is the possibility to communicate locally on
the same host.
This feature, suggested by &lt;a href=&#34;https://rwmj.wordpress.com/&#34;&gt;Richard WM Jones&lt;/a&gt;,
can be very useful for testing and debugging applications that use AF_VSOCK
without running VMs.&lt;/p&gt;
&lt;p&gt;Linux 5.6 introduces a new transport called &lt;em&gt;vsock-loopback&lt;/em&gt;, and a new well
know CID for local communication: &lt;strong&gt;VMADDR_CID_LOCAL (1)&lt;/strong&gt;.
It’s a special CID to direct packets to the same host that generated them.&lt;/p&gt;


&lt;div class=&#34;box&#34; style=&#34;max-width:300px&#34;&gt;
  &lt;figure  itemprop=&#34;associatedMedia&#34; itemscope itemtype=&#34;http://schema.org/ImageObject&#34;&gt;
    &lt;div class=&#34;img&#34;&gt;
      &lt;img itemprop=&#34;thumbnail&#34; src=&#34;https://stefano-garzarella.github.io/img/2020-02-20-vsock-nested-vms-loopback/vsock_loopback.png&#34; alt=&#34;/img/2020-02-20-vsock-nested-vms-loopback/vsock_loopback.png&#34;/&gt;
    &lt;/div&gt;
    &lt;a href=&#34;https://stefano-garzarella.github.io/img/2020-02-20-vsock-nested-vms-loopback/vsock_loopback.png&#34; itemprop=&#34;contentUrl&#34;&gt;&lt;/a&gt;
      &lt;figcaption&gt;&lt;h4&gt;vsock loopback&lt;/h4&gt;
      &lt;/figcaption&gt;
  &lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;Other CIDs can be used for the same purpose, but it&amp;rsquo;s preferable to use
VMADDR_CID_LOCAL:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Local Guest CID
&lt;ul&gt;
&lt;li&gt;if G2H is loaded (e.g. running in a VM)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;VMADDR_CID_HOST (2)
&lt;ul&gt;
&lt;li&gt;if H2G is loaded and G2H is not loaded (e.g. running on L0).
If G2H is also loaded, then VMADDR_CID_HOST is used to reach the host&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Richard recently used the vsock local communication to implement a &lt;a href=&#34;https://github.com/libguestfs/nbdkit/commit/5e4745641bb4676f607fdb3f8750dbf6e9516877&#34;&gt;regression
test&lt;/a&gt;
test for &lt;a href=&#34;https://rwmj.wordpress.com/2019/10/21/nbd-over-af_vsock/&#34;&gt;nbdkit/libnbd vsock support&lt;/a&gt;, using the new &lt;a href=&#34;https://github.com/libguestfs/nbdkit/commit/01ce88f56f93afd577a8e3b2cc28d825693c8db2&#34;&gt;VMADDR_CID_LOCAL&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Listening on port 1234 using ncat(1)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;l0$ nc --vsock -l &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Connecting to the local host using VMADDR_CID_LOCAL (1)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;l0$ nc --vsock &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1234&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;patches&#34;&gt;Patches&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://patchwork.ozlabs.org/cover/1194660/&#34;&gt;[PATCH net-next v2 00/15] vsock: add multi-transports support&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://patchwork.ozlabs.org/cover/1207012/&#34;&gt;[PATCH net-next v2 0/6] vsock: add local transport support&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    
    <item>
      <title>KVM Forum 2019: virtio-vsock in QEMU, Firecracker and Linux</title>
      <link>https://stefano-garzarella.github.io/posts/2019-11-08-kvmforum-2019-vsock/</link>
      <pubDate>Sat, 09 Nov 2019 18:45:25 +0100</pubDate>
      <author>sgarzare@redhat.com (Stefano Garzarella)</author>
      <guid>https://stefano-garzarella.github.io/posts/2019-11-08-kvmforum-2019-vsock/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://static.sched.com/hosted_files/kvmforum2019/50/KVMForum_2019_virtio_vsock_Andra_Paraschiv_Stefano_Garzarella_v1.3.pdf&#34;&gt;Slides&lt;/a&gt; and
&lt;a href=&#34;https://youtu.be/LFqz-VZPhFE&#34;&gt;recording&lt;/a&gt; are available for the &amp;ldquo;&lt;a href=&#34;https://sched.co/TmwK&#34;&gt;virtio-vsock in QEMU,
Firecracker and Linux: Status, Performance and Challenges&lt;/a&gt;&amp;rdquo;
talk that Andra Paraschiv and I presented at
&lt;a href=&#34;https://events19.linuxfoundation.org/events/kvm-forum-2019/&#34;&gt;KVM Forum 2019&lt;/a&gt;.
This was the 13th edition of the KVM Forum conference. It took place in Lyon,
France in October 2019.&lt;/p&gt;
&lt;p&gt;We talked about the current status and future works of VSOCK drivers in Linux
and how Firecracker and QEMU provides the virtio-vsock device.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary&lt;/h2&gt;
&lt;p&gt;Initially, Andra gave an overview of VSOCK, she described the state of the art,
and the key features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;it is very simple to configure, the host assigns an unique CID (Context-ID) to
each guest, and no configuration is needed inside the guest;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;it provides AF_VSOCK address family, allowing user space application in the
host and guest to communicate using standard POSIX Socket API (e.g.
bind, listen, accept, connect, send, recv, etc.)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Andra also described common use cases for VSOCK, such as guest agents
(clipboard sharing, remote console, etc.), network applications using
SOCK_STREAM, and services provided by the hypervisor to the guests.&lt;/p&gt;
&lt;p&gt;Going into the implementation details, Andra explained how the device in the
guest communicates with the vhost backend in the host, exchanging data and
events (i.e. ioeventfd, irqfd).&lt;/p&gt;
&lt;h3 id=&#34;firecracker&#34;&gt;Firecracker&lt;/h3&gt;
&lt;p&gt;Focusing on Firecracker, Andra gave a brief overview on this new VMM (Virtual
Machine Monitor) written in Rust and she explained why, in the v0.18.0 release,
they switched from the experimental vhost-vsock implementation to a vhost-less
solution:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;focus on security impact&lt;/li&gt;
&lt;li&gt;less dependency on host kernel features&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This change required a device emulation in Firecracker, that implements
virtio-vsock device model over MMIO. The device is exposed in the host using
UDS (Unix Domain Sockets).&lt;/p&gt;
&lt;p&gt;Andra described how Firecracker maps the VSOCK ports on the &lt;code&gt;uds_path&lt;/code&gt; specified
in the VM configuration:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Host-Initiated Connections&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Guest: create an AF_VSOCK socket and &lt;code&gt;listen()&lt;/code&gt; on PORT&lt;/li&gt;
&lt;li&gt;Host: &lt;code&gt;connect()&lt;/code&gt; to AF_UNIX at &lt;code&gt;uds_path&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Host: &lt;code&gt;send()&lt;/code&gt; &amp;ldquo;CONNECT PORT\n&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Guest: &lt;code&gt;accept()&lt;/code&gt; the new connection&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Guest-Initiated Connections&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Host: create and &lt;code&gt;listen()&lt;/code&gt; on an AF_UNIX socket at &lt;code&gt;uds_path_PORT&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Guest: create an AF_VSOCK socket and &lt;code&gt;connect()&lt;/code&gt; to &lt;code&gt;HOST_CID&lt;/code&gt; and &lt;code&gt;PORT&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Host: &lt;code&gt;accept()&lt;/code&gt; the new connection&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Finally, she showed the performance of this solution, running
&lt;a href=&#34;https://github.com/stefano-garzarella/iperf-vsock&#34;&gt;iperf-vsock&lt;/a&gt; benchmark,
varying the size of the buffer used in Firecracker to transfer packets
between the virtio-vsock device and the UNIX domain socket. The throughput
on the guest to host path reaches 10 Gbps.&lt;/p&gt;
&lt;h3 id=&#34;qemu&#34;&gt;QEMU&lt;/h3&gt;
&lt;p&gt;In the second part of the talk, I described the QEMU implementation.
QEMU provides the virtio-vsock device using the vhost-vsock kernel module.&lt;/p&gt;
&lt;p&gt;The vsock device in QEMU handles only:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;configuration
&lt;ul&gt;
&lt;li&gt;user or management tool can configure the guest CID&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;live-migration
&lt;ul&gt;
&lt;li&gt;connected SOCK_STREAM sockets become disconnected.
Applications must handle a connection reset error and should reconnect.&lt;/li&gt;
&lt;li&gt;guest CID can be not available in the new host because can be
assigned to another VM. In this case the guest is notified about the
CID change.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The vhost-vsock kernel module handles the communication with the guest,
providing in-kernel virtio device emulation, to have very high performance and
to interface directly to the host socket layer.
In this way, also host application can directly use POSIX Socket API to
communicate with the guest. So, guest and host applications can be switched
between them, changing only the destination CID.&lt;/p&gt;
&lt;h3 id=&#34;virtio-vsock-linux-drivers&#34;&gt;virtio-vsock Linux drivers&lt;/h3&gt;
&lt;p&gt;After that, I told the story of VSOCK in the Linux tree, started in 2013
when the first implementation was merged, and the changes in the last year.&lt;/p&gt;
&lt;p&gt;These changes mainly regard fixes, but for the virtio/vhost transports we also
improved the performance with two simple changes released with Linux v5.4:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;reducing the number of credit update messages exchanged&lt;/li&gt;
&lt;li&gt;increasing the size of packets queued in the virtio-vsock device from 4 KB up
to 64 KB, the maximum packet size handled by virtio-vsock devices.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With these changes we are able to reach ~40 Gbps in the Guest -&amp;gt; Host path,
because the guest can now send up to 64 KB packets directly to the host;
for the Host -&amp;gt; Guest path, we reached ~25 Gbps, because the host is still
using 4 KB buffer preallocated by the guest.&lt;/p&gt;
&lt;h3 id=&#34;tools-and-languages-that-support-vsock&#34;&gt;Tools and languages that support VSOCK&lt;/h3&gt;
&lt;p&gt;In the last few years, several applications, tools, and languages started to
support VSOCK and I listed them to update the audience:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Tools:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;wireshark &amp;gt;= 2.40 [2017-07-19]&lt;/li&gt;
&lt;li&gt;iproute2 &amp;gt;= 4.15 [2018-01-28]
&lt;ul&gt;
&lt;li&gt;ss&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;tcpdump
&lt;ul&gt;
&lt;li&gt;merged in master [2019-04-16]&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;nmap &amp;gt;= 7.80 [2019-08-10]
&lt;ul&gt;
&lt;li&gt;ncat&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;nbd
&lt;ul&gt;
&lt;li&gt;nbdkit &amp;gt;= 1.15.5 [2019-10-19]&lt;/li&gt;
&lt;li&gt;libnbd &amp;gt;= 1.1.6 [2019-10-19]&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;iperf-vsock
&lt;ul&gt;
&lt;li&gt;iperf3 fork&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Languages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;C
&lt;ul&gt;
&lt;li&gt;glibc &amp;gt;= 2.18 [2013-08-10]&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Python
&lt;ul&gt;
&lt;li&gt;python &amp;gt;= 3.7 alpha 1 [2017-09-19]&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Golang
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/mdlayher/vsock&#34;&gt;https://github.com/mdlayher/vsock&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Rust
&lt;ul&gt;
&lt;li&gt;libc crate &amp;gt;= 0.2.59 [2019-07-08]
&lt;ul&gt;
&lt;li&gt;struct sockaddr_vm&lt;/li&gt;
&lt;li&gt;VMADDR_* macros&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;nix crate &amp;gt;= 0.15.0 [2019-08-10]
&lt;ul&gt;
&lt;li&gt;VSOCK supported in the socket API (nix::sys::socket)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;next-steps&#34;&gt;Next steps&lt;/h3&gt;
&lt;p&gt;Concluding, I went through the next challenges that we are going to face:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;multi-transport&lt;/strong&gt; to use VSOCK in a nested VM environment. because we are
limited by the fact that the current implementation can handle only one
transport loaded at run time, so, we can&amp;rsquo;t load virtio_transport and
vhost_transport together in the L1 guest.
I already sent some patches upstream
[&lt;a href=&#34;https://patchwork.ozlabs.org/cover/1168442/&#34;&gt;RFC&lt;/a&gt;,
&lt;a href=&#34;https://patchwork.ozlabs.org/cover/1181986/&#34;&gt;v1&lt;/a&gt;],
but they are still in progress.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;network namespace support&lt;/strong&gt; to create independent addressing domains with
VSOCK socket. This could be useful for partitioning VMs in different
domains or, in a nested VM environment, to isolate host applications
from guest applications bound to the same port.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;virtio-net as a transport for the virtio-vsock&lt;/strong&gt; to avoid to re-implement
features already done in virtio-net, such as mergeable buffers,
page allocation, small packet handling.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;from-the-audience&#34;&gt;From the audience&lt;/h4&gt;
&lt;p&gt;Other points to be addressed came from the comments we received from the
audience:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;loopback device&lt;/strong&gt; could be very useful for developers to test applications
that use VSOCK socket. The current implementation support loopback only
in the guest, but it would be better to support it also in the host, adding
&lt;code&gt;VMADDR_CID_LOCAL&lt;/code&gt; special address.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;VM to VM communication&lt;/strong&gt; was asked by several people. Introducing it in the
VSOCK core could complicate the protocol, the addressing and could require
some sort of firewall.
For now we do not have in mind to do it, but I developed a simple user
space application to solve this issue:
&lt;a href=&#34;https://github.com/stefano-garzarella/vsock-bridge&#34;&gt;vsock-bridge&lt;/a&gt;.
In order to improve the performance of this solution, we will consider
the possibility to add &lt;code&gt;sendfile(2)&lt;/code&gt; or
&lt;a href=&#34;https://www.kernel.org/doc/html/v4.15/networking/msg_zerocopy.html&#34;&gt;MSG_ZEROCOPY&lt;/a&gt;
support to the AF_VSOCK core.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;virtio-vsock windows drivers&lt;/strong&gt; is not planned to be addressed, but contributions
are welcome. Other virtio windows drivers are available in the
&lt;a href=&#34;https://github.com/virtio-win/kvm-guest-drivers-windows&#34;&gt;vm-guest-drivers-windows&lt;/a&gt;
repository.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Stay tuned!&lt;/em&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>iperf3-vsock: how to measure VSOCK performance</title>
      <link>https://stefano-garzarella.github.io/posts/2019-08-22-vsock-iperf3/</link>
      <pubDate>Thu, 22 Aug 2019 17:52:06 +0200</pubDate>
      <author>sgarzare@redhat.com (Stefano Garzarella)</author>
      <guid>https://stefano-garzarella.github.io/posts/2019-08-22-vsock-iperf3/</guid>
      <description>&lt;p&gt;The &lt;a href=&#34;https://github.com/stefano-garzarella/iperf-vsock&#34;&gt;iperf-vsock&lt;/a&gt; repository
contains few patches to add the support of VSOCK address family to &lt;code&gt;iperf3&lt;/code&gt;.
In this way &lt;code&gt;iperf3&lt;/code&gt; can be used to measure the performance between guest and
host using VSOCK sockets.&lt;/p&gt;
&lt;p&gt;The VSOCK address family facilitates communication between virtual
machines and the host they are running on.&lt;/p&gt;
&lt;p&gt;To test VSOCK sockets (only Linux), you must use the new option &lt;code&gt;--vsock&lt;/code&gt; on
both server and client.
Other iperf3 options (e.g. &lt;code&gt;-t, -l, -P, -R, --bidir&lt;/code&gt;) are well supported by
VSOCK tests.&lt;/p&gt;
&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Linux host kernel &amp;gt;= 4.8&lt;/li&gt;
&lt;li&gt;Linux guest kernel &amp;gt;= 4.8&lt;/li&gt;
&lt;li&gt;QEMU &amp;gt;= 2.8&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;build-iperf3-vsock-from-source&#34;&gt;Build iperf3-vsock from source&lt;/h2&gt;
&lt;h3 id=&#34;clone-repository&#34;&gt;Clone repository&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git clone https://github.com/stefano-garzarella/iperf-vsock
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; iperf-vsock
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;building&#34;&gt;Building&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mkdir build
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; build
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;../configure
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;make
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;(Note: If configure fails, try running &lt;code&gt;./bootstrap.sh&lt;/code&gt; first)&lt;/p&gt;
&lt;h2 id=&#34;example-with-fedora-30-host-and-guest&#34;&gt;Example with Fedora 30 (host and guest):&lt;/h2&gt;
&lt;h3 id=&#34;host-start-the-vm&#34;&gt;Host: start the VM&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;GUEST_CID&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo modprobe vhost_vsock
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo qemu-system-x86_64 -m 1G -smp &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt; -cpu host -M &lt;span class=&#34;nv&#34;&gt;accel&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;kvm	&lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;     -drive &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;virtio,file&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;/path/to/fedora.img,format&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;qcow2     &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;     -device vhost-vsock-pci,guest-cid&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;GUEST_CID&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;guest-start-iperf-server&#34;&gt;Guest: start iperf server&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# SELinux can block you, so you can write a policy or temporally disable it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo setenforce &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;iperf-vsock/build/src/iperf3 --vsock -s
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;host-start-iperf-client&#34;&gt;Host: start iperf client&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;iperf-vsock/build/src/iperf3 --vsock -c &lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;GUEST_CID&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;output&#34;&gt;Output&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Connecting to host 3, port &lt;span class=&#34;m&#34;&gt;5201&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;  5&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;local&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt; port &lt;span class=&#34;m&#34;&gt;4008596529&lt;/span&gt; connected to &lt;span class=&#34;m&#34;&gt;3&lt;/span&gt; port &lt;span class=&#34;m&#34;&gt;5201&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt; ID&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; Interval           Transfer     Bitrate
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;  5&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;   0.00-1.00   sec  1.30 GBytes  11.2 Gbits/sec
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;  5&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;   1.00-2.00   sec  1.67 GBytes  14.3 Gbits/sec
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;  5&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;   2.00-3.00   sec  1.57 GBytes  13.5 Gbits/sec
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;  5&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;   3.00-4.00   sec  1.49 GBytes  12.8 Gbits/sec
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;  5&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;   4.00-5.00   sec   &lt;span class=&#34;m&#34;&gt;971&lt;/span&gt; MBytes  8.15 Gbits/sec
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;  5&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;   5.00-6.00   sec  1.01 GBytes  8.71 Gbits/sec
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;  5&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;   6.00-7.00   sec  1.44 GBytes  12.3 Gbits/sec
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;  5&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;   7.00-8.00   sec  1.62 GBytes  13.9 Gbits/sec
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;  5&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;   8.00-9.00   sec  1.61 GBytes  13.8 Gbits/sec
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;  5&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;   9.00-10.00  sec  1.63 GBytes  14.0 Gbits/sec
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- - - - - - - - - - - - - - - - - - - - - - - - -
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt; ID&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; Interval           Transfer     Bitrate
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;  5&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;   0.00-10.00  sec  14.3 GBytes  12.3 Gbits/sec                  sender
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;  5&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;   0.00-10.00  sec  14.3 GBytes  12.3 Gbits/sec                  receiver
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;iperf Done.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    
  </channel>
</rss>
