4.1 Registering Notification Changes from the Witness Server

The following diagram demonstrates the steps taken to register and unregister the client to receive notification changes from the server.

Message sequence used to register and unregister for notifications

Figure 2: Message sequence used to register and unregister for notifications

  1. The client sends a WitnessrGetInterfaceList request to the SMB3 Fileserver.

  2. The SMB3 Fileserver returns information about the witness interfaces to which client connections can be made.

     SWN: WitnessrGetInterfaceList Response, ReturnValue=0
          InterfaceList: 
              WitnessInterfaceListPtr: Pointer To 0x00020000
                  ReferentID: 0x00020000
                  WitnessInterfaceList: 
                      NumberOfInterfaces: 2 (0x2)
                      WitnessInterfaceInfoPtr: Pointer To 0x00020004
                          ReferentID: 0x00020004
                      InterfaceInfo: 
                          Size: 2 Elements
                          MaxCount: 2
                      Element: 
                          InterfaceGroupName: NODE02
                          padding: 0 Bytes
                          Version: 4294967295 (0xFFFFFFFF)
                          State: 1 (0x1)
                      padding1: 2 Bytes
                          Padding: Binary Large Object (2 Bytes)
                          IPV4: 192.168.1.22
                          IPV6: 0:0:0:0:0:0:0:0
                      padding2: 0 Bytes
                      Flags: 5 (0x5)
                      Element: 
                          InterfaceGroupName: NODE01
                          padding: 0 Bytes
                          Version: 4294967295 (0xFFFFFFFF)
                          State: 1 (0x1)
                      padding1: 2 Bytes
                          Padding: Binary Large Object (2 Bytes)
                          IPV4: 192.168.1.12
                          IPV6: 0:0:0:0:0:0:0:0
                      padding2: 0 Bytes
                      Flags: 1 (0x1)
         ReturnValue: 0 (0x0)
    
  3. The client selects any one interface from the interface list and sends a WitnessrRegister request to register for resource state change notifications of NetName and IPAddress.

     SWN: WitnessrRegister Request, Version=65537, NetName=generalfs, IpAddress=192.168.1.200, ClientComputerName=CLIENT01.contoso.com
         Version: 65537 (0x10001)
         NetName: generalfs
             Pointer: Pointer To 0x00020000
                 ReferentID: 0x00020000
             stringValue: generalfs
             Length: 10 Elements
                 MaxCount: 10
                 Offset: 0
                 ActualCount: 10
             Array: generalfs
                 ArrayData: generalfs
             IpAddress: 192.168.1.200
                 Pointer: Pointer To 0x00020004
                     ReferentID: 0x00020004
                 stringValue: 192.168.1.200
                     Length: 14 Elements
                     MaxCount: 14
                     Offset: 0
                     ActualCount: 14
                 Array: 192.168.1.200
                 ArrayData: 192.168.1.200
             ClientComputerName: CLIENT01.contoso.com
                   Pointer: Pointer To 0x00020008
                       ReferentID: 0x00020008
                   stringValue: CLIENT01.contoso.com
                   Length: 21 Elements
                   MaxCount: 21
                   Offset: 0
                   ActualCount: 21
                   Array: CLIENT01.contoso.com
                       ArrayData: CLIENT01.contoso.com
    
  4. The Witness server processes the request and returns a context handle that identifies the client on the server.

        SWN: WitnessrRegister Response, Context=0x1, ReturnValue=0
             Context: 0x1
             ContextType: 0 (0x0)
             ContextUuid: {8FC957B7-6C9B-9790-496A-F8A0F2193318}
             ReturnValue: 0 (0x0)
    
  5. The client sends a WitnessrAsyncNotify request to receive asynchronous notifications of registered resource changes from the server.

        SWN: WitnessrAsyncNotify Request, Context=0x1
             Context: 0x1
             ContextType: 0 (0x0)
             ContextUuid: {8FC957B7-6C9B-9790-496A-F8A0F2193318}
    
  6. Whenever there is a state change on the registered resource, the Witness server responds to the client with a WitnessrAsyncNotify response.

          SWN: WitnessrAsyncNotify Response, Resource Change Notification, ReturnValue=0
               Resp: 
                   RespAsyncNotifyPtr: Pointer To 0x00020000
                       ReferentID: 0x00020000
                   RespAsyncNotify: 
                       MessageType: 1 (0x1)
                       Length: 28 (0x1C)
                       NumberOfMessages: 1 (0x1)
                   NotificationPtr: Pointer To 0x00020004, 28 Elements
                       ReferentID: 0x00020004
                       MaxCount: 28
                   Notification: 
                       ResourceChange: 
                           Length: 28 (0x1C)
                           ChangeType: 255 (0xFF)
                           ResourceName: GENERALFS
                   pad: 0 Bytes
                   ReturnValue: 0 (0x0)
    
  7. The client sends a context handle in a WitnessrUnRegister request to unregister for notifications from the Witness server.

        SWN: WitnessrUnRegister Request, Context=0x1
             Context: 0x1
             ContextType: 0 (0x0)
             ContextUuid: {8FC957B7-6C9B-9790-496A-F8A0F2193318}
    
  8. The Witness server processes the requests by removing the entry and no longer notifies the client of resource state changes.

        SWN: WitnessrUnRegister Response, ReturnValue=0
             ReturnValue: 0 (0x0)
    
Show: