cifs geeks in exile - ubiqxubiqx.org/presentations/sambaxp/sambaxp_2011.pdf · ceph – work in...

42
CIFS Geeks in Exile CIFS Geeks in Exile - or - What We Did on our Holiday Christopher R. Hertel Storage Architect, CIFS Geek Founder and CTO SambaXP May, 2011 Copyright 2011, ubiqx ubiqx Consulting, Inc.

Upload: dinhthien

Post on 19-Jul-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

CIFS Geeks in ExileCIFS Geeks in Exile- or -

What We Did on our Holiday

Christopher R. HertelStorage Architect, CIFS GeekFounder and CTO

SambaXPMay, 2011

Copyright 2011, ubiqxubiqx Consulting, Inc.

Page 2: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

IntroductionsIntroductions

2SambaXP 2011

Page 3: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

MeMe

SambaXP 2011

Your Friendly Neighborhood CIFS Geek

CIFS Author

jCIFS project co­founder

Samba Team member since 97/98

Incurable Idealist

Etc., etc., ad nauseam

A ruminant mammal (Geekus geekus) with long legs, humped shoulders, and broadly palmated antlers.

3

Page 4: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

MeMe

SambaXP 2011

Your Friendly Neighborhood CIFS Geek

Tainted!Lead author of theMicrosoft [MS­CIFS] and[MS­SMB] specifications.

Access to MS Internal Information.

Mustn't touch anyone else's CIFSimplementation for one year.

That year is now OVER!

A ruminant mammal (Geekus geekus) with long legs, humped shoulders, and broadly palmated antlers.

4

Page 5: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

What We Did on our HolidayWhat We Did on our Holiday

SambaXP 2011 5

Page 6: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

What We Did on our HolidayWhat We Did on our Holiday

SambaXP 2011 6

This is my report on what we did on our CIFS holiday.

Linux ClustersWorked On GFS2 “virtual clusters”.BITS ProtocolCreated a BITS client toolkit.MS BranchCache™Studied Microsoft's BranchCache™ system.

Page 7: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

LinuxLinuxClustersClusters

7SambaXP 2011

Page 8: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

Linux Clusters with GFS2Linux Clusters with GFS2

SambaXP 2011 8

Why GFS2?

In­kernel cluster file systemRed Hat Cluster Suite

Supported in FedoraLocal (to me)

Originally a U of MN projectI know these geeksEasy to interact

Good “community” choice

...but some Samba Team members have reported difficulties configuring and running GFS2­based clusters.

Page 9: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

Linux Clusters with GFS2Linux Clusters with GFS2

SambaXP 2011 9

There are several other cluster FS options:

Ceph – work in progressGlusterFS – cache consistency issuesMooseFS – untested (to my knowledge)OCFS – similar to GFS

See Wikipedia for a longer list.

Page 10: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

Linux Clusters with GFS2Linux Clusters with GFS2

SambaXP 2011 10

Short Term Goal:

Virtual “Cluster in a Box”Single server testing cluster

Fedora­14KVM/QEMU

Status:The cbox cluster­in­a­box script works

Virtual GFS2 clusters on KVM do notI/O stress causes FS hang

A fix is in the works

Page 11: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

Linux Clusters with GFS2Linux Clusters with GFS2

SambaXP 2011 11

Long Term Goal:

Samba/CTDB/GFS2 HowToDo­it­yourself virtual clusters“Real” hardware clusters

Production clusters running Samba and NFS

Status:3 HowTos, need to be combined into one

RedHat has built working Samba clusters...but has not yet performed extensive testing

Focus is on cbox clusters

Page 12: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

Linux Clusters with GFS2Linux Clusters with GFS2

SambaXP 2011 12

Why Clusters?

FailoverSMB does not handledisconnect/reconnect very well...but SMB2 does

Active/Active load balancingSMB/CIFS/SMB2 is statefulCTDB provides shared state

Scalability

Are there other, better ways to approachthese goals?

