9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Raw ethernet on 9vx
@ 2020-12-07  6:26 remywang
  2020-12-07 23:38 ` Devon H. O'Dell
  0 siblings, 1 reply; 14+ messages in thread
From: remywang @ 2020-12-07  6:26 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 570 bytes --]

Hello, 

I tried out plan9 on 9vx today, and things worked well except for networking. The wiki <https://9p.io/wiki/plan9/9vx/index.html> claims extensions are needed for raw ethernet and native IP stack, but I couldn't find any resource (all links I tried were 404). Can someone give me pointers on getting raw ethernet on 9vx? 

Remy
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-M154790ce9a9ba0a43a3318e9
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 1141 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] Raw ethernet on 9vx
  2020-12-07  6:26 [9fans] Raw ethernet on 9vx remywang
@ 2020-12-07 23:38 ` Devon H. O'Dell
  2020-12-08  5:55   ` remywang
  2020-12-08  9:06   ` Devon H. O'Dell
  0 siblings, 2 replies; 14+ messages in thread
From: Devon H. O'Dell @ 2020-12-07 23:38 UTC (permalink / raw)
  To: 9fans

Hi Remy,

This was based on some proof-of-concept work I did 10-11 years ago and
then was completed to a better standard in a GSoC project by yiyus. I
guess Ron also did some similar work? I don't recall if I mentored the
project or whether Ron did, or to what extent there was collaboration.

The work enabled native IP stack through either TAP/TUN devices or use
of pcap. I believe all the relevant work is reflected in
https://github.com/Plan9-Archive/yiyus-vx32, and I believe this also
collects most of the work Ron did. I think that this was enabled by
setting PLAN9TAP / PLAN9PCAP in the 9vx Makefrag.

N.B. The Plan 9 there is also 10 years old and may not be a great
reflection of what you'd get from 9front or any other current systems
(sorry, I don't know who's actively doing what anymore).

Hope this is helpful.

Kind regards,

--dho


On Sun, Dec 6, 2020 at 10:27 PM <remywang@cs.washington.edu> wrote:
>
> Hello,
>
> I tried out plan9 on 9vx today, and things worked well except for networking. The wiki claims extensions are needed for raw ethernet and native IP stack, but I couldn't find any resource (all links I tried were 404). Can someone give me pointers on getting raw ethernet on 9vx?
>
> Remy
> 9fans / 9fans / see discussions + participants + delivery options Permalink

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-M8991af3ad7049344a10764db
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] Raw ethernet on 9vx
  2020-12-07 23:38 ` Devon H. O'Dell
@ 2020-12-08  5:55   ` remywang
  2020-12-08  7:12     ` Devon H. O'Dell
  2020-12-08  9:06   ` Devon H. O'Dell
  1 sibling, 1 reply; 14+ messages in thread
From: remywang @ 2020-12-08  5:55 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 686 bytes --]

Thanks Devon, this is helpful! I'm using 0intro's repo, and it seems to already set PLAN9TAP=ethertap for linux (link <https://github.com/0intro/vx32/blob/master/src/9vx/Makefrag>). The 9vx doc <https://github.com/0intro/vx32/blob/master/doc/9vx.1> suggests `tap 9vx -r plan9 -u glenda` should work; but currently I'm missing tunctl, /sbin/ifconfig and /usr/sbin/brctl on the host. They seem to be easy to install. I'll try later and report back. 

Remy
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-Mba29a472af61f97b5d3e15ee
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 1251 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] Raw ethernet on 9vx
  2020-12-08  5:55   ` remywang
@ 2020-12-08  7:12     ` Devon H. O'Dell
  2020-12-08  7:45       ` Lucio De Re
  0 siblings, 1 reply; 14+ messages in thread
From: Devon H. O'Dell @ 2020-12-08  7:12 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]

Ah, neat. David's repo seems more up to date.

Linux has undergone a few network subsystem and tool revelations in the
intervening decade, so may be worth updating the tap executor for modern
tools.

Happy to help guide on this matter on- or off-list.

--dho

On Mon, Dec 7, 2020 at 21:55 <remywang@cs.washington.edu> wrote:

> Thanks Devon, this is helpful! I'm using 0intro's repo, and it seems to
> already set PLAN9TAP=ethertap for linux (link
> <https://github.com/0intro/vx32/blob/master/src/9vx/Makefrag>). The 9vx
> doc <https://github.com/0intro/vx32/blob/master/doc/9vx.1> suggests `tap
> 9vx -r plan9 -u glenda` should work; but currently I'm missing tunctl,
> /sbin/ifconfig and /usr/sbin/brctl on the host. They seem to be easy to
> install. I'll try later and report back.
>
> Remy
> *9fans <https://9fans.topicbox.com/latest>* / 9fans / see discussions
> <https://9fans.topicbox.com/groups/9fans> + participants
> <https://9fans.topicbox.com/groups/9fans/members> + delivery options
> <https://9fans.topicbox.com/groups/9fans/subscription> Permalink
> <https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-Mba29a472af61f97b5d3e15ee>
>

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-Mdaae50c42220e6e96ba8bc7e
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 2090 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] Raw ethernet on 9vx
  2020-12-08  7:12     ` Devon H. O'Dell
@ 2020-12-08  7:45       ` Lucio De Re
  0 siblings, 0 replies; 14+ messages in thread
From: Lucio De Re @ 2020-12-08  7:45 UTC (permalink / raw)
  To: 9fans

On list, please, Devon and Remy. I'd also like to get 9VX working.

Lucio.

On 12/8/20, Devon H. O'Dell <devon.odell@gmail.com> wrote:
> Ah, neat. David's repo seems more up to date.
>
> Linux has undergone a few network subsystem and tool revelations in the
> intervening decade, so may be worth updating the tap executor for modern
> tools.
>
> Happy to help guide on this matter on- or off-list.
>
> --dho
>
> On Mon, Dec 7, 2020 at 21:55 <remywang@cs.washington.edu> wrote:
>
>> Thanks Devon, this is helpful! I'm using 0intro's repo, and it seems to
>> already set PLAN9TAP=ethertap for linux (link
>> <https://github.com/0intro/vx32/blob/master/src/9vx/Makefrag>). The 9vx
>> doc <https://github.com/0intro/vx32/blob/master/doc/9vx.1> suggests `tap
>> 9vx -r plan9 -u glenda` should work; but currently I'm missing tunctl,
>> /sbin/ifconfig and /usr/sbin/brctl on the host. They seem to be easy to
>> install. I'll try later and report back.
>>
>> Remy
>> *9fans <https://9fans.topicbox.com/latest>* / 9fans / see discussions
>> <https://9fans.topicbox.com/groups/9fans> + participants
>> <https://9fans.topicbox.com/groups/9fans/members> + delivery options
>> <https://9fans.topicbox.com/groups/9fans/subscription> Permalink
>> <https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-Mba29a472af61f97b5d3e15ee>
>>


-- 
Lucio De Re
2 Piet Retief St
Kestell (Eastern Free State)
9860 South Africa

Ph.: +27 71 471 3694
Cell: +27 83 251 5824

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-M2e5d0514bc00fa9848cb89da
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] Raw ethernet on 9vx
  2020-12-07 23:38 ` Devon H. O'Dell
  2020-12-08  5:55   ` remywang
@ 2020-12-08  9:06   ` Devon H. O'Dell
  2020-12-08  9:20     ` David du Colombier
  1 sibling, 1 reply; 14+ messages in thread
From: Devon H. O'Dell @ 2020-12-08  9:06 UTC (permalink / raw)
  To: 9fans

> This was based on some proof-of-concept work I did 10-11 years ago and
> then was completed to a better standard in a GSoC project by yiyus. I
> guess Ron also did some similar work? I don't recall if I mentored the
> project or whether Ron did, or to what extent there was collaboration.

Looking at the wiki, it also reminds me that quanstro also provided
significant assistance at the time. Sorry to have forgotten that
attribution.

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-M6b7c8f6082bca7ad82253b2f
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] Raw ethernet on 9vx
  2020-12-08  9:06   ` Devon H. O'Dell
@ 2020-12-08  9:20     ` David du Colombier
  2020-12-08 13:00       ` hiro
  0 siblings, 1 reply; 14+ messages in thread
From: David du Colombier @ 2020-12-08  9:20 UTC (permalink / raw)
  To: 9fans

The https://github.com/0intro/vx32 repository was based on the latest Ron Minnich and Yiyus repository.

-- 
David du Colombier

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-M9130b6194452b64df3187ab4
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] Raw ethernet on 9vx
  2020-12-08  9:20     ` David du Colombier
@ 2020-12-08 13:00       ` hiro
  2020-12-09  0:34         ` remywang
  0 siblings, 1 reply; 14+ messages in thread
From: hiro @ 2020-12-08 13:00 UTC (permalink / raw)
  To: 9fans

ah that's interesting. perhaps one day we can add tap also to drawterm :)

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-M32cd5772864ca5ae40173918
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] Raw ethernet on 9vx
  2020-12-08 13:00       ` hiro
@ 2020-12-09  0:34         ` remywang
  2020-12-09  7:00           ` remywang
  0 siblings, 1 reply; 14+ messages in thread
From: remywang @ 2020-12-09  0:34 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

Thanks everybody for the insight. I have to admit that I know absolutly nothing about networking, so please bear with me (or take over if I'm too slow :). The gentoo wiki has good documentation <https://wiki.gentoo.org/wiki/Iproute2#iproute2_for_net-tools_swappers> on switching from ifconfig (net-tools) to ip (ip-route2),  so I'll start from there. 
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-M679a44b019d5e172fe47ecd3
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 1098 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] Raw ethernet on 9vx
  2020-12-09  0:34         ` remywang
@ 2020-12-09  7:00           ` remywang
  2020-12-09 12:46             ` Stuart Morrow
  2020-12-09 14:35             ` Lucio De Re
  0 siblings, 2 replies; 14+ messages in thread
From: remywang @ 2020-12-09  7:00 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 1897 bytes --]

OK, here's what I've got: 

diff --git a/bin/tap b/bin/tap
index 5131834..fbfe066 100755
--- a/bin/tap
+++ b/bin/tap
@@ -8,26 +8,26 @@ cmd=$1
 shift || fatal $usage
 user=`whoami`

-# Create the tap device with tunctl
-iface=`sudo tunctl -b -u $user`
+# Create the tap device with tuntap
+`sudo ip tuntap add tap5 mode tap user $user`
 # or openvpn
 #iface=tap0
 #sudo openvpn --mktun --dev $iface --user $user

 # Bring the tap device up
-sudo /sbin/ifconfig $iface 0.0.0.0 up
+sudo ip link set tap5 up

 # Add it to the bridge
-sudo /usr/sbin/brctl addif br0 $iface
+sudo ip link set tap5 master br0

 # Launch 9vx (use -F to not fork)
-$cmd "$@" -F "ether0=type=tap dev=$iface"
+$cmd "$@" -F "ether0=type=tap dev=tap5"

 # Bring the tap device down and disconnect from br0
-sudo /sbin/ifconfig $iface down
-sudo /usr/sbin/brctl delif br0 $iface
+sudo ip link set tap5 down
+sudo ip link set tap5 nomaster

-# Remove the tap device with tunctl
-sudo tunctl -d $iface &> /dev/null
+# Remove the tap device with tuntap
+sudo ip tuntap del tap5 &> /dev/null
 # or openvpn
 #sudo openvpn --rmtun --dev $1

Running `tap 9vx -r 9front -u glenda`, then `ip/ipconfig` hangs for a while, then it returns "DHCP failed". And on vanilla plan9 it just hangs. FWIW, I got the same result using the old commands from net-tools. 

And several details: 
1. I had to hard-code the tap device name "tap5" because `ip tuntap ...` doesn't return the interface name. 
2. I have no idea what 0.0.0.0 is, or where to pass it in. (tried `ip link set tap5 up address 0.0.0.0` but it complained the address was too short). 

Remy
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-M091abcc56de424937ea9b136
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 9981 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] Raw ethernet on 9vx
  2020-12-09  7:00           ` remywang
@ 2020-12-09 12:46             ` Stuart Morrow
  2020-12-09 14:35             ` Lucio De Re
  1 sibling, 0 replies; 14+ messages in thread
From: Stuart Morrow @ 2020-12-09 12:46 UTC (permalink / raw)
  To: 9fans

If you're using the 9front userspace you might want to throw the
9front kernel's port directory at 9vx and rebuild (I haven't tried
this). Not that that has anything to do with your current problem.

I wonder why it says DHCP failed instead of no success with DHCP.

Can't help you with the tun/tap stuff. Maybe at that layer everything
is working properly and you just need to do a manual ipconfig(8)
inside 9vx.

Stuart

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-M44fd4534663000107988045d
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] Raw ethernet on 9vx
  2020-12-09  7:00           ` remywang
  2020-12-09 12:46             ` Stuart Morrow
@ 2020-12-09 14:35             ` Lucio De Re
  2020-12-09 15:29               ` remywang
  1 sibling, 1 reply; 14+ messages in thread
From: Lucio De Re @ 2020-12-09 14:35 UTC (permalink / raw)
  To: 9fans

On 12/9/20, remywang@cs.washington.edu <remywang@cs.washington.edu> wrote:
>
> [ ... ]
You're brave!

> And several details:
> 1. I had to hard-code the tap device name "tap5" because `ip tuntap ...`
> doesn't return the interface name.
> 2. I have no idea what 0.0.0.0 is, or where to pass it in. (tried `ip link
> set tap5 up address 0.0.0.0` but it complained the address was too short).
>
Even if the interface name is not returned (which usually means the
powers that be have found a more sensible, but totally novel way to
make it available), you should really set

iface=tap5

or even

export iface=tap5

and save a lot of editing later.

If "0.0.0.0" is too short, the chances are "0.0.0.0/0" may be the valid form.

0.0.0.0[/0] is more a place holder (a bit like NULL) than a real IP address.

That said, I am still trying to get my head around creating tap
devices for VMs, in the new lingo (or in the old) even though my
TCP/IP experience goes back to 1990. But then I think the RFCs at that
stage were still below one thousand.

Lucio.

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-M77f8e210b7e9e2a9fbbf2e2d
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] Raw ethernet on 9vx
  2020-12-09 14:35             ` Lucio De Re
