Re: VPLS patch [0/3]: introduction

2014-11-15 Thread David Gwynne

 On 15 Nov 2014, at 3:40 am, Stuart Henderson st...@openbsd.org wrote:
 
 On 2014/11/14 15:24, Rafael Zalamena wrote:
 On Fri, Nov 14, 2014 at 05:41:32PM +0100, Mike Belopuhov wrote:
 
 is it possible to call it something other than just wire(4)?
 vpls maybe?
 
 pseudowire(4) then? (looks long to me)
 I wouldn't call vpls as it may be expanded later to do also VPWS.
 
 pwe(4)?
 
 though, wire(4) doesn't seem bad to me..

merge it into gif(4).

how about mpw(4) for MPLS Pseudo Wire like mpe(4) is MPLS Provider Edge?

or merge it into gif(4) ;)



Re: VPLS patch [0/3]: introduction

2014-11-14 Thread Rafael Zalamena
On Sun, Sep 14, 2014 at 11:48:11PM -0300, Rafael Zalamena wrote:
 The following mails will contain patchs that implement the VPLS datapath
 in OpenBSD. Applying all patchs should allow people to configure a
 network using VPLS manually.
 
 --- snipped diffs descriptions ---
 
 How to use:
  * Create a MPLS network.
Example: http://2011.eurobsdcon.org/papers/jeker/MPLS.pdf
  * Create a pseudowire in both ends of your network (PEs)
# ifconfig wirenumber encap ethernet wirelabel local label \
remote label neighbor other PE address controlword up
 
# ifconfig wire0 encap ethernet wirelabel 500 500 neighbor 1.2.3.4 up
  or
# ifconfig wire0 encap ethernet wirelabel 500 500 neighbor 1.2.3.4 \
controlword up
  * Create a bridge between the interface facing your customer (CE) and
your wireX, also in both PEs you are configuring the VPN.
 
 --- more comments snipped ---
 
 TODO list:
 * interface configuration code - SIOCSETWIRECFG / SIOCGETWIRECFG (DONE)
 * add / remove wire label (DONE)
 * add / remove wire control label (DONE)
 * ethernet-vlan support (WIP)

Ethernet-tagged support almost complete, it's not working in the case when
you have packets coming with 2 or more tags. I'm having problems to test
this since 5.6 and -current doesn't do QinQ properly. (I'll be sending
proposal diffs to fix this soon)

 * ifconfig(8) integration
 ** show wire configuration (DONE)
 ** configure wire (DONE)
 * man page:
 ** wire(4) (TODO)
 ** ifconfig(8) (TODO)

wire(4) is depending on some other diffs now that are unrelated to this,
please see:

(update mpe to use rt_ifa, wire will use that too)
http://marc.info/?l=openbsd-techm=141280528700615w=2

(fix bridge + vlan, bridge expects the complete packet)
http://marc.info/?l=openbsd-techm=141575896420071w=2


Here is the diff for the man pages:
diff --git sbin/ifconfig/ifconfig.8 sbin/ifconfig/ifconfig.8
index 0449b9f..99de2e4 100644
--- sbin/ifconfig/ifconfig.8
+++ sbin/ifconfig/ifconfig.8
@@ -185,7 +185,8 @@ At least the following devices can be created on demand:
 .Xr trunk 4 ,
 .Xr tun 4 ,
 .Xr vether 4 ,
-.Xr vlan 4
+.Xr vlan 4 ,
+.Xr wire 4
 .It Cm debug
 Enable driver-dependent debugging code; usually, this turns on
 extra console error logging.
@@ -494,6 +495,8 @@ and
 .Xr gre 4 )
 .It
 .Xr vlan 4
+.It
+.Xr wire 4
 .El
 .\ BRIDGE
 .Sh BRIDGE
@@ -1546,6 +1549,53 @@ Disassociate from the parent interface.
 This breaks the link between the vlan interface and its parent,
 clears its vlan tag, flags, and link address, and shuts the interface down.
 .El