Page 13: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

BITSBITS

13SambaXP 2011

Page 14: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

BITS: BITS: Background “Intelligent” Transfer ServiceBackground “Intelligent” Transfer Service

SambaXP 2011 14

“BITS is Earth’s most widely used file transfer service, with more than 600 million unique users across the planet.”

– Vipul Bansal, Microsoft WMI Blog, Jan 2009.

Page 15: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

BITS: BITS: Background “Intelligent” Transfer ServiceBackground “Intelligent” Transfer Service

SambaXP 2011 15

“BITS is Earth’s most widely used file transfer service, with more than 600 million unique users across the planet.”

– Vipul Bansal, Microsoft WMI Blog, Jan 2009.

Note Well:  nobody cares.

Page 16: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

BITS: BITS: Background “Intelligent” Transfer ServiceBackground “Intelligent” Transfer Service

SambaXP 2011 16

What does that mean anyway?

It doesn't say “protocol”,it says “file transfer service”.

BITS is the Windows system service used by Windows Update to download patches.

Most users don't even know it's there.

“BITS is Earth’s most widely used file transfer service, with more than 600 million unique users across the planet.”

– Vipul Bansal, Microsoft WMI Blog, Jan 2009.

Page 17: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

BITS: BITS: Background “Intelligent” Transfer ServiceBackground “Intelligent” Transfer Service

SambaXP 2011 17

BITS Features

Built into WindowsRestartable Transfers

...but only linearly;   does not “patch”.

Both Download and Upload...and “Upload Reply”.

Job priority levelsSenses network traffic to manage impact

Page 18: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

BITS: BITS: Background “Intelligent” Transfer ServiceBackground “Intelligent” Transfer Service

SambaXP 2011 18

BITS Download JobsThe overwhelming majority of BITS jobsare probably Windows Update downloads.

BITS Downloads use HTTP/HTTPS.

Sort of like uucp?wget + batch + nice + diffserv?

The “special sauce” is the use of network traffic monitoring to limit BITS data transfer rates.

Page 19: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

BITS: BITS: Background “Intelligent” Transfer ServiceBackground “Intelligent” Transfer Service

SambaXP 2011 19

BITS Upload JobsMuch less common.

Proprietary extensions to HTTP/HTTPS.

Only between Windows BITS clients and Windows HTTP[S] servers. 

Page 20: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

BITS: BITS: Background “Intelligent” Transfer ServiceBackground “Intelligent” Transfer Service

SambaXP 2011 20

BITS Upload JobsMuch less common.

Proprietary extensions to HTTP/HTTPS.

Only between Windows BITS clients and Windows HTTP[S] servers – Until now!– Until now!

Page 21: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

BITS: BITS: Background “Intelligent” Transfer ServiceBackground “Intelligent” Transfer Service

SambaXP 2011 21

STiB means:Slow Transfer in Background?Silly Technology is Boring?Sipping Tea in Belgium?BITS spelled sdrawkcab with a small ‘i’?

STiB:  It Is what It Is....a toolkit for testing BITS Uploads....example code for others to read / use.

A CGI script could be written toaccept BITS Uploads.

Page 22: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

BITS: BITS: Background “Intelligent” Transfer ServiceBackground “Intelligent” Transfer Service

SambaXP 2011 22

BITS Upload Extensions:HTTP Extension Method: BITS_POSTBITS Packet Types

PingCreate­SessionFragmentCancel­SessionClose­SessionAck

BITS Documentation:

MSDN: BITS Upload ProtocolWSPP: [MC­BUP]

Page 23: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

BITS: BITS: Background “Intelligent” Transfer ServiceBackground “Intelligent” Transfer Service

SambaXP 2011 23

BITS Upload Extensions:HTTP Extension Method: BITS_POSTBITS Packet Types

PingCreate­SessionFragmentCancel­SessionClose­SessionAck

BITS Documentation:

MSDN: BITS Upload ProtocolWSPP: [MC­BUP]

