Update smb3-mc-daemons-n1a.dia
[obnox/slides/2015-09-sdc-multi-channel.git] / content.wiki
index 4f5382bc0f2b1907bd4dbb578e8a3118be6e913c..f2c7982d2c20ee567fd51590d91c9bfa3587e5ca 100644 (file)
 #* new crypto (sign/encrypt) [4.0]
 #* secure negotiation [4.0]
 #* durable handles v2 [4.0]
-#* persistent file handles [WIP/tracer]
 #* '''_red_Multi-Channel_''' [WIP+]
-#* SMB direct [designing/starting]
-#* cluster features [designing]
+#* SMB direct [design]
+#* cluster features [design/WIP]
 #** witness [WIP+]
+#* persistent file handles [design/tracer]
 #* storage features [WIP]
-# SMB 3.0.2 (Win8.1 / 2012R2): [master]
+# SMB 3.0.2 (Win8.1 / 2012R2): [4.3]
 # SMB 3.1.1 (Win10 / 2014):
-#* negotiate contexts, preauth: [master] 
+#* negotiate contexts, preauth: [4.3]
 
 [[[.35\textwidth]]]
 %<<<durable-crop-colormod-1024,width=.9\textwidth>>>
 
 ==== Multi-Channel - General ====
 
-* multiple transport connections in one SMB(3) session
-** '''channel''': transport connection bound to a session
+<[block]{multiple transport connections in one SMB(3) session}
+* '''channel''': transport connection bound to a session
 * client decides which connections to bind and to use
-* increase throughput:
-** use multiple connections of same type
-* improve fault tolerance:
-** session is valid as long as one channel is still intact
-** channel failure: replay/retry detection
+* session is valid as long as at least one channel is intact
+[block]>
 
-* use case: channels of different type/quality:
-** use only the channels of best quality
-** fall back to inferior channels if superior fail
-** e.g.: laptop switching between WiFi and LAN
+<[block]{two purposes}
+# increase throughput:
+#* use multiple connections of same type
+# improve fault tolerance:
+#* channel failure: replay/retry detection
+%%#* session is valid as long as one channel is still intact
+[block]>
+
+==== Multi-Channel - General ====
+
+<[block]{use case: channels of different type/quality}
+* use only the channels of best quality
+* fall back to inferior channels if superior ones fail
+* e.g.: laptop switching between WiFi and LAN (?)
+[block]>
 
 ==== Multi-Channel - Windows/Protocol ====
 
 # establish initial session on TCP connection
 # find interfaces with interface discovery: \\ %
 @FSCTL\_QUERY\_NETWORK\_INTERFACE\_INFO@
-# bind additional TCP (or RDMA) connection (channel) to established SMB3 session (session bind)
-# windows: uses connections of same (and best quality)
-# windows: binds only to a single node
+# bind additional TCP (or later RDMA) connection (channel) to established SMB3 session (''session bind'')
+# Windows: uses connections of same (and best) quality
+# Windows: binds only to a single node
 # replay / retry mechanisms, epoch numbers
 
-==== Multi-Channel - Samba ====
+==== Multi-Channel $\in$ Samba ====
 
 <[block]{samba/smbd: multi-process}
 * '''Currently:''' process $\Leftrightarrow$ TCP connection
 *<0> !But!: This may not work! \frownie
 [block]>
 
-==== Multi-Channel - Samba : daemons ====
+==== Multi-Channel $\in$ Samba ====
 
 <[center]
 <<<smb3-mc-daemons-n1.png,width=.9\textwidth>>>
 [center]>
 
-==== Multi-Channel - Samba ====
+==== Multi-Channel $\in$ Samba ====
 
 <[block]{samba/smbd: multi-process}
 * '''Currently:''' process $\Leftrightarrow$ TCP connection
 ** ''Natural choice'': at SessionSetup (Bind)
 ** !Idea!: as early as possible, based on ClientGUID \\ %
 ==> per ClientGUID single process model
-*<0> !But!: This may not work! \frownie
+*<0> !But!: There may be problems! ... \frownie
 [block]>
 
 
-==== Multi-Channel - Samba : daemons ====
+==== Multi-Channel $\in$ Samba ====
 
+-<1>{
 <[center]
 <<<smb3-mc-daemons-n1a.png,width=.9\textwidth>>>
 [center]>
+}
 
-
-==== Multi-Channel - Samba : daemons ====
-
+-<2>{
 <[center]
 <<<smb3-mc-daemons-n2.png,width=.9\textwidth>>>
 [center]>
+}
 
