81
Status of SMB2 and SMB3 development in Samba SDC 2012 Michael Adam [email protected] Samba Team / SerNet 2012-09-17

Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Status of SMB2 and SMB3 development in Samba

SDC 2012

Michael Adam

[email protected]

Samba Team / SerNet

2012-09-17

Page 2: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Hi there!

Page 3: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Oh ...

... please interrupt with questions!

Michael Adam SMB2+ in Samba (3 / 28)

Page 4: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Firstly

A couple of introductory words about Samba...

Michael Adam SMB2+ in Samba (4 / 28)

Page 5: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB2 in Samba

I Only SMB 2.0 supported in currentlyreleased code

I experimental support in version 3.5

I SMB 2.0 officially supported in Samba3.6

I Missing feature: durable file handles

Michael Adam SMB2+ in Samba (5 / 28)

Page 6: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB2 in Samba

I Only SMB 2.0 supported in currentlyreleased code

I experimental support in version 3.5

I SMB 2.0 officially supported in Samba3.6

I Missing feature: durable file handles

Michael Adam SMB2+ in Samba (5 / 28)

Page 7: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB2 in Samba

I Only SMB 2.0 supported in currentlyreleased code

I experimental support in version 3.5

I SMB 2.0 officially supported in Samba3.6

I Missing feature: durable file handles

Michael Adam SMB2+ in Samba (5 / 28)

Page 8: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB2 in Samba

I Only SMB 2.0 supported in currentlyreleased code

I experimental support in version 3.5

I SMB 2.0 officially supported in Samba3.6

I Missing feature: durable file handles

Michael Adam SMB2+ in Samba (5 / 28)

Page 9: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB2 in Samba

I Only SMB 2.0 supported in currentlyreleased code

I experimental support in version 3.5

I SMB 2.0 officially supported in Samba3.6

I Missing feature: durable file handles

Michael Adam SMB2+ in Samba (5 / 28)

Page 10: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB2+

I SMB 2.0:I durable file handles

I SMB 2.1:I multi-credit / large mtuI dynamic reauthenticationI leasingI resilient file handles

I SMB 3.0 (tpfka SMB 2.2):I new crypto (sign/encrypt)I secure negotiationI durable handles v2I persistent file handlesI multi-channelI SMB directI cluster featuresI ...

Michael Adam SMB2+ in Samba (6 / 28)

Page 11: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB2+

I SMB 2.0:I durable file handles

I SMB 2.1:I multi-credit / large mtuI dynamic reauthenticationI leasingI resilient file handles

I SMB 3.0 (tpfka SMB 2.2):I new crypto (sign/encrypt)I secure negotiationI durable handles v2I persistent file handlesI multi-channelI SMB directI cluster featuresI ...

Michael Adam SMB2+ in Samba (6 / 28)

Page 12: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB2+

I SMB 2.0:I durable file handles

I SMB 2.1:I multi-credit / large mtuI dynamic reauthenticationI leasingI resilient file handles

I SMB 3.0 (tpfka SMB 2.2):I new crypto (sign/encrypt)I secure negotiationI durable handles v2I persistent file handlesI multi-channelI SMB directI cluster featuresI ...

Michael Adam SMB2+ in Samba (6 / 28)

Page 13: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB2+

I SMB 2.0:I durable file handles

I SMB 2.1:I multi-credit / large mtuI dynamic reauthenticationI leasingI resilient file handles

I SMB 3.0 (tpfka SMB 2.2):I new crypto (sign/encrypt)I secure negotiationI durable handles v2I persistent file handlesI multi-channelI SMB directI cluster featuresI ...

Michael Adam SMB2+ in Samba (6 / 28)

Page 14: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB2+

I SMB 2.0:I durable file handles [(almost)DONE]

I SMB 2.1:I multi-credit / large mtu [DONE]I dynamic reauthentication [DONE]I leasing [TODO]I resilient file handles [TODO]

I SMB 3.0 (tpfka SMB 2.2):I new crypto (sign/encrypt) [DONE]I secure negotiation [DONE]I durable handles v2 [(almost)DONE]I persistent file handles [BEGUN]I multi-channel [TODO]I SMB direct [TODO]I cluster features [TODO]I ...

Michael Adam SMB2+ in Samba (6 / 28)

Page 15: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

The Construction Squad ...

Michael Adam SMB2+ in Samba (7 / 28)

Page 16: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

The Construction Squad ...

I Jeremy Allison

I Stefan Metzmacher

I Michael Adam

I Volker Lendecke

I Christian Ambach

I Ira Cooper

I Gregor Beck

I Bjorn Baumbach

I + ...

Michael Adam SMB2+ in Samba (7 / 28)

Page 17: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles

Michael Adam SMB2+ in Samba (8 / 28)

Page 18: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles

I target: short network outages

I client reconnects session (cleanup)

I then reconnects durable handle

I file server keeps disconnected handle open

Michael Adam SMB2+ in Samba (8 / 28)

Page 19: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles

I target: short network outages

I client reconnects session (cleanup)

I then reconnects durable handle

I file server keeps disconnected handle open

Michael Adam SMB2+ in Samba (8 / 28)

Page 20: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles

I target: short network outages

I client reconnects session (cleanup)

I then reconnects durable handle

I file server keeps disconnected handle open

Michael Adam SMB2+ in Samba (8 / 28)

Page 21: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles

I target: short network outages

I client reconnects session (cleanup)

I then reconnects durable handle

I file server keeps disconnected handle open

Michael Adam SMB2+ in Samba (8 / 28)

Page 22: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles And Samba

Michael Adam SMB2+ in Samba (9 / 28)

Page 23: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles And Samba

I need to find old session by session-ID

I need to find file handle by persistent file ID

I threaded vs. multi-process:keep files open vs. reopen files

I need to serialize state that had before beenin memory only

I new structures in samba:separate smb-layer and file system layer

I ⇒ foundation for all further SMB2 work

Michael Adam SMB2+ in Samba (9 / 28)

Page 24: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles And Samba

I need to find old session by session-ID

I need to find file handle by persistent file ID

I threaded vs. multi-process:keep files open vs. reopen files

I need to serialize state that had before beenin memory only

I new structures in samba:separate smb-layer and file system layer

I ⇒ foundation for all further SMB2 work

Michael Adam SMB2+ in Samba (9 / 28)

Page 25: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles And Samba

I need to find old session by session-ID

I need to find file handle by persistent file ID

I threaded vs. multi-process:keep files open vs. reopen files

I need to serialize state that had before beenin memory only

I new structures in samba:separate smb-layer and file system layer

I ⇒ foundation for all further SMB2 work

Michael Adam SMB2+ in Samba (9 / 28)

Page 26: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles And Samba

I need to find old session by session-ID

I need to find file handle by persistent file ID

I threaded vs. multi-process:keep files open vs. reopen files

I need to serialize state that had before beenin memory only

I new structures in samba:separate smb-layer and file system layer

I ⇒ foundation for all further SMB2 work

Michael Adam SMB2+ in Samba (9 / 28)

Page 27: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles And Samba

I need to find old session by session-ID

I need to find file handle by persistent file ID

I threaded vs. multi-process:keep files open vs. reopen files

I need to serialize state that had before beenin memory only

I new structures in samba:separate smb-layer and file system layer

I ⇒ foundation for all further SMB2 work

Michael Adam SMB2+ in Samba (9 / 28)

Page 28: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles And Samba

I need to find old session by session-ID

I need to find file handle by persistent file ID

I threaded vs. multi-process:keep files open vs. reopen files

I need to serialize state that had before beenin memory only

I new structures in samba:separate smb-layer and file system layer

I ⇒ foundation for all further SMB2 work

Michael Adam SMB2+ in Samba (9 / 28)

Page 29: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Preparations: Tests and Client Libraries

Michael Adam SMB2+ in Samba (10 / 28)

Page 30: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Preparations: Tests and Client Libraries

I tests to explore protocol details: use client libraries

I before: 4 independed client libraries:[smb1, smb2]× [source3, source4](each incomplete and with its own problems)

I now: one low level library for smb1 and smb2(the others are just wrappers now)libcli/smb/smbXcli base.h

I ⇒ we have written a lot of new tests:reauth, multi-credit, multi-channel, durable/persistent handles, ...

I TODO: unify higher level libs to one library used in tests and client

Michael Adam SMB2+ in Samba (10 / 28)

Page 31: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Preparations: Tests and Client Libraries

I tests to explore protocol details: use client libraries

I before: 4 independed client libraries:[smb1, smb2]× [source3, source4](each incomplete and with its own problems)