+.\ wire
+.Sh WIRE
+.nr nS 1
+.Bk -words
+.Nm ifconfig
+.Ar wire-interface
+.Op Cm wirelabel Ar local-label Ar remote-label Cm neighbor Ar dest-address
+.Op Cm encap Ar encapsulation
+.Op Oo Fl Oc Ns Cm controlword
+.Ek
+.nr Ns 0
+.Pp
+The following options are available for a
+.Xr wire 4
+interface:
+.Bl -tag -width Ds
+.It Cm wirelabel Ar local-label Ar remote-label
+Set wire local label to
+.Ar local-label
+and remote label to
+.Ar remote-label .
+The
+.Ar local-label
+is a 20-bit number which will be used to create a local label route to
+the wire interface and the
+.Ar remote-label
+is another 20-bit number which will be used to create the output label header.
+.It Cm neighbor Ar dest-address
+Sets the destination address where this wire should output. The
+.Ar dest-address
+is an IPv4 address that will be used to find the nexthop in the MPLS
+network.
+.It Cm encap Ar encapsulation
+Configures the wire encapsulation type with value
+.Ar encapsulation
+which can be
+.Ql ethernet
+or
+.Ql ethernet-tagged
+By default it's assumed to be
+.Ql ethernet
+mode.
+.It Cm controlword
+Configure the wire interface to use control-words.
+.It Cm -controlword
+Remove control-word configuration from the interface.
+.El
 .Sh EXAMPLES
 Assign the
 address of 192.168.1.10 with a network mask of

diff --git wire.4 wire.4
new file mode 100644
index 000..b5b5cf3
--- /dev/null
+++ wire.4
@@ -0,0 +1,97 @@
+.\ Copyright (C) 2014 Rafael F. Zalamena rzalam...@gmail.com
+.\
+.\ Permission to use, copy, modify, and distribute this software for any
+.\ purpose with or without fee is hereby granted, provided that the above
+.\ copyright notice and this permission notice appear in all copies.
+.\
+.\ THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\
+.Dd $Mdocdate: September 23 2014 $
+.Dt WIRE 4
+.Os
+.Sh NAME
+.Nm wire
+.Nd Pseudowire
+.Sh SYNOPSIS
+.Cd pseudo-device wire
+.Pp
+.Fd #include sys/types.h
+.Fd #include netmpls/mpls.h
+.Sh DESCRIPTION
+The

Re: VPLS patch [0/3]: introduction

2014-11-14 Thread Mike Belopuhov
On 14 November 2014 17:26, Rafael Zalamena rzalam...@gmail.com wrote:
 On Sun, Sep 14, 2014 at 11:48:11PM -0300, Rafael Zalamena wrote:
 The following mails will contain patchs that implement the VPLS datapath
 in OpenBSD. Applying all patchs should allow people to configure a
 network using VPLS manually.

 --- snipped diffs descriptions ---

 How to use:
  * Create a MPLS network.
Example: http://2011.eurobsdcon.org/papers/jeker/MPLS.pdf
  * Create a pseudowire in both ends of your network (PEs)
# ifconfig wirenumber encap ethernet wirelabel local label \
remote label neighbor other PE address controlword up

# ifconfig wire0 encap ethernet wirelabel 500 500 neighbor 1.2.3.4 up
  or
# ifconfig wire0 encap ethernet wirelabel 500 500 neighbor 1.2.3.4 \
controlword up
  * Create a bridge between the interface facing your customer (CE) and
your wireX, also in both PEs you are configuring the VPN.

 --- more comments snipped ---

 TODO list:
 * interface configuration code - SIOCSETWIRECFG / SIOCGETWIRECFG (DONE)
 * add / remove wire label (DONE)
 * add / remove wire control label (DONE)
 * ethernet-vlan support (WIP)

 Ethernet-tagged support almost complete, it's not working in the case when
 you have packets coming with 2 or more tags. I'm having problems to test
 this since 5.6 and -current doesn't do QinQ properly. (I'll be sending
 proposal diffs to fix this soon)

 * ifconfig(8) integration
 ** show wire configuration (DONE)
 ** configure wire (DONE)
 * man page:
 ** wire(4) (TODO)
 ** ifconfig(8) (TODO)

 wire(4) is depending on some other diffs now that are unrelated to this,
 please see:

 (update mpe to use rt_ifa, wire will use that too)
 http://marc.info/?l=openbsd-techm=141280528700615w=2

 (fix bridge + vlan, bridge expects the complete packet)
 http://marc.info/?l=openbsd-techm=141575896420071w=2