-==== Multi-Channel - Samba : daemons ====
-
+-<3>{
 <[center]
 <<<smb3-mc-daemons-n3.png,width=.9\textwidth>>>
 [center]>
+}
 
 
-
-==== Multi-Channel - Samba ====
+==== Multi-Channel $\in$ Samba ====
 
 <[block]{samba/smbd: multi-process}
 * '''Currently:''' process $\Leftrightarrow$ TCP connection
 ** ''Natural choice'': at SessionSetup (Bind)
 ** !Idea!: as early as possible, based on ClientGUID \\ %
 ==> per ClientGUID single process model
-*<0> !But!: This may not work! \frownie
+*<0> !But!: There may be problems! ... \frownie
 [block]>
 
 
-==== Multi-Channel - Samba : pass by ClientGUID ====
+==== Multi-Channel $\in$ Samba : pass by ClientGUID ====
 
 <[center]
 %%<<<smb3-mc-samba_exp.png,height=.9\textheight>>>
 <<<smb3-mc-samba.png,height=.9\textheight>>>
 [center]>
 
-==== Multi-Channel - Samba ====
+
+==== Multi-Channel $\in$ Samba : pass by ClientGUID ====
+
+<[block]{Wait a minute - what about performance?}
+* Single process...
+* But we use short-lived worker-pthreads for I/O ops!
+* Benchmarks and tunings still to be done.
+[block]>
+
+==== Multi-Channel $\in$ Samba ====
 
 <[block]{samba/smbd: multi-process}
 * '''Currently:''' process $\Leftrightarrow$ TCP connection
 ** ''Natural choice'': at SessionSetup (Bind)
 ** ''Idea'': as early as possible, based on ClientGUID \\ %
 ==> per ClientGUID single process model
-* !But!: This may not work! \frownie
+* !But!: There may be problems! ... \frownie
 [block]>
 
 
-==== The relevance of the ClientGUID ====
+==== The Relevance of the ClientGUID ====
 