I now: one low level library for smb1 and smb2(the others are just wrappers now)libcli/smb/smbXcli base.h

I ⇒ we have written a lot of new tests:reauth, multi-credit, multi-channel, durable/persistent handles, ...

I TODO: unify higher level libs to one library used in tests and client

Michael Adam SMB2+ in Samba (10 / 28)

Page 32: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Preparations: Tests and Client Libraries

I tests to explore protocol details: use client libraries

I before: 4 independed client libraries:[smb1, smb2]× [source3, source4](each incomplete and with its own problems)

I now: one low level library for smb1 and smb2(the others are just wrappers now)libcli/smb/smbXcli base.h

I ⇒ we have written a lot of new tests:reauth, multi-credit, multi-channel, durable/persistent handles, ...

I TODO: unify higher level libs to one library used in tests and client

Michael Adam SMB2+ in Samba (10 / 28)

Page 33: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Preparations: Tests and Client Libraries

I tests to explore protocol details: use client libraries

I before: 4 independed client libraries:[smb1, smb2]× [source3, source4](each incomplete and with its own problems)

I now: one low level library for smb1 and smb2(the others are just wrappers now)libcli/smb/smbXcli base.h

I ⇒ we have written a lot of new tests:reauth, multi-credit, multi-channel, durable/persistent handles, ...

I TODO: unify higher level libs to one library used in tests and client

Michael Adam SMB2+ in Samba (10 / 28)

Page 34: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Preparations: Tests and Client Libraries

I tests to explore protocol details: use client libraries

I before: 4 independed client libraries:[smb1, smb2]× [source3, source4](each incomplete and with its own problems)

I now: one low level library for smb1 and smb2(the others are just wrappers now)libcli/smb/smbXcli base.h

I ⇒ we have written a lot of new tests:reauth, multi-credit, multi-channel, durable/persistent handles, ...

I TODO: unify higher level libs to one library used in tests and client

Michael Adam SMB2+ in Samba (10 / 28)

Page 35: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Server: Improve Structures and Protocol Layer Mixup

Michael Adam SMB2+ in Samba (11 / 28)

Page 36: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Server: Improve Structures and Protocol Layer Mixup

I Old structures mix SMB1/2/3 layer with filesystem layers.([MS-CIFS] [MS-SMB] [MS-SMB2]) ↔ [MS-FSA] ↔ SMB VFS/posix)

I Problem: structures are used bydifferent layers⇒ can’t be changed easily to fixa problem in just one layer

I plan: split layers:I SMBI ntfsa vfs layerI posix vfs layer as backend

Michael Adam SMB2+ in Samba (11 / 28)

Page 37: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Server: Improve Structures and Protocol Layer Mixup

I Old structures mix SMB1/2/3 layer with filesystem layers.([MS-CIFS] [MS-SMB] [MS-SMB2]) ↔ [MS-FSA] ↔ SMB VFS/posix)

I Problem: structures are used bydifferent layers⇒ can’t be changed easily to fixa problem in just one layer

I plan: split layers:I SMBI ntfsa vfs layerI posix vfs layer as backend

Michael Adam SMB2+ in Samba (11 / 28)

Page 38: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Server: Improve Structures and Protocol Layer Mixup

I Old structures mix SMB1/2/3 layer with filesystem layers.([MS-CIFS] [MS-SMB] [MS-SMB2]) ↔ [MS-FSA] ↔ SMB VFS/posix)

I Problem: structures are used bydifferent layers⇒ can’t be changed easily to fixa problem in just one layer

I plan: split layers:I SMBI ntfsa vfs layerI posix vfs layer as backend

Michael Adam SMB2+ in Samba (11 / 28)

Page 39: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

old vs. new structures and dbs

OLDstructures

I smbd server connection

I user struct

I connection struct

I files struct

databases

I sessionid.tdb (smbstatus)

I connections.tdb (smbstatus)

I locking.tdb

I brlock.tdb

NEWnew structures and dbs:

I smbXsrv connection

I smbXsrv session

smbXsrv session global.tdb

I smbXsrv tcon

smbXsrv tcon global.tdb

I smbXsrv open

smbXsrv open global.tdb

moved to VFS:

I connection struct

I files struct / locking.tdb

gone:

I sesionid.tdb, connections.tdb

Michael Adam SMB2+ in Samba (12 / 28)

Page 40: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