is it possible to call it something other than just wire(4)?
vpls maybe?



Re: VPLS patch [0/3]: introduction

2014-11-14 Thread Rafael Zalamena
On Fri, Nov 14, 2014 at 05:41:32PM +0100, Mike Belopuhov wrote:
 On 14 November 2014 17:26, Rafael Zalamena rzalam...@gmail.com wrote:
  On Sun, Sep 14, 2014 at 11:48:11PM -0300, Rafael Zalamena wrote:
  The following mails will contain patchs that implement the VPLS datapath
  in OpenBSD. Applying all patchs should allow people to configure a
  network using VPLS manually.
 
  --- snipped diffs descriptions ---
 
  How to use:
   * Create a MPLS network.
 Example: http://2011.eurobsdcon.org/papers/jeker/MPLS.pdf
   * Create a pseudowire in both ends of your network (PEs)
 # ifconfig wirenumber encap ethernet wirelabel local label \
 remote label neighbor other PE address controlword up
 
 # ifconfig wire0 encap ethernet wirelabel 500 500 neighbor 1.2.3.4 up
   or
 # ifconfig wire0 encap ethernet wirelabel 500 500 neighbor 1.2.3.4 \
 controlword up
   * Create a bridge between the interface facing your customer (CE) and
 your wireX, also in both PEs you are configuring the VPN.
 
  --- more comments snipped ---
 
  TODO list:
  * interface configuration code - SIOCSETWIRECFG / SIOCGETWIRECFG (DONE)
  * add / remove wire label (DONE)
  * add / remove wire control label (DONE)
  * ethernet-vlan support (WIP)
 
  Ethernet-tagged support almost complete, it's not working in the case when
  you have packets coming with 2 or more tags. I'm having problems to test
  this since 5.6 and -current doesn't do QinQ properly. (I'll be sending
  proposal diffs to fix this soon)
 
  * ifconfig(8) integration
  ** show wire configuration (DONE)
  ** configure wire (DONE)
  * man page:
  ** wire(4) (TODO)
  ** ifconfig(8) (TODO)
 
  wire(4) is depending on some other diffs now that are unrelated to this,
  please see:
 
  (update mpe to use rt_ifa, wire will use that too)
  http://marc.info/?l=openbsd-techm=141280528700615w=2
 
  (fix bridge + vlan, bridge expects the complete packet)
  http://marc.info/?l=openbsd-techm=141575896420071w=2
 
 
 is it possible to call it something other than just wire(4)?
 vpls maybe?

pseudowire(4) then? (looks long to me)

I wouldn't call vpls as it may be expanded later to do also VPWS.



Re: VPLS patch [0/3]: introduction

2014-11-14 Thread Hrvoje Popovski
On 14.11.2014. 18:24, Rafael Zalamena wrote:
 On Fri, Nov 14, 2014 at 05:41:32PM +0100, Mike Belopuhov wrote:
 On 14 November 2014 17:26, Rafael Zalamena rzalam...@gmail.com wrote:
 On Sun, Sep 14, 2014 at 11:48:11PM -0300, Rafael Zalamena wrote:
 The following mails will contain patchs that implement the VPLS datapath
 in OpenBSD. Applying all patchs should allow people to configure a
 network using VPLS manually.

 --- snipped diffs descriptions ---

 How to use:
  * Create a MPLS network.
Example: http://2011.eurobsdcon.org/papers/jeker/MPLS.pdf
  * Create a pseudowire in both ends of your network (PEs)
# ifconfig wirenumber encap ethernet wirelabel local label \
remote label neighbor other PE address controlword up

# ifconfig wire0 encap ethernet wirelabel 500 500 neighbor 1.2.3.4 up
  or