-+<2->{
++<1->{
 <[block]{Assumption was:}
 * All channels in a session have the same ClientGUID
-* The server enforces that
+* The server enforces this
 [block]>
 }
 
-+<3->{
++<2->{
 <[block]{Evidence from [MS-SMB2]:}
 * 3.3.5.9 Receiving an SMB2 CREATE Request:
-** Sets Open.ClientGuid to Connection.ClientGuid
-** Replay detection checks \\ %
+** sets Open.ClientGuid to Connection.ClientGuid
+** replay detection checks \\ %
 Open.ClientGuid == Connection.ClientGuid
 * 3.3.5.9.7/12 Durable (v2) Reconnect Create Context:
 ** check Open.ClientGuid == Connection.ClientGuid
 [block]>
 }
 
-+<4->{
-<[block]{This may not be correct!}
-There is confusion -- currently being discussed.
++<3->{
+<[block]{The truth is...}
+The Windows server does not enforce it!
 [block]>
 }
 
-==== Multi-Channel - Samba : pass by SessionID ====
+
+==== The Relevance of the ClientGUID ====
+
+<[block]{Windows behaviour according to MS}
+* The server does NOT enforce same ClientGUID in a session.
+* But clients can be expected to do it.
+* But it is not explicitly documented like this.
+[block]>
+
++<2->{
+<[block]{The good news:}
+There will be documentation notes:
+* Things will not work as expected when clients behave differently.
+* It is OK for a server to enforce equality of ClientGUID within session.
+[block]>
+}
+
+==== More digression on ClientGUID : Leases ====
+
+<[block]{According to [MS-SMB2]}
+* Server Global data Structures:
+** GlobalLeaseTableList indexed by ClientGuid (3.3.1.5)
+*** LeaseTable indexed by LeaseKey (3.3.1.11)
+* Requesting a lease (3.3.1.4):
+** Object store takes an abstract ClientLeaseId
+*** Win7: combination of ClientGuid and LeaseKey
+*** Win8+: LeaseKey
+* Object store indicates a lease break (3.3.4.7):
+** smb server uses ClientGuid and LeaseKey given by ObjectStore
+
+ ==> !Inconsistent\! -- What to do?!
+[block]>
+
+
+==== Multi-Channel $\in$ Samba : pass by SessionID (plan B) ====
 
 <[center]
 <<<smb3-mc-samba-v2.png,height=.9\textheight>>>
 [center]>
 
 
-==== Multi-Channel - Samba ====
+==== Multi-Channel $\in$ Samba : Status ====
 
-# preparation: \\ %
-messaging rewrite using unix dgm sockets with sendmsg [DONE,4.2]
++<2->{
+messaging rewrite using unix dgm sockets with sendmsg [DONE,4.2]
 # add fd-passing to messaging [DONE,4.2]
-# preparations in internal structures [DONE]
-# prepare code to cope with multiple channels [DONE]
-# implement smbd message to pass a tcp connection [ess.DONE]
-# transfer connection in Negotiate (by ClientGUID) [largely DONE]
-# transfer connection in Session Bind (by SessionID) [WIP]
+# preparations in internal structures [DONE,master]
+# prepare code to cope with multiple channels [DONE,master]
+# implement smbd message to pass a tcp socket [ess.DONE]
+# transfer connection in Negotiate (by ClientGUID) [ess.DONE]
 # implement session bind [ess.DONE]
+# transfer connection in Session Bind (by SessionID) [thinking..]
 # implement channel epoch numbers [WIP]
 # implement interface discovery [WIP]
-# implement test case [WIP(isn't it always...)]
+# implement test cases [WIP(isn't it always?... $\smiley$)]
+# implement fd-passing in socket-wrapper [WIP]
+}
 
+==== Multi-Channel $\in$ Samba : Status ====
 
-==== @MSG\_SMBXSRV\_CONNECTION\_PASS@ ====
+<[block]{WIP code}
+* @git://git.samba.org/obnox/samba/samba-obnox.git@
+* branch: @master-multi-channel-obnox@
+[block]>
 
-<[block]{from smbXsrv.idl}
+
+==== Multi-Channel $\in$ Samba : Clustering/CTDB ====
+
++<2->{
+<[block]{Special considerations}
+* channels of one session only to one node
+* do not bind connections to CTDB public IPs (can move)!
+* ==> !add static IPs on public interfaces! \\ %
+use these for interface discovery
+[block]>
+}
+
+==== Multi-Channel $\in$ Samba : When? ====
+
++<2->{
+<[block]{When will we get it?}
+In the next major release.
+
+i.e. Samba 4.4.0
+
+i.e. March 2016
+[block]>
+}
+
+
+==== Multi-Channel $\in$ Samba : Details from @smbXsrv.idl@ ====
+%%==== @MSG\_SMBXSRV\_CONNECTION\_PASS@ ====
+
+<[block]{for @MSG\_SMBXSRV\_CONNECTION\_PASS@}
 <[code]
 typedef struct {
     NTTIME                 initial_connect_time;
@@ -240,33 +325,30 @@ typedef struct {
 [code]>
 [block]>
 
-==== Internal Structures (smbXsrv) ====
+%%==== Internal Structures (@smbXsrv.idl@) ====
+==== Multi-Channel $\in$ Samba : Details from @smbXsrv.idl@ ====
 
 
-<[block]{before}
+<[block]{layering before}
 <[code]
-smbXsrv_session->smbXsrv_connection
+smbXsrv_session
+  ->smbXsrv_connection
 [code]>
 [block]>
 
-<[block]{after}
+<[block]{layering now}
 <[code]
-smbXsrv_session->smbXsrv_client->smbXsrv_connections
+smbXsrv_session
+  ->smbXsrv_client
+    ->smbXsrv_connections
 [code]>
 [block]>
 
+
 [frame]>
 
 <[sambabg]
 
-==== ====[plain]
-
-<[center]
-\Large
-shell breakout to browse code/diff
-[center]>
-
-
 
 ==== ====[plain]
 
@@ -286,23 +368,34 @@ Multi-Channel Demo
 [sambabg]>
 
 
-==== SMB Direct (RDMA) ====
+==== SMB Direct : SMB3 over RDMA ====
+
+<[block]{Windows/Protocol}
+* requires multi-channel
+* start with TCP, bind an RDMA channel
+* SMB Direct: small wrapper protocol to put SMB into rdma
+* reads and writes use RDMA write/read
+* protocol/metadata via send/receive
+[block]>
 
-* windows:
-** requires multi-channel
-** start with TCP, bind an RDMA channel
-** reads and writes use RDMA write/read
-** protocol/metadata via send/receive
+==== SMB Direct $\in$ Samba ====
 
 * wireshark dissector: [DONE]
 
-* samba (TODO):
-** prereq: multi-channel / fd-passing
-** buffer / transport abstractions [TODO]
-** _red_problem_: libraries: not fork safe and no fd-passing \\ %
-==> central daemon (or kernel module) to serve as RDMA "proxy"
+* Samba:
+** prereq: multi-channel [WIP]
+** buffer / transport abstractions [WIP]
+
+* _red_problem_ with RDMA libraries:
+** not fork safe
+** no fd-passing
+
+* ==> central RDMA proxy
+** PoC/dev: user space daemon
+** production: kernel module
+
 
-==== SMB Direct (RDMA) - Plan ====
+==== SMB Direct $\in$ Samba ====
 
 <[center]
 <<<smb3-rdma-samba-v2.png,height=.9\textheight>>>