old vs. new structures and dbs

OLDstructures

I smbd server connection

I user struct

I connection struct

I files struct

databases

I sessionid.tdb (smbstatus)

I connections.tdb (smbstatus)

I locking.tdb

I brlock.tdb

NEWnew structures and dbs:

I smbXsrv connection

I smbXsrv session

smbXsrv session global.tdb

I smbXsrv tcon

smbXsrv tcon global.tdb

I smbXsrv open

smbXsrv open global.tdb

moved to VFS:

I connection struct

I files struct / locking.tdb

gone:

I sesionid.tdb, connections.tdb

Michael Adam SMB2+ in Samba (12 / 28)

Page 41: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

old vs. new structures and dbs

OLDstructures

I smbd server connection

I user struct

I connection struct

I files struct

databases

I sessionid.tdb (smbstatus)

I connections.tdb (smbstatus)

I locking.tdb

I brlock.tdb

NEWnew structures and dbs:

I smbXsrv connection

I smbXsrv session

smbXsrv session global.tdb

I smbXsrv tcon

smbXsrv tcon global.tdb

I smbXsrv open

smbXsrv open global.tdb

moved to VFS:

I connection struct

I files struct / locking.tdb

gone:

I sesionid.tdb, connections.tdb

Michael Adam SMB2+ in Samba (12 / 28)

Page 42: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

old vs. new structures and dbs

OLDstructures

I smbd server connection

I user struct

I connection struct

I files struct

databases

I sessionid.tdb (smbstatus)

I connections.tdb (smbstatus)

I locking.tdb

I brlock.tdb

NEWnew structures and dbs:

I smbXsrv connection

I smbXsrv session

smbXsrv session global.tdb

I smbXsrv tcon

smbXsrv tcon global.tdb

I smbXsrv open

smbXsrv open global.tdb

moved to VFS:

I connection struct

I files struct / locking.tdb

gone:

I sesionid.tdb, connections.tdb

Michael Adam SMB2+ in Samba (12 / 28)

Page 43: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

old vs. new structures and dbs

OLDstructures

I smbd server connection

I user struct

I connection struct

I files struct

databases

I sessionid.tdb (smbstatus)

I connections.tdb (smbstatus)

I locking.tdb

I brlock.tdb

NEWnew structures and dbs:

I smbXsrv connection

I smbXsrv session

smbXsrv session global.tdb

I smbXsrv tcon

smbXsrv tcon global.tdb

I smbXsrv open

smbXsrv open global.tdb

moved to VFS:

I connection struct

I files struct / locking.tdb

gone:

I sesionid.tdb, connections.tdb

Michael Adam SMB2+ in Samba (12 / 28)

Page 44: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Low Hanging Fruit

Michael Adam SMB2+ in Samba (13 / 28)

Page 45: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

LHF1: session reconnect (SMB 2.0)

I when a SMB2 client reconnects to a server (after a network problem)it tries to recreate the user sessions, tree connects anddurable open file handles

I SMB2/3 session setup: clients sends previous session id⇒ the server closes all opens on the old session in case theserver didn’t notice the network problem of the client.

I implementation in samba was relatively easyusing the new smbXsrv structures and the new helpers

Michael Adam SMB2+ in Samba (14 / 28)

Page 46: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

LHF1: session reconnect (SMB 2.0)

I when a SMB2 client reconnects to a server (after a network problem)it tries to recreate the user sessions, tree connects anddurable open file handles

I SMB2/3 session setup: clients sends previous session id⇒ the server closes all opens on the old session in case theserver didn’t notice the network problem of the client.

I implementation in samba was relatively easyusing the new smbXsrv structures and the new helpers

Michael Adam SMB2+ in Samba (14 / 28)

Page 47: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

LHF1: session reconnect (SMB 2.0)

I when a SMB2 client reconnects to a server (after a network problem)it tries to recreate the user sessions, tree connects anddurable open file handles

I SMB2/3 session setup: clients sends previous session id⇒ the server closes all opens on the old session in case theserver didn’t notice the network problem of the client.

I implementation in samba was relatively easyusing the new smbXsrv structures and the new helpers

Michael Adam SMB2+ in Samba (14 / 28)

Page 48: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

LHF1: session reconnect (SMB 2.0)

I when a SMB2 client reconnects to a server (after a network problem)it tries to recreate the user sessions, tree connects anddurable open file handles