# ifconfig wire0 encap ethernet wirelabel 500 500 neighbor 1.2.3.4 \
controlword up
  * Create a bridge between the interface facing your customer (CE) and
your wireX, also in both PEs you are configuring the VPN.

 --- more comments snipped ---

 TODO list:
 * interface configuration code - SIOCSETWIRECFG / SIOCGETWIRECFG (DONE)
 * add / remove wire label (DONE)
 * add / remove wire control label (DONE)
 * ethernet-vlan support (WIP)

 Ethernet-tagged support almost complete, it's not working in the case when
 you have packets coming with 2 or more tags. I'm having problems to test
 this since 5.6 and -current doesn't do QinQ properly. (I'll be sending
 proposal diffs to fix this soon)

 * ifconfig(8) integration
 ** show wire configuration (DONE)
 ** configure wire (DONE)
 * man page:
 ** wire(4) (TODO)
 ** ifconfig(8) (TODO)

 wire(4) is depending on some other diffs now that are unrelated to this,
 please see:

 (update mpe to use rt_ifa, wire will use that too)
 http://marc.info/?l=openbsd-techm=141280528700615w=2

 (fix bridge + vlan, bridge expects the complete packet)
 http://marc.info/?l=openbsd-techm=141575896420071w=2


 is it possible to call it something other than just wire(4)?
 vpls maybe?
 
 pseudowire(4) then? (looks long to me)
 
 I wouldn't call vpls as it may be expanded later to do also VPWS.
 

maybe l2vpn?



Re: VPLS patch [0/3]: introduction

2014-11-14 Thread Stuart Henderson
On 2014/11/14 15:24, Rafael Zalamena wrote:
 On Fri, Nov 14, 2014 at 05:41:32PM +0100, Mike Belopuhov wrote:
  
  is it possible to call it something other than just wire(4)?
  vpls maybe?
 
 pseudowire(4) then? (looks long to me)
 I wouldn't call vpls as it may be expanded later to do also VPWS.

pwe(4)?

though, wire(4) doesn't seem bad to me..



VPLS patch [0/3]: introduction

2014-09-14 Thread Rafael Zalamena
The following mails will contain patchs that implement the VPLS datapath
in OpenBSD. Applying all patchs should allow people to configure a
network using VPLS manually.

The first patch prepares the system sources to receive the wire
implementation: it turns some mpe specific code into some generic
functions that we will be using in wire and mpe.

The second patch implements the wire datapath itself, with that we should
be able to create a pseudo device that will handle the VPLS labels and
control words. Yet, it is still missing the ethernet-vlan mode.

The third and last patch implements wire specific handling in ifconfig,
like: showing wire configuration and doing the wire configuration.

How to use:
 * Create a MPLS network.
   Example: http://2011.eurobsdcon.org/papers/jeker/MPLS.pdf
 * Create a pseudowire in both ends of your network (PEs)
   # ifconfig wirenumber encap ethernet wirelabel local label \
   remote label neighbor other PE address controlword up

   # ifconfig wire0 encap ethernet wirelabel 500 500 neighbor 1.2.3.4 up
 or
   # ifconfig wire0 encap ethernet wirelabel 500 500 neighbor 1.2.3.4 \
   controlword up
 * Create a bridge between the interface facing your customer (CE) and
   your wireX, also in both PEs you are configuring the VPN.

Now every time a packet comes through the client interface it will be
encapsulated by the wire interface with a new ethernet frame and will
be sent to the neighbor PE configured. When it reaches the destination PE
the packet will be removed from the frame and sent out as it entered the
first PE.

NOTE: there is a LDPd protocol implementation for VPLS/VPWS ongoing by
Renato that might be coming anytime soon. Also, thanks to Renato
for the help and input :) .

Comments and advices are highly welcomed.

TODO list:
* interface configuration code - SIOCSETWIRECFG / SIOCGETWIRECFG (DONE)
* add / remove wire label (DONE)
* add / remove wire control label (DONE)
* ethernet-vlan support (WIP)
* ifconfig(8) integration
** show wire configuration (DONE)
** configure wire (DONE)
* man page:
** wire(4) (TODO)
** ifconfig(8) (TODO)