Page 24: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

BITS: BITS: Background “Intelligent” Transfer ServiceBackground “Intelligent” Transfer Service

SambaXP 2011 24

Do we care?Yet Another Windows Protocol

BITS Upload is supported in IIS, and in Microsoft's “lightweight” HTTP server.

It's convenient when working with Windows, but not nearly as powerful as, eg., rsync.

MS­BITS, however, also supports BranchCache™, which suggests some 

very useful testing scenarios.Add “Get” support to STiB,Include the modified header,See what happens!

Page 25: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

26SambaXP 2011

Page 26: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

27SambaXP 2011

Pay Attention!

This is where it finally gets interesting.

Page 27: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

PrequelPrequel

SambaXP 2011 28

What the heck is Prequel?

Page 28: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

PrequelPrequel

SambaXP 2011 29

Prequel : A project to build anOpen Source Implementationof Microsoft's BranchCache™.

So what the heck is BranchCache™?

Page 29: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

PrequelPrequel

SambaXP 2011 30

Prequel : A project to build anOpen Source Implementationof Microsoft's BranchCache™.

BranchCache™ is adistributed content caching system

supported in W2K8 servers,and Windows7 clients.

Cheap, effective WANacceleration for SMB2,HTTP, and BITS.

Page 30: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

PrequelPrequel

SambaXP 2011 31

BranchCache ArchitectureA quick overview

Content ServersHave content to share with multiple clients.

ClientsRequest & receive content from content servers.

The CacheA copy of the original content, cryptographically tagged and divided into segments and blocks.

Page 31: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

PrequelPrequel

SambaXP 2011 32

Content Servers:

Web Servers (HTTP, BITS)File Servers (SMB2)

The client must know to ask for content tags instead of actually content.

If the tags are already calculated, they arereturned by the BranchCache™­enabled server.

Otherwise, the actual content is returned,and the server calculates the tags for next time.

Page 32: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

IE 8 indicates support for BranchCache™ by listing “peerdist” as an acceptable encoding.

Page 33: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

PrequelPrequel

SambaXP 2011 34

Distributed Mode

Page 34: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

PrequelPrequel

SambaXP 2011 35

Distributed Mode

Each client keeps a local cache.A client requests tags from the server, then broadcasts to find the cached content.If the content is not cached,

The client requests the content from the content server,The client stores both content and tags in its own cache.

Reminiscent of the Browse Service.

Page 35: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

PrequelPrequel

SambaXP 2011 36

Hosted Mode

Page 36: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

PrequelPrequel

SambaXP 2011 37

Hosted Mode

A client request tags from the content serverThe client then asks the cache server for the contentIf the content is not cached, the client requests content from the content server

The client sends both content and tags to the cache server

Content can now be retrieved from the cache server using only tags

Page 37: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

PrequelPrequel

SambaXP 2011 38

Content Tags

BlocksAre a unit of download(from either content server or cache server)Are 64K(or less, for the last block in a file only)

The block tag is an SHA hash of the block.

SegmentsAre a unit of discoveryAre 32M == 512 blocks(or less, if the last block is short)

The segment has is an SHA of the included block hashes.

Page 38: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

PrequelPrequel

SambaXP 2011 39

Prequel Goals

I. Content ServerCGI script for Apache that generates correct tags.Server­side code to provide a starting point for Samba implementation.

II. Cache ServerImplement a Hosted Cache server.

III. Peer CacheImplement a stand­alone peer caching client.

Page 39: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:
Page 40: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

41SambaXP 2011

Other StuffOther Stuff

Page 41: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

 

 

CIFS.ORGCIFS.ORG

SambaXP 2011 42

Page 42: CIFS Geeks in Exile - ubiqxubiqx.org/presentations/SambaXP/SambaXP_2011.pdf · Ceph – work in progress ... RedHat has built working Samba clusters ... Impress Presentation Author:

 

 The EndThe End

SambaXP 2011 43