I SMB2/3 session setup: clients sends previous session id⇒ the server closes all opens on the old session in case theserver didn’t notice the network problem of the client.

I implementation in samba was relatively easyusing the new smbXsrv structures and the new helpers

Michael Adam SMB2+ in Samba (14 / 28)

Page 49: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

LHF2: dynamic reauthentication (SMB 2.1)

I SMB1 and SMB 2.0: reauthentication was designed toonly happen when a kerberos ticket expired⇒ when the server returns NT STATUS USER SESSION EXPIRED

I SMB 2.1: clients can reauthentiate a session at anytime⇒ we have to implement it.(The one missing mandatory feature for SMB 2.1.)

I implementation was made relatively easyby new gensec-based session setup codeand the new smbXsrv structures

Michael Adam SMB2+ in Samba (15 / 28)

Page 50: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

LHF2: dynamic reauthentication (SMB 2.1)

I SMB1 and SMB 2.0: reauthentication was designed toonly happen when a kerberos ticket expired⇒ when the server returns NT STATUS USER SESSION EXPIRED

I SMB 2.1: clients can reauthentiate a session at anytime⇒ we have to implement it.(The one missing mandatory feature for SMB 2.1.)

I implementation was made relatively easyby new gensec-based session setup codeand the new smbXsrv structures

Michael Adam SMB2+ in Samba (15 / 28)

Page 51: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

LHF2: dynamic reauthentication (SMB 2.1)

I SMB1 and SMB 2.0: reauthentication was designed toonly happen when a kerberos ticket expired⇒ when the server returns NT STATUS USER SESSION EXPIRED

I SMB 2.1: clients can reauthentiate a session at anytime⇒ we have to implement it.(The one missing mandatory feature for SMB 2.1.)

I implementation was made relatively easyby new gensec-based session setup codeand the new smbXsrv structures

Michael Adam SMB2+ in Samba (15 / 28)

Page 52: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

LHF2: dynamic reauthentication (SMB 2.1)

I SMB1 and SMB 2.0: reauthentication was designed toonly happen when a kerberos ticket expired⇒ when the server returns NT STATUS USER SESSION EXPIRED

I SMB 2.1: clients can reauthentiate a session at anytime⇒ we have to implement it.(The one missing mandatory feature for SMB 2.1.)

I implementation was made relatively easyby new gensec-based session setup codeand the new smbXsrv structures

Michael Adam SMB2+ in Samba (15 / 28)

Page 53: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

LHF3: multi-credit (SMB2.1)

I Reduce number of SMB2 packets by allowing multiple credits to beconsumed for large reads/writes.

I Implementation was also relatively easy and straight forward with thenew smbXsrv architecture.

Michael Adam SMB2+ in Samba (16 / 28)

Page 54: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

LHF3: multi-credit (SMB2.1)

I Reduce number of SMB2 packets by allowing multiple credits to beconsumed for large reads/writes.

I Implementation was also relatively easy and straight forward with thenew smbXsrv architecture.

Michael Adam SMB2+ in Samba (16 / 28)

Page 55: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

LHF3: multi-credit (SMB2.1)

I Reduce number of SMB2 packets by allowing multiple credits to beconsumed for large reads/writes.

I Implementation was also relatively easy and straight forward with thenew smbXsrv architecture.

Michael Adam SMB2+ in Samba (16 / 28)

Page 56: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles - smbXsrv extensions

git show 5e63494508ade5da00ad5ab9db139efe03d39c2e

diff --git a/source3/librpc/idl/smbXsrv.idl b/source3/librpc/idl/smbXsrv.idl

index 90572e5..2 a6d7b3 100644

--- a/source3/librpc/idl/smbXsrv.idl

+++ b/source3/librpc/idl/smbXsrv.idl

@@ -267,12 +268 ,19 @@ interface smbXsrv

hyper open_volatile_id;

dom_sid open_owner;

NTTIME open_time;

+ GUID create_guid;

+ GUID client_guid;

+ GUID app_instance_id;

/* ... */

+ NTTIME disconnect_time;

+ uint32 durable_timeout_msec;

+ boolean8 durable;

+ DATA_BLOB backend_cookie;

} smbXsrv_open_global0;

Michael Adam SMB2+ in Samba (17 / 28)

Page 57: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles - smbXsrv extensions

