Up to [local] / src / usr.sbin / switchd
Request diff between arbitrary revisions
Default branch: MAIN
Revision 1.48, Thu Nov 11 09:59:19 2021 UTC (2 years, 6 months ago) by claudio
Branch: MAIN
CVS Tags: HEAD
Changes since 1.47: +1 -1 lines
FILE REMOVED
Retire switchd and switchctl. While interesting they never managed to really get into a usable state. The OpenFlow API is mostly superseeded by P4 and so this is a bit of a dead end. OK akoshibe@ yasuoka@ deraadt@ kn@ patrick@ sthen@
Revision 1.47 / (download) - annotate - [select for diffs], Wed Nov 27 17:37:32 2019 UTC (4 years, 6 months ago) by akoshibe
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE,
OPENBSD_7_0,
OPENBSD_6_9_BASE,
OPENBSD_6_9,
OPENBSD_6_8_BASE,
OPENBSD_6_8,
OPENBSD_6_7_BASE,
OPENBSD_6_7
Changes since 1.46: +9 -11 lines
Diff to previous 1.46 (colored)
OpenFlow 1.3 defines packet header patterns of interest using TLVs (OXMs) that represent various header fields. One place where OXMs are used is in the sef_field action, which contains one OXM representing the header field to set, followed by padding to align the action in the OpenFlow message to 64 bits. Currently, we assume that a set_field action can contain multiple OXMs and that they do not need to be padded. This matches the way we handle OpenFlow messages that contain set_field actions so that we follow the specs. OK ori claudio
Revision 1.46 / (download) - annotate - [select for diffs], Thu Nov 21 06:22:57 2019 UTC (4 years, 6 months ago) by akoshibe
Branch: MAIN
Changes since 1.45: +2 -3 lines
Diff to previous 1.45 (colored)
Remove arguments from ofp13_flowmod() which are unused and unnecessary. ok guenther@
Revision 1.45 / (download) - annotate - [select for diffs], Sun May 5 21:33:00 2019 UTC (5 years, 1 month ago) by akoshibe
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE,
OPENBSD_6_6
Changes since 1.44: +7 -3 lines
Diff to previous 1.44 (colored)
switchd(8) will sometimes not save a copy of a packet needing forwarding even when a switch(4) instance requires it to supply it. Cases where this can happen are: if the copy of the packet recieved from the switch is too short (source/destination pairs can't be recovered), is non-unicast, or when switchd has to fall back to flooding traffic. Factor out the check for short packets, stopping before forwarding decisions are made if the full packet is needed by the switch. Set the packet buffer early for cases where it is needed otherwise. Also replace a few bzero's with memset's. Diff based on one by guenther@ OK phessler@
Revision 1.44 / (download) - annotate - [select for diffs], Sun Sep 9 14:21:32 2018 UTC (5 years, 9 months ago) by akoshibe
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE,
OPENBSD_6_5,
OPENBSD_6_4_BASE,
OPENBSD_6_4
Changes since 1.43: +3 -2 lines
Diff to previous 1.43 (colored)
Make switchd(8) ignore PACKET_INs generated from looped traffic. Currently, it responds to these messages with an invalid PACKET_OUT onto OFP*_PORT_ANY, resulting in the switch responding with an error, causing switchd to disconnect the switch. OK phessler@ claudio@
Revision 1.43 / (download) - annotate - [select for diffs], Tue Jan 17 09:21:50 2017 UTC (7 years, 4 months ago) by rzalamena
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE,
OPENBSD_6_3,
OPENBSD_6_2_BASE,
OPENBSD_6_2,
OPENBSD_6_1_BASE,
OPENBSD_6_1
Changes since 1.42: +4 -4 lines
Diff to previous 1.42 (colored)
Fix OXM parser for set-field messages. Found it the hardway while testing set-field configuration.
Revision 1.42 / (download) - annotate - [select for diffs], Thu Dec 22 15:31:43 2016 UTC (7 years, 5 months ago) by rzalamena
Branch: MAIN
Changes since 1.41: +232 -115 lines
Diff to previous 1.41 (colored)
Learn remote switch flow tables properties to find out where to install the default table-miss flow for OpenFlow 1.3.5. This is enough to make switchd(8) to work with switch(4) and HP 3800 switch out-of-the-box. ok reyk@
Revision 1.41 / (download) - annotate - [select for diffs], Fri Dec 2 14:39:46 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
Changes since 1.40: +3 -49 lines
Diff to previous 1.40 (colored)
Implement the connection state machine for OpenFlow 1.0 and 1.3 to detect invalid state transitions and invalid protocol version switching after the hello messages exchange. ok reyk@
Revision 1.40 / (download) - annotate - [select for diffs], Tue Nov 22 17:21:56 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
Changes since 1.39: +3 -8 lines
Diff to previous 1.39 (colored)
Implement support for version negotiation using hello messages. This also prevents connections from switching the version in the middle of the operation. tweak from and ok reyk@
Revision 1.39 / (download) - annotate - [select for diffs], Mon Nov 21 19:33:12 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
Changes since 1.38: +48 -7 lines
Diff to previous 1.38 (colored)
Do more strict checks of OXM by looking at mask restrictions and add missing OXM type (IP_PROTO). ok reyk@
Revision 1.38 / (download) - annotate - [select for diffs], Mon Nov 21 19:18:39 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
Changes since 1.37: +36 -31 lines
Diff to previous 1.37 (colored)
Add truncation validation for packet-out and reuse the action validation function instead of manually rolling the code again. ok reyk@
Revision 1.37 / (download) - annotate - [select for diffs], Mon Nov 21 18:19:51 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
Changes since 1.36: +3 -3 lines
Diff to previous 1.36 (colored)
Fix jumbo regress test for ofp10.c and use htonl() with OFP_PKTOUT_NO_BUFFER for consistency. ok reyk@
Revision 1.36 / (download) - annotate - [select for diffs], Mon Nov 21 17:58:24 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
Changes since 1.35: +161 -18 lines
Diff to previous 1.35 (colored)
Implement better table features validation. With this we get free switchctl display of table features. ok reyk@
Revision 1.35 / (download) - annotate - [select for diffs], Mon Nov 21 12:13:16 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
Changes since 1.34: +25 -3 lines
Diff to previous 1.34 (colored)
Parse flow-status instructions in multipart replies, so we can see what instructions are used by the flow.
Revision 1.34 / (download) - annotate - [select for diffs], Fri Nov 18 20:20:19 2016 UTC (7 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.33: +6 -5 lines
Diff to previous 1.33 (colored)
The special LOCAL and CONTROLLER ports are valid source ports that should be learned by the cache. Fixes "addlocal" ports on switch(4). OK rzalamena@
Revision 1.33 / (download) - annotate - [select for diffs], Fri Nov 18 19:07:44 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
Changes since 1.32: +67 -73 lines
Diff to previous 1.32 (colored)
Make switchd(8) use more strings just like tcpdump(8). While here remove action field display from features request.
Revision 1.32 / (download) - annotate - [select for diffs], Fri Nov 18 16:56:09 2016 UTC (7 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)
Define a group_id map and rename the defines accordingly. Requested by rzalamena@
Revision 1.31 / (download) - annotate - [select for diffs], Fri Nov 18 13:15:42 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
Changes since 1.30: +47 -35 lines
Diff to previous 1.30 (colored)
Small code improvements: - Free ibufs on validation failures; - Don't use htons() for flow-mod command; ok reyk@
Revision 1.30 / (download) - annotate - [select for diffs], Fri Nov 18 13:05:12 2016 UTC (7 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.29: +7 -1 lines
Diff to previous 1.29 (colored)
Fix the flowmod header to send the correct command and buffer id. OK rzalamena@
Revision 1.29 / (download) - annotate - [select for diffs], Thu Nov 17 16:24:00 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
Changes since 1.28: +6 -4 lines
Diff to previous 1.28 (colored)
Fix some styles issues: break big lines and remove some useless spaces.
Revision 1.28 / (download) - annotate - [select for diffs], Thu Nov 17 12:40:56 2016 UTC (7 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.27: +33 -39 lines
Diff to previous 1.27 (colored)
Add an abstraction layer / API to create flows including all matches and instructions. This makes it easier to integrate flow features in switchd and switchctl later. Written and committed during a long flight. OK rzalamena@
Revision 1.27 / (download) - annotate - [select for diffs], Thu Nov 17 10:15:05 2016 UTC (7 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.26: +11 -1 lines
Diff to previous 1.26 (colored)
Accept OFP_XM_T_ETH_TYPE. OK rzalamena@
Revision 1.26 / (download) - annotate - [select for diffs], Thu Nov 17 09:42:11 2016 UTC (7 years, 6 months ago) by rzalamena
Branch: MAIN
Changes since 1.25: +96 -1 lines
Diff to previous 1.25 (colored)
Added the missing code to build flow-mod messages and to install table-miss by default for switch(4). ok reyk@
Revision 1.25 / (download) - annotate - [select for diffs], Mon Nov 7 13:27:11 2016 UTC (7 years, 7 months ago) by rzalamena
Branch: MAIN
Changes since 1.24: +300 -2 lines
Diff to previous 1.24 (colored)
Implement support for flow-mod messages validation, this includes: action and instructions validation. ok reyk@
Revision 1.24 / (download) - annotate - [select for diffs], Mon Nov 7 13:18:18 2016 UTC (7 years, 7 months ago) by rzalamena
Branch: MAIN
Changes since 1.23: +2 -1 lines
Diff to previous 1.23 (colored)
Fix a small parsing error in packet-in: don't count ofp_match header bytes when iterating over the OXMs. It only works because the last bytes are either padding or something that looks like OXM. ok reyk@
Revision 1.23 / (download) - annotate - [select for diffs], Fri Nov 4 22:33:04 2016 UTC (7 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)
Empty -> empty in log messages
Revision 1.22 / (download) - annotate - [select for diffs], Fri Nov 4 22:27:08 2016 UTC (7 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.21: +1 -14 lines
Diff to previous 1.21 (colored)
Move ofp_output() into ofp_common.c and few function prototypes into switchd.h. No functional change.
Revision 1.21 / (download) - annotate - [select for diffs], Thu Oct 13 08:29:14 2016 UTC (7 years, 7 months ago) by rzalamena
Branch: MAIN
Changes since 1.20: +71 -8 lines
Diff to previous 1.20 (colored)
Implement simple feature request/reply support so we can get more information about the target switch and its datapath id. Also I commented out some requests that are not currently being used, like table properties, flow dump and description. ok reyk@
Revision 1.20 / (download) - annotate - [select for diffs], Wed Oct 12 15:18:56 2016 UTC (7 years, 7 months ago) by rzalamena
Branch: MAIN
Changes since 1.19: +54 -2 lines
Diff to previous 1.19 (colored)
Teach switchd(8) how to send set_config to the switch so we can be able to get packet payloads from switch(4). ok reyk@
Revision 1.19 / (download) - annotate - [select for diffs], Fri Oct 7 08:49:53 2016 UTC (7 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.18: +1 -884 lines
Diff to previous 1.18 (colored)
Move some shared code into a new file. Discussed with rzalamena@
Revision 1.18 / (download) - annotate - [select for diffs], Fri Oct 7 08:31:08 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
Changes since 1.17: +121 -9 lines
Diff to previous 1.17 (colored)
Add support for multipart replies and implement a simple ofp 1.3.5 error message sending function. ok reyk@
Revision 1.17 / (download) - annotate - [select for diffs], Fri Sep 30 12:48:27 2016 UTC (7 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.16: +3 -2 lines
Diff to previous 1.16 (colored)
Remove local copy of ofp.h and use net/ofp.h instead
Revision 1.16 / (download) - annotate - [select for diffs], Fri Sep 30 11:57:57 2016 UTC (7 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.15: +6 -4 lines
Diff to previous 1.15 (colored)
Implement socket server code that properly handles async I/O, partial messages, multiple messages per buffer and important things like connection limits and file descriptor accounting. It works with TCP connections as well as switch(4). The ofrelay.c part replaces networking that was in ofp.c and will soon handle all socket connections of switchd. It is called "ofrelay" because it will be used as client, server, and forwarder. OK rzalamena@
Revision 1.15 / (download) - annotate - [select for diffs], Thu Sep 29 18:25:54 2016 UTC (7 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.14: +7 -7 lines
Diff to previous 1.14 (colored)
Rename ofp_send to ofp_output
Revision 1.14 / (download) - annotate - [select for diffs], Thu Sep 29 18:16:50 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
Changes since 1.13: +322 -16 lines
Diff to previous 1.13 (colored)
Teach switchd(8) how to request flow entries and how to validate the request/reply. With this we get the OXM type/value printing for all directions.
Revision 1.13 / (download) - annotate - [select for diffs], Thu Sep 29 15:10:23 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
Changes since 1.12: +2 -7 lines
Diff to previous 1.12 (colored)
Use the macro OFP_ALIGN() to find alignment instead of rolling my own way. ok reyk@
Revision 1.12 / (download) - annotate - [select for diffs], Thu Sep 29 13:30:48 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
Changes since 1.11: +43 -1 lines
Diff to previous 1.11 (colored)
Teach switchd(8) how to ask for and debug equipment description requests / replies.
Revision 1.11 / (download) - annotate - [select for diffs], Thu Sep 29 13:04:50 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
Changes since 1.10: +399 -4 lines
Diff to previous 1.10 (colored)
Teach switchd(8) some multipart table properties request/parse code to handle basic display.
Revision 1.10 / (download) - annotate - [select for diffs], Wed Sep 28 17:48:35 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
Changes since 1.9: +5 -3 lines
Diff to previous 1.9 (colored)
Always ask the switch to send the whole packet unbuffered so we can analyze the content of the packet and not truncate it when sending packet_out. ok reyk@
Revision 1.9 / (download) - annotate - [select for diffs], Tue Sep 27 22:27:38 2016 UTC (7 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.8: +12 -6 lines
Diff to previous 1.8 (colored)
Fix previous: don't attempt to write a NULL packet to the tap device. Also print a debug message if the packet has been truncated by the switch.
Revision 1.8 / (download) - annotate - [select for diffs], Tue Sep 27 19:40:43 2016 UTC (7 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.7: +8 -3 lines
Diff to previous 1.7 (colored)
OpenFlow PACKET_IN can send truncated packets; this only makes sense if the switch buffers packets, otherwise we might end up forwarding truncated packets to the network with the PACKET_OUT response. So, for now, only close the connection if the packet is not buffered by the switch but truncated. OK rzalamena@
Revision 1.7 / (download) - annotate - [select for diffs], Mon Sep 26 12:33:04 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
Changes since 1.6: +983 -44 lines
Diff to previous 1.6 (colored)
Teach switchd(8) how to create flows for new connections using OpenFlow 1.3.5, implement the OXM filters to use with flow matching and Set-Action, prepare code to receive group management and add dummy flow_removed handler to avoid closing the connection on idle flows.
Revision 1.6 / (download) - annotate - [select for diffs], Mon Sep 26 08:46:00 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
Changes since 1.5: +10 -1 lines
Diff to previous 1.5 (colored)
Enable more debug messages to help developing flow modification messages. ok reyk@
Revision 1.5 / (download) - annotate - [select for diffs], Thu Jul 21 14:25:36 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE,
OPENBSD_6_0
Changes since 1.4: +55 -14 lines
Diff to previous 1.4 (colored)
Add basic support for OpenFlow 1.3 PACKET_IN+PACKET_OUT, no FLOW_MOD yet.
Revision 1.4 / (download) - annotate - [select for diffs], Thu Jul 21 07:58:44 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.3: +49 -63 lines
Diff to previous 1.3 (colored)
Turn ofp*_debug functions into ofp*_validate functions to follow a similar approach like iked: first validate the packet, then parse it, and execute actions. debug logging is a side effect of validation.
Revision 1.3 / (download) - annotate - [select for diffs], Wed Jul 20 19:57:54 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.2: +75 -4 lines
Diff to previous 1.2 (colored)
Parse and print OpenFlow 1.3 PACKET_IN and OXM (Openflow eXtended Match) - no action yet.
Revision 1.2 / (download) - annotate - [select for diffs], Wed Jul 20 14:15:08 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.1: +373 -57 lines
Diff to previous 1.1 (colored)
Update OpenFlow 1.3 stub based on the 1.0 code.
Revision 1.1 / (download) - annotate - [select for diffs], Tue Jul 19 16:54:26 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN
Import switchd(8), a basic WIP OpenFlow implementation for OpenBSD. switchd consists of two parts: 1. switchd(8) and switchctl(8), an OpenFlow controller or "vswitch". 2. switch(4), an OpenFlow-aware kernel "bridge". This the 1st part, the driver will be imported later. The code will remain disabled for a while, but it helps development to have it in the tree. switchd currently supports partial OpenFlow 1.0, but the goal is to use OpenFlow 1.3.5 instead (switch(4) already does 1.3.5). For more background information see: http://www.openbsd.org/papers/bsdcan2016-switchd.pdf https://youtu.be/Cuo0qT-lqig With help from yasuoka@ goda@ Import discussed with deraadt@