@ 2020-12-09 15:29               ` remywang
  2020-12-09 19:03                 ` Lucio De Re
  0 siblings, 1 reply; 14+ messages in thread
From: remywang @ 2020-12-09 15:29 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 829 bytes --]

Sorry, I should have quoted the errors more carefully. 

> I wonder why it says DHCP failed instead of no success with DHCP.

You are right, it does say "no success with DHCP". 

> If "0.0.0.0" is too short, the chances are "0.0.0.0/0" may be the valid form.

The exact error is "Invalid address length 4 - must be 6 bytes". I tried a few others including 0.0.0.0 but none of them worked. Not specifying this argument however doesn't trigger any complaints. 

Perhaps it's time to peruse the man pages for ip! But I have to put this down for now and will come back to it this weekend. 
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-M6e8f58d18be9957c0e897fb1
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 1546 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [9fans] Raw ethernet on 9vx
  2020-12-09 15:29               ` remywang
@ 2020-12-09 19:03                 ` Lucio De Re
  0 siblings, 0 replies; 14+ messages in thread
From: Lucio De Re @ 2020-12-09 19:03 UTC (permalink / raw)
  To: 9fans

"ip link ..." can optionally set or select the ethernet address, which
is indeed 48 bits (6 bytes) long. I can see how that may be linked to
the DHCP failure, but only as an educated guess.

Lucio.


On 12/9/20, remywang@cs.washington.edu <remywang@cs.washington.edu> wrote:
> Sorry, I should have quoted the errors more carefully.
>
>> I wonder why it says DHCP failed instead of no success with DHCP.
>
> You are right, it does say "no success with DHCP".
>
>> If "0.0.0.0" is too short, the chances are "0.0.0.0/0" may be the valid
>> form.
> 
> The exact error is "Invalid address length 4 - must be 6 bytes". I tried a
> few others including 0.0.0.0 but none of them worked. Not specifying this
> argument however doesn't trigger any complaints.
> 
> Perhaps it's time to peruse the man pages for ip! But I have to put this
> down for now and will come back to it this weekend.


-- 
Lucio De Re
2 Piet Retief St
Kestell (Eastern Free State)
9860 South Africa

Ph.: +27 71 471 3694
Cell: +27 83 251 5824

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-M5944f2b488b0b9bec54d4290
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-12-09 19:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07  6:26 [9fans] Raw ethernet on 9vx remywang
2020-12-07 23:38 ` Devon H. O'Dell
2020-12-08  5:55   ` remywang
2020-12-08  7:12     ` Devon H. O'Dell
2020-12-08  7:45       ` Lucio De Re
2020-12-08  9:06   ` Devon H. O'Dell
2020-12-08  9:20     ` David du Colombier
2020-12-08 13:00       ` hiro
2020-12-09  0:34         ` remywang
2020-12-09  7:00           ` remywang
2020-12-09 12:46             ` Stuart Morrow
2020-12-09 14:35             ` Lucio De Re
2020-12-09 15:29               ` remywang
2020-12-09 19:03                 ` Lucio De Re

9fans - fans of the OS Plan 9 from Bell Labs

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/9fans

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 9fans 9fans/ http://inbox.vuxu.org/9fans \
		9fans@9fans.net
	public-inbox-index 9fans

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.9fans


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git