git show 5e63494508ade5da00ad5ab9db139efe03d39c2e

diff --git a/source3/librpc/idl/smbXsrv.idl b/source3/librpc/idl/smbXsrv.idl

index 90572e5..2 a6d7b3 100644

--- a/source3/librpc/idl/smbXsrv.idl

+++ b/source3/librpc/idl/smbXsrv.idl

@@ -267,12 +268 ,19 @@ interface smbXsrv

hyper open_volatile_id;

dom_sid open_owner;

NTTIME open_time;

+ GUID create_guid;

+ GUID client_guid;

+ GUID app_instance_id;

/* ... */

+ NTTIME disconnect_time;

+ uint32 durable_timeout_msec;

+ boolean8 durable;

+ DATA_BLOB backend_cookie;

} smbXsrv_open_global0;

Michael Adam SMB2+ in Samba (17 / 28)

Page 58: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles - VFS interface

New VFS operations for durable handles

I SMB VFS DURABLE COOKIE()

called from the DHnQ / DH2Q create call

I SMB VFS DURABLE DISCONNECT()

called when a client is disconnected (”shutdown close”)

I SMB VFS DURABLE RECONNECT()

called from the durable reconnect call (DHnC / DH2C create)

Michael Adam SMB2+ in Samba (18 / 28)

Page 59: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles - VFS interface

New VFS operations for durable handles

I SMB VFS DURABLE COOKIE()

called from the DHnQ / DH2Q create call

I SMB VFS DURABLE DISCONNECT()

called when a client is disconnected (”shutdown close”)

I SMB VFS DURABLE RECONNECT()

called from the durable reconnect call (DHnC / DH2C create)

Michael Adam SMB2+ in Samba (18 / 28)

Page 60: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles - VFS default implementation

from source3/librpc/idl/open files.idl:

typedef [public] struct {

[value(VFS_DEFAULT_DURABLE_COOKIE_MAGIC),charset(DOS)] \

uint8 magic[0x30];

[value(VFS_DEFAULT_DURABLE_COOKIE_VERSION )] uint32 version;

boolean8 allow_reconnect;

file_id id;

[string ,charset(UTF8)] char servicepath;

[string ,charset(UTF8)] char base_name;

hyper initial_allocation_size;

hyper position_information;

} vfs_default_durable_cookie;

Michael Adam SMB2+ in Samba (19 / 28)

Page 61: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles - VFS default implementation

from source3/librpc/idl/open files.idl:

typedef [public] struct {

[value(VFS_DEFAULT_DURABLE_COOKIE_MAGIC),charset(DOS)] \

uint8 magic[0x30];

[value(VFS_DEFAULT_DURABLE_COOKIE_VERSION )] uint32 version;

boolean8 allow_reconnect;

file_id id;

[string ,charset(UTF8)] char servicepath;

[string ,charset(UTF8)] char base_name;

hyper initial_allocation_size;

hyper position_information;

} vfs_default_durable_cookie;

Michael Adam SMB2+ in Samba (19 / 28)

Page 62: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles - Where are we?

Michael Adam SMB2+ in Samba (20 / 28)

Page 63: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles - Where are we?

I DONE (Samba 4.0.0rc1):I basic smbXsrv infrastructureI session reconnectI durable open: v1 and v2I durable reconnect: v1 and v2

with reopening files

I LIMITATIONS:I no interop yet:I ⇒ disabled when ”posix locking = yes”I ⇒ disabled when ”kernel oplocks = yes”I ⇒ disabled when ”kernel share modes = yes”I no reconnect for delete-on-close

Michael Adam SMB2+ in Samba (20 / 28)

Page 64: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles - TODOs

Michael Adam SMB2+ in Samba (21 / 28)

Page 65: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Durable Handles - TODOs

I fully implement scavenger mechanism

I delete on close handling

I keep track of write timeI interoperability:

I keep handle open, use fd-passingI create Linux kernel interface

for cookie/disconnect/reconnect

I cluster improvements ...

Michael Adam SMB2+ in Samba (21 / 28)

Page 66: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB3 - Clustering

I SMB 3.0 / Windows 8:I client is fully aware of clusteringI scale out (SO) sharesI continuously available (CA) shares

I Samba:I CTDB all-active clusteringI Windows client is unaware of

clustering

I TODOs (durable/persistent):I node failure/smbd crash?I replay/retryI channel sequence numberI application instance ID

Michael Adam SMB2+ in Samba (22 / 28)

Page 67: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB3 - Clustering

I SMB 3.0 / Windows 8:I client is fully aware of clusteringI scale out (SO) sharesI continuously available (CA) shares

I Samba:I CTDB all-active clusteringI Windows client is unaware of

clustering

I TODOs (durable/persistent):I node failure/smbd crash?I replay/retryI channel sequence numberI application instance ID

Michael Adam SMB2+ in Samba (22 / 28)

Page 68: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB3 - Clustering

I SMB 3.0 / Windows 8:I client is fully aware of clusteringI scale out (SO) sharesI continuously available (CA) shares

I Samba:I CTDB all-active clusteringI Windows client is unaware of

clustering

I TODOs (durable/persistent):I node failure/smbd crash?I replay/retryI channel sequence numberI application instance ID

Michael Adam SMB2+ in Samba (22 / 28)

Page 69: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB3 - Clustering

I SMB 3.0 / Windows 8:I client is fully aware of clusteringI scale out (SO) sharesI continuously available (CA) shares

I Samba:I CTDB all-active clusteringI Windows client is unaware of

clustering

I TODOs (durable/persistent):I node failure/smbd crash?I replay/retryI channel sequence numberI application instance ID

Michael Adam SMB2+ in Samba (22 / 28)

Page 70: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB3 - Persistent Handles

we got:

I Hacked/faked proof of concept

we need:

I really implement CA share (↔ ctdb)

I implement server side of replay/retry

I provide guarantees associated with persistence, e.g.

I store more info, persistently, to survive server reboot

I need kernel interface (cookie) to keep files open

Michael Adam SMB2+ in Samba (23 / 28)

Page 71: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB3 - Persistent Handles

we got:

I Hacked/faked proof of concept

we need:

I really implement CA share (↔ ctdb)

I implement server side of replay/retry

I provide guarantees associated with persistence, e.g.

I store more info, persistently, to survive server reboot

I need kernel interface (cookie) to keep files open

Michael Adam SMB2+ in Samba (23 / 28)

Page 72: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB3 - Persistent Handles

we got:

I Hacked/faked proof of concept

we need:

I really implement CA share (↔ ctdb)

I implement server side of replay/retry

I provide guarantees associated with persistence, e.g.

I store more info, persistently, to survive server reboot

I need kernel interface (cookie) to keep files open

Michael Adam SMB2+ in Samba (23 / 28)

Page 73: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB3 - Multi Channel

I foundation laid in the smbXsrv structures

I will need kernel (cookie) interface to reopen file

I need to implement interface discovery

Michael Adam SMB2+ in Samba (24 / 28)

Page 74: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB3 - Multi Channel

I foundation laid in the smbXsrv structures

I will need kernel (cookie) interface to reopen file

I need to implement interface discovery

Michael Adam SMB2+ in Samba (24 / 28)

Page 75: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB3 - SMB direct (RDMA)

I Research using iwarp started (Metze)

Michael Adam SMB2+ in Samba (25 / 28)

Page 76: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

SMB3 - SMB direct (RDMA)

I Research using iwarp started (Metze)

Michael Adam SMB2+ in Samba (25 / 28)

Page 77: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

What is already working? - DEMO

Michael Adam SMB2+ in Samba (26 / 28)

Page 78: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

What is already working? - DEMO

Michael Adam SMB2+ in Samba (26 / 28)

Page 79: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Summary for Samba 4.0

I Samba 4.0.0rc1 released on 2012-09-13

I Samba 4.0.0 late this year (?!)

I SMB 3.0 as default

I basic durable handle support

I multi credit

I reauthentication

I SMB3 signing/encryption

Michael Adam SMB2+ in Samba (27 / 28)

Page 80: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Summary for Samba 4.0

I Samba 4.0.0rc1 released on 2012-09-13

I Samba 4.0.0 late this year (?!)

I SMB 3.0 as default

I basic durable handle support

I multi credit

I reauthentication

I SMB3 signing/encryption

Michael Adam SMB2+ in Samba (27 / 28)

Page 81: Status of SMB2 and SMB3 development in Samba SDC 2012 › ~obnox › presentations › sdc-2012 › sdc... · Durable Handles And Samba I need to nd old session by session-ID I need

Questions?

Michael Adam SMB2+ in Samba (28 / 28)