TCPM working groupIndependent Submission M. FoxInternet DraftRequest for Comments: 7609 C. KassimisIntended Status:Category: Informational J. StevensExpires: 11/7/2015ISSN: 2070-1721 IBMMay 7,August 2015 IBM's Shared Memory Communications over RDMAdraft-fox-tcpm-shared-memory-rdma-07.txt Status of this Memo(SMC-R) Protocol Abstract ThisInternet-Draft is submitteddocument describes IBM's Shared Memory Communications over RDMA (SMC-R) protocol. This protocol provides Remote Direct Memory Access (RDMA) communications to TCP endpoints infull conformance with the provisionsa manner that is transparent to socket applications. It further provides for dynamic discovery ofBCP 78partner RDMA capabilities andBCP 79. Internet-Draftsdynamic setup of RDMA connections, as well as transparent high availability and load balancing when redundant RDMA network paths areworking documentsavailable. It maintains many of theInternet Engineering Task Force (IETF), its areas, and its working groups. Notetraditional TCP/IP qualities of service such as filtering thatother groups may also distribute working documentsenterprise users demand, asInternet- Drafts. Internet-Drafts are draft documents validwell as TCP socket semantics such as urgent data. Status of This Memo This document is not an Internet Standards Track specification; it is published for informational purposes. This is amaximumcontribution to the RFC Series, independently ofsix monthsany other RFC stream. The RFC Editor has chosen to publish this document at its discretion andmay be updated, replaced,makes no statement about its value for implementation orobsoleteddeployment. Documents approved for publication byother documents atthe RFC Editor are not a candidate for anytime. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The listlevel of Internet Standard; see Section 2 of RFC 5741. Information about the currentInternet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt The liststatus ofInternet-Draft Shadow Directories canthis document, any errata, and how to provide feedback on it may beaccessedobtained athttp://www.ietf.org/shadow.html This Internet-Draft will expire on November 7, 2015.http://www.rfc-editor.org/info/rfc7609. Copyright Notice Copyright (c) 2015 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document.Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Abstract This document describes the IBM's Shared Memory Communications over RDMA (SMC-R) protocol. This protocol provides RDMA communications to TCP endpoints in a manner that is transparent to socket applications. It further provides for dynamic discovery of partner RDMA capabilities and dynamic setup of RDMA connections, transparent high availability and load balancing when redundant RDMA network paths are available, and it maintains many of the traditional TCP/IP qualities of service such as filtering that enterprise users demand, as well as TCP socket semantics such as urgent data.Table of Contents 1.Introduction...................................................5Introduction ....................................................5 1.1.Summary of changes in this draft..........................6 1.2.Protocoloverview.........................................6 1.2.1.Overview ..........................................6 1.1.1. Hardwarerequirements................................8 1.3.Requirements ...............................8 1.2. Definition ofcommon terms................................8Common Terms .................................8 1.3. Conventions Used in This Document .........................11 2. LinkArchitecture.............................................10Architecture ..............................................11 2.1. Remote Memory Buffers(RMBs).............................12(RMBs) ..............................12 2.2. SMC-R Linkgroups........................................16Groups .........................................18 2.2.1. Linkgroup types....................................17Group Types ...................................18 2.2.2. MaximumnumberNumber oflinksLinks inlink group...............20Link Group ..............21 2.2.3. Forming andmanaging link groups....................21Managing Link Groups ...................23 2.2.4. SMC-Rlink identifiers..............................22Link Identifiers .............................24 2.3. SMC-RresilienceResilience andload balancing......................23Load Balancing .......................24 3. SMC-R Rendezvousarchitecture.................................25Architecture ..................................26 3.1. TCPoptions..............................................25Options ...............................................26 3.2. Connection Layer Control (CLC)messages..................26Messages ...................27 3.3. LLCmessages.............................................26Messages ..............................................27 3.4. CDCMessages.............................................28Messages ..............................................29 3.5. Rendezvousflows.........................................28Flows ..........................................29 3.5.1. Firstcontact.......................................28Contact ......................................29 3.5.1.1. Pre-negotiation of TCP Optionspre-negotiation....................28............29 3.5.1.2. ClientProposal................................29Proposal ...........................30 3.5.1.3. Serveracceptance..............................30Acceptance .........................32 3.5.1.4. Clientconfirmation............................31Confirmation .......................32 3.5.1.5. Link (QP)confirmation.........................31Confirmation ....................32 3.5.1.6. Second SMC-Rlink setup........................34Link Setup ...................35 3.5.1.6.1. ClientprocessingProcessing of"Add Link"ADD LINK LLCmessageMessage fromserver..........................................34Server ........35 3.5.1.6.2. ServerprocessingProcessing of"Add Link" replyADD LINK Reply LLCmessageMessage fromthe client..............................35Client ..36 3.5.1.6.3. Exchange ofRkeysRKeys onsecondSecond SMC-Rlink....37Link ..............38 3.5.1.6.4. Aborting SMC-R andfalling backFalling Back toIP.....37IP .............38 3.5.2. Subsequentcontact..................................37Contact .................................38 3.5.2.1. SMC-Rproposal.................................38Proposal ............................39 3.5.2.2. SMC-Racceptance...............................39Acceptance ..........................40 3.5.2.3. SMC-Rconfirmation.............................40Confirmation ........................41 3.5.2.4. TCPdata flow raceData Flow Race with SMC Confirm CLCmessage40Message .......................41 3.5.3. Firstcontact variation: creatingContact Variation: Creating aparallel link group ...........................................................41Parallel Link Group ................................42 3.5.4. Normal SMC-Rlink termination.......................42Link Termination ......................43 3.5.5. Linkgroup management flows.........................43Group Management Flows ........................44 3.5.5.1. Adding anddeleting linksDeleting Links in an SMC-Rlink group43 3.5.5.1.1. Server initiated AddLinkprocessing......43Group ..........................44 3.5.5.1.1. Server-Initiated ADD LINK Processing ................45 3.5.5.1.2.Client initiated Add Link processing......44Client-Initiated ADD LINK Processing ................45 3.5.5.1.3.Server initiated Delete Link Processing...44Server-Initiated DELETE LINK Processing ................46 3.5.5.1.4.Client initiated Delete Link request......46Client-Initiated DELETE LINK Request ...................48 3.5.5.2. Managingmultiple RkeysMultiple RKeys overmultipleMultiple SMC-RlinksLinks in alink group.........................................48Link Group ......49 3.5.5.2.1. Adding anewNew RMB to an SMC-Rlink group...49Link Group ...............50 3.5.5.2.2. Deleting an RMB from an SMC-Rlink group..52Link Group ...............53 3.5.5.2.3. Adding anewNew SMC-RlinkLink to alink groupLink Group withmultiple RMBs........................................53Multiple RMBs ..54 3.5.5.3. Serialization of LLCexchanges,Exchanges, andcollisions.54Collisions ............................56 3.5.5.3.1. Collisions with ADD LINK / CONFIRM LINKexchange.............................................56Exchange ...57 3.5.5.3.2. Collisions during DELETE LINKexchange....57Exchange ...........58 3.5.5.3.3. Collisions duringCONFIRM_RKEY exchange...57CONFIRM RKEY Exchange ..........59 4. SMC-Rmemory sharing architecture.............................59Memory-Sharing Architecture ..............................60 4.1. RMBelement allocation considerations....................59Element Allocation Considerations .....................60 4.2. RMB and RMBEformat......................................59Format .......................................60 4.3. RMBEcontrol information.................................59Control Information ..................................60 4.4. Use ofRMBEs.............................................60RMBEs ..............................................61 4.4.1. Initializing andaccessing RMBEs....................60Accessing RMBEs ...................61 4.4.2. RMBelement reuseElement Reuse andconflict resolution...........61Conflict Resolution ..........62 4.5. SMC-Rprotocol considerations............................62Protocol Considerations .............................63 4.5.1. SMC-Rprotocol optimized window size updates........62Protocol Optimized Window Size Updates .......63 4.5.2. Smalldata sends....................................63Data Sends ...................................64 4.5.3. TCP Keepaliveprocessing............................63Processing ...........................65 4.6. TCPconnection failoverConnection Failover between SMC-Rlinks..............66Links ...............67 4.6.1. Validatingdata integrity...........................66Data Integrity ..........................67 4.6.2. Resuming the TCPconnectionConnection on anew SMCR link......67New SMC-R Link ....68 4.7. RMBdata flows...........................................67Data Flows ............................................69 4.7.1. Scenario 1: Sendflow, window size unconstrained....68Flow, Window Size Unconstrained ...69 4.7.2. Scenario 2: Send/Receiveflow, window unconstrained.70Flow, Window Size Unconstrained ......................................71 4.7.3. Scenario 3: Send Flow,window constrained...........71Window Size Constrained .....72 4.7.4. Scenario 4: Largesend, flow control, full window size writes.....................................................73Send, Flow Control, Full Window Size Writes .................................74 4.7.5. Scenario 5: Sendflow, urgent data, window size unconstrained..............................................76Flow, Urgent Data, Window Size Unconstrained .................................77 4.7.6. Scenario 6: Sendflow, urgent data, window size closed78Flow, Urgent Data, Window Size Closed ........................................79 4.8. Connectiontermination...................................80Termination ....................................81 4.8.1. Normal SMC-Rconnection termination flows...........80 4.8.1.1.Connection Termination Flows ..........81 4.8.2. Abnormal SMC-Rconnection termination flows....85 4.8.1.2.Connection Termination Flows ........86 4.8.3. Other SMC-Rconnection termination conditions..87Connection Termination Conditions ......88 5. Securityconsiderations.......................................88Considerations ........................................89 5.1. VLANconsiderations......................................88Considerations .......................................89 5.2. Firewallconsiderations..................................88Considerations ...................................89 5.3.Host-basedHost-Based IPFilters....................................89Filters .....................................89 5.4. Intrusion DetectionServices.............................89Services ..............................90 5.5. IP Security(IPSec)......................................89(IPsec) .......................................90 5.6.TLS/SSL..................................................89TLS/SSL ...................................................90 6. IANAconsiderations...........................................89Considerations ............................................90 7.References....................................................90 7.1.NormativeReferences.....................................90 7.2. Informative References...................................90 8. Acknowledgments...............................................90 9. Conventions used in this document.............................90References ...........................................91 Appendix A.Formats..............................................91Formats ...............................................92 A.1. TCPoption...............................................91Option .................................................92 A.2. CLCmessages.............................................91Messages ...............................................92 A.2.1. Peer IDformat......................................91Format ......................................93 A.2.2. SMC Proposal CLCmessage format.....................93Message Format .....................94 A.2.3. SMC Accept CLCmessage format.......................96Message Format .......................98 A.2.4. SMC Confirm CLCmessage format......................99Message Format .....................102 A.2.5. SMC Decline CLCmessage format.....................102Message Format .....................105 A.3. LLCmessages............................................103Messages ..............................................106 A.3.1. CONFIRM LINK LLCmessage format....................104Message Format ....................107 A.3.2. ADD LINK LLCmessage format........................106Message Format ........................109 A.3.3. ADD LINK CONTINUATION LLCmessage format...........108Message Format ...........112 A.3.4. DELETE LINK LLCmessage format.....................111Message Format .....................115 A.3.5. CONFIRM RKEY LLCmessage format....................113Message Format ....................117 A.3.6. CONFIRM RKEY CONTINUATION LLCmessage format.......116Message Format .......120 A.3.7. DELETE RKEY LLCmessage format.....................118Message Format .....................122 A.3.8. TEST LINK LLCmessage format.......................120Message Format .......................124 A.4. Connection Data Control (CDC) Message Format ..............125 Appendix B. Socket APIconsiderations...........................126Considerations ............................129 B.1. setsockopt() / getsockopt() Considerations ................130 Appendix C. Rendezvous Errorscenarios..........................128Scenarios ...........................131 C.1. SMC Decline during CLCnegotiation......................128Negotiation ........................131 C.2. SMC Decline during LLCnegotiation......................128Negotiation ........................131 C.3. The SMC Declinewindow..................................130Window ....................................133 C.4.Out of synch conditionsOut-of-Sync Conditions during SMC-Rnegotiation........130Negotiation ...........133 C.5. Timeouts during CLCnegotiation.........................131Negotiation ...........................134 C.6. ProtocolerrorsErrors during CLCnegotiation..................131Negotiation ....................134 C.7. Timeouts during LLCnegotiation.........................132Negotiation ...........................135 C.7.1. RecoveryactionsActions for LLCtimeoutsTimeouts andfailures.....133Failures .....136 C.8. Failure toadd secondAdd Second SMC-RlinkLink to alink group........140Link Group ..........142 Authors' Addresses ...............................................143 1. Introduction This documentspecificiesspecifies IBM's Shared Memory Communications over RDMA (SMC-R) protocol. SMC-R is a protocol for Remote Direct Memory Access (RDMA) communication between TCP socket endpoints. SMC-R runs over networks that support RDMA over Converged Ethernet(ROCE).(RoCE). It is designed to permit existing TCP applications to benefit from RDMA without requiring modifications to the applications or predefinition of RDMA partners. SMC-R provides dynamic discovery of the RDMA capabilities of TCP peers and automatic setup of RDMA connections that those peers can use. SMC-R also provides transparent high availability andload balancingload-balancing capabilities that are demanded by enterprise installations but are missing from current RDMA protocols. If redundantRoCE capableRoCE-capable hardware such asRDMA NICs (RNICs)and RoCE capableRDMA-capable Network Interface Cards (RNICs) and RoCE-capable switches is present, SMC-R canload balanceload-balance over that redundant hardware and can also non-disruptively move TCP traffic from failed paths to surviving paths, all seamlessly to the application and the sockets layer. Because SMC-R preserves socket semantics and the TCP three-way handshake, many TCP qualities of service such as filtering, load balancing, andSSLSecure Socket Layer (SSL) encryption are preserved, as are TCP features such as urgent data. Because of the dynamic discovery and setup of SMC-R connectivity between peers, no RDMA connection manager (RDMA-CM) is required. This also means that support forUD queue pairsUnreliable Datagram (UD) Queue Pairs (QPs) is also not required. It is recommended that the SMC-R services be implemented in kernel space, which enables optimizations such asresource sharingresource-sharing between connections across multiple processes and also permits applications using SMC-R to spawn multiple processes(e.g.(e.g., fork) without losing SMC-R functionality. Auser spaceuser-space implementation is compatible with this architecture, but it may not support spawned processes(i.e. fork)(e.g., fork), which limits sharing and resource optimization to TCP connections that originate from the same process. This might be an appropriate design choice if the use case is a system that hosts a large single process application that creates many TCP connections to a peer host, or in implementations where akernel spacekernel-space implementation is not possible or introduces excessive overhead forkernel"kernel space to userspacespace" context switches. 1.1.Summary of changes in this draft Changed the title to add "IBM's". 1.2.ProtocoloverviewOverview SMC-R defines the concept of the SMC-RLink,link, which is a logical point-to-point link using reliably connected queue pairs between TCP/IP stack peers over a RoCE fabric. An SMC-R link is bound to a specific hardware path, meaning a specific RNIC on each peer. SMC-R links are created and maintained by an SMC-R layer, which may reside in kernel space or userspacespace, depending upon operating system and implementation requirements. The SMC-R layer resides below the sockets layer and directs data traffic for TCP connections between connected peers over the RoCE fabric using RDMA rather than over a TCP connection. The TCP/IPstackstack, with its requirements for fragmentation, packetization,etc. requirementsetc., isbypassedbypassed, and the application data is moved between peers using RDMA. Multiple SMC-R links between the same two TCP/IP stack peers are also supported. A set of SMC-R links called a link group can be logically bonded together to provide redundant connectivity. If there is redundanthardware,hardware -- forexampleexample, two RNICs on eachpeer,peer -- separateSMC- RSMC-R links are created between the peers to exploit that redundant hardware. The link group architecture with redundant linksprovideprovides loadbalancing,balancing and increasedbandwidthbandwidth, as well as seamless failover. Each SMC-R link group is associated with an area of memory called Remote Memory Buffers (RMBs), which are areas of memory that are available for SMC-R peers to write into using RDMA writes. Multiple TCP connections between peers may be multiplexed over a single SMC-R link, in which case the SMC-R layer manages the partitioning of the RMBs between the TCP connections. This multiplexing reduces the RDMAresourcesresources, such asqueue pairsQPs andRMBsRMBs, that are required to support multiple connections between peers, and it also reduces the processing and delays related to setting upqueue pairs,QPs, pinning memory, and other RDMA setup tasks when new TCP connections are created. In akernel spacekernel-space SMC-R implementation in which the RMBs reside in kernel storage, this sharing and optimization works across multiple processes executing on the same host. In auser spaceuser-space SMC-R implementation in which the RMBs reside in user space, this sharing and optimization is limited to multiple TCP connections created by a single process, as separate RMBs and QPs will be required for each process. SMC-R also introduces a rendezvous protocol that is used to dynamically discover the RDMA capabilities of TCP connection partners and exchange credentials necessary to exploit that capability if present. TCP connections are set up using the normal TCP3-way handshake,three-way handshake [RFC793], with the addition of a new TCP option that indicates SMC-R capability. If both partners indicate SMC-Rcapabilitycapability, then at the completion of the3-waythree-way TCP handshake the SMC-R layers in each peer take control of the TCP connection and use it to exchange additionalconnection level controlConnection Layer Control (CLC) messages to negotiate SMC-R credentials such asqueue pair (QP) information,QP information; addressability over the RoCEfabric,fabric; RMB buffersizes,sizes; and keys and addresses for accessing RMBs overRDMA, etc.RDMA. If at any time during this negotiation a failure or decline occurs, the TCP connection falls back to using the IP fabric. If the SMC-R negotiation succeeds and either a new SMC-R link is set up or an existing SMC-R link is chosen for the TCP connection, then the SMC-R layers open the sockets to the applications and the applications use the sockets as normal. The SMC-R layer intercepts the socket reads and writes and moves the TCP connection data over the SMC-R link, "out of band" to the TCPconnectionconnection, which remains open and idle over the IP fabric, except for termination flows and possible keepalive flows. Regular TCP sequence numbering methods are used for the TCP flows that do occur; data flowing over RDMA does not use or affect TCP sequence numbers. This architecture does not support fallback of active SMC-R connections to IP. Once connection data has completed the switch to RDMA, a TCP connection cannot be switched back to IP and will reset if RDMA becomes unusable. The SMC-R protocol defines the format of theRemote Memory BuffersRMBs that are used to receive TCP connection data written over RDMA, as well as the semantics for managing and writing to these buffers using Connection Data Control (CDC) messages. Finally, SMC-R defineslink level controlLink Layer Control (LLC) messages that are exchanged over the RoCE fabric between peer SMC-R layers to manage the SMC-R links and link groups. These include messages to test and confirm connectivity over an SMC-R link, add and delete SMC-R links to or from the link group, and exchange RMB addressability information.1.2.1.1.1.1. HardwarerequirementsRequirements SMC-R does not require full Converged Enhanced Ethernet switch functionality. SMC-R functions over standard Ethernetfabricsfabrics, provided that endpoint RNICs are provided and IEEE 802.3x Global Pause Frame is supported and enabled in the switch fabric. While SMC-R as specified in this document is designed to operate over RoCE fabrics, adjustments to the rendezvous methods could enable it to run over other RDMAfabricsfabrics, such asInfinibandInfiniBand [RoCE] and iWARP.1.3.1.2. Definition ofcommon termsCommon Terms This section provides definitions of terms that have a specific meaning to the SMC-R protocol and are used throughout this document. SMC-RlinkLink An SMC-RLinklink is a logicalpoint to pointpoint-to-point connection over the RoCE fabric via specific physical adapters(MAC/GID).(Media Access Control / Global Identifier (MAC/GID)). TheLinklink is formed during thefirst contact"first contact" sequence of the TCP/IP3 waythree-way handshake sequence that occurs over the IP fabric. During thishandshakehandshake, an RDMARC-QPreliably connected queue pair (RC-QP) connection is formed between the two peer SMC hosts and is defined as theSMC Link.SMC-R link. TheSMC LinkSMC-R link can then support multiple TCP connections between the two peers. AnSMCSMC-R link is associated with a single LAN (or VLAN) segment and is not routable. SMC-Rlink group An SMC-RLink Group An SMC-R link group is a group of SMC-RLinks typically each over unique RoCE adapterslinks between the same two SMC-Rpeers.peers, typically with each link over unique RoCE adapters. Each link in the link group has equalcharacteristicscharacteristics, such as the same VLAN ID (if VLANs are in use), access to the sameRMB(s)RMB(s), and access to the same TCPserver / clientserver/client. SMC-RpeerPeer The SMC-RPeerpeer is the peer software stack within the peerOperating Systemoperating system with respect to the Shared Memory Communications (messaging) protocol. SMC-R RendezvousTheSMC-R Rendezvous is the SMC-R peer discovery and handshake sequence that occurs transparently over the IP (Ethernet) fabric during and immediately after the TCP connection3 waythree-way handshake by exchanging theSMCSMC-R capabilities and credentials using experimental TCP option and CLC messages. RoCE SendMsg RoCE SendMsg is a send operation posted to a reliably connected queue pair with inline data, for the purpose of transferring control information between peers. TCP Client The TCP client is the TCP socket-based peer that initiates a TCPconnectionconnection. TCP Server The TCP server is the TCP socket-based peer that accepts a TCPconnectionconnection. CLCmessagesMessages The SMC-R protocol defines a set of Connection Layer ControlMessagesmessages that flow over the TCP connection that are used to manageSMCSMC-R link rendezvous at TCP connection setup time. This mechanism is analogous to SSL setupmessagesmessages. LLC Commands The SMC-R protocol defines a set of RoCE Link Layer ControlCommandscommands that flow over the RoCE fabric usingRDMA sendmsg,RoCE SendMsg, that are used to manageSMC Links, SMC Link GroupsSMC-R links, SMC-R link groups, andSMC Link GroupSMC-R link group RMB expansion and contraction. CDCmessageMessage The SMC-R protocol defines a Connection Data Control message that flows over the RoCE fabric usingRDMA sendmsgRoCE SendMsg that is used to manage the SMC-R connection data. This message provides information about data being transferred over theout of bandout-of-band RDMA connection, such as data cursors, sequence numbers, and data flags (forexampleexample, urgent data). The receipt of this message also provides an interrupt to inform the receiver that it has received RDMA data. RMB A Remote (RDMA) Memory Buffer is a fixed or pinned buffer allocated in each of the peer hosts for a TCP (via SMC-R) connection. The RMB is registered to the RNIC and allows remote access by the remote peer using RDMA semantics. Each host is passed the peer'sRMB specificRMB-specific access information(RKey(RMB Key (RKey) and RMBElementelement offset) during the SMC-RrendezvousRendezvous process. The host stores socket application user data directly into the peer's RMB using RDMA over RoCE.RtokenRToken The RToken is the combination of an RMB'sRkeyRKey and RDMA virtualaddressing, an Rtokenaddress. An RToken providesaddressability to anRMB addressability information to an RDMApeerpeer. RMBE The Remote Memory Buffer Element (RMBE) is an area of an RMB that is allocated to a specific TCP connection. The RMBE contains data for the TCP connection. The RMBE represents the TCP receivebufferbuffer, whereby the remote peer writes into the RMBE and the local peer reads from the local RMBE. The alert token resolves to a specific RMBE. Alert Token The SMC-R alert token is afour byte4-byte value that uniquely identifies the TCP connection over an SMC-R connection. The alert token allows the SMC peer to quickly identify the target TCP connection that now has new work. The format of the token is defined by the owning SMC-Rend pointendpoint and is considered opaque to the remote peer.HoweverHowever, the token should not simply be an index to anRMBE element;RMBE; it should reference a TCP connection and be able to be validated to avoid reading data from stale connections. RNIC TheRDMA capableRDMA-capable Network Interface Card (RNIC) is an Ethernet NIC that supports RDMA semantics and verbs using RoCE. First ContactDescribes"First contact" describes an SMC-R negotiation to set up the first link in a linkgroupgroup. Subsequent ContactDescribes"Subsequent contact" describes an SMC-R negotiation between peers who are using analready existingalready-existing SMC-R linkgroupgroup. 1.3. Conventions Used in This Document In the rendezvous flow diagrams, dashed lines (----) are used to indicate flows over the TCP/IP fabric and dotted lines (....) are used to indicate flows over the RoCE fabric. In the data transfer ladder diagrams, dashed lines (----) are used to indicate RDMA write operations and dotted lines (....) are used to indicate CDC messages, which are RDMA messages with inline data that contain control information for the connection. 2. Link Architecture An SMC-R link is based on reliably connected queue pairs (QPs) that form a "logicalpoint to pointpoint-to-point link" between the two SMC-R peers over a RoCE fabric. An SMC-R link extends from SMC-R peer to SMC-R peer, where typically each peer would be a TCP/IP stack and would reside on separate hosts. ,,.--..,_ +----+ _-`` `-, +-----+ |QP 8| - RoCE ', |QP 64| | | / VLAN M . | | +----+--------+/ \+-------+-----+ | RNIC 1 | SMC-R Link | RNIC 2 | | |<--------------------->| | +------------+ , /+------------+ MAC A (GID A) MAC B (GID B) . .` `', ,-` ``''--''`` Figure11: SMC-R Link Overview Figure 1 illustrates an overview of the basic concepts of SMC-Rpeer to peer connectivity whichpeer- to-peer connectivity; this is called the SMC-RLink.link. The SMC-RLinklink forms a logicalpoint to pointpoint-to-point connection between two SMC-R peers via RoCE. TheSMC LinkSMC-R link is defined and identified by the following attributes: SMC-RLinklink = RC QPs (source VMAC GID QP + target VMAC GID QP + VLAN ID) The SMC-RLinklink can optionally be associated with a VLAN ID. If VLANs are in use for the associated IP (LAN)connectionconnection, then the VLAN attribute is carried over on the SMC-R link. When VLANs are inuseuse, each SMC-R link group is associated with a single and specific VLAN. The RoCE fabric is the same physical Ethernet LAN used for standardTCP/IP over EthernetTCP/IP-over-Ethernet communications, with switches as described in1.2.1.Section 1.1.1. An SMC-RLinklink is designed to support multiple TCP connections between the same two peers. AnSMC LinkSMC-R link is intended to be longlivedlived, while the underlying TCP connections can dynamically come and go. The associated RMBs can also be dynamically added and removed from the link as needed. The first TCP connection between the peers establishes the SMC-R link. Subsequent TCP connections then use the previously established link. When the last TCP connectionterminatesterminates, the link can then be terminated, typically after animplementation definedimplementation-defined idletime-outtimeout period has elapsed. The TCP server is responsible for initiating and terminating theSMC Link.SMC-R link. 2.1. Remote Memory Buffers (RMBs) Figure 2 shows the hosts -- Hosts X and Y -- and their associated RMBs within each host. With the SMC-Rlinklink, and the associatedRMB keys (Rkeys)andRKeys and RDMA virtualaddressesaddresses, eachSMC-R enabledSMC-R-enabled TCP/IP stack can remotely access its peer's RMBs using RDMA. The RKeys and virtual addresses are exchanged during the rendezvous processing when the link is established. The combination of theRkeyRKey and the virtual address is theRtoken.RToken. Note that the SMC-RLinklink ends at the QP providing access to the RMB (via theLinklink + RToken). Host X Host Y +-------------------+ ,.--.,_ +-------------------+ | | .'` '. | | | Protection | ,' `, | Protection | | Domain X | / \ | Domain Y | | +------+ / \ +------+ | | QP 8 |RNIC 1| | SMC-R Link | |RNIC 2| QP 64 | | | | |<-------------------->| | | | | | | || || | | | | | +------+| VLAN A |+------+ | | | | || || | | | | | | RoCE | | | | ||RTokenX)|RToken X | \ / |RToken(Y)|Y | | | | | \ / | | | | V | `. ,' | V | | +--------+ | '._ ,' | +--------+ | | | | | `''-'`` | | | | | | RMB | | | | RMB | | | | | | | | | | | +--------+ | | +--------+ | +-------------------+ +-------------------+ Figure2 SMC link2: SMC-R Link and RMBs An SMC-R link can support multiple RMBswhichthat are independently managed by each peer. The numberofand the size of RMBs are managed by the peers based onhostthe host's unique memory management requirements;howeverhowever, the maximum number of RMBs that can be associated to a link group on one peer is 255. The QP has a single protection domain, but each RMB has a unique RToken. All RTokens must be exchanged with the peer. Each peer manages the RMBs in its local memory for its remote SMC-R peer by sharing access to the RMBs viaRtokensRTokens with its peers. The remote peer writes into the RMBs viaRDMARDMA, and the local peer (RMB owner) then reads from the RMBs. When two peers decide to use SMC-R for a given TCP connection, they each allocate a local RMBElementelement for the TCP connection and communicate the location of this local RMBElementelement during rendezvous processing. To that end, RMB elements are created in pairs, with one RMB element allocated locally on each peer of the SMC-R link. ---+-----------+----------------++------------+---------------+ /\|Eyecatcher|Eye Catcher | | |+-----------++------------+ | | | | RMB Element 1 | | | | Receive Buffer | | | | | | | \/ | | ---+-----------+----------------++------------+---------------+ /\|Eyecatcher|Eye Catcher | | |+-----------++------------+ | | | | RMB Element 2 | | | | Receive Buffer | | | | | | | \/ | | --- +----------------------------+ | . | | . | | . | | . | | (up to 255 elements) | +----------------------------+ Figure33: RMB Format Figure 3 illustrates the basic format of an RMB. The RMB is a virtual memory buffer whose backing real memory is pinned, which can support up to 255 TCP connections to exactly one remote SMC-R peer. Each RMB is therefore associated with the SMC-R links within a link group for the two peers and a specific RoCE Protection Domain. Other than the2two peers identified by the SMC-Rlinklink, no other SMC-R peers can have RDMA access to an RMB; this requires a unique Protection Domain for every SMC-RLink.link. This is critical to ensure integrity of SMC-R communications. RMBs are subdivided into multiple elements for efficiency, with eachRMBE elementRMB Element (RMBE)isassociated with a single TCP connection.ThereforeTherefore, multiple TCP connections across anSMCSMC-R link group can share the same memory for RDMA purposes, reducing the overhead of having to register additional memory with the RNIC for every new TCP connection. The number of elements in an RMB and the size of eachRMB Element isRMBE are entirely governed by the owningpeerpeer, subject to the SMC-R architecturerules,rules; however, all RMB elements within a given RMB must be the same size. Each peer can decide the level ofresource sharingresource-sharing that is desirable across TCP connections based on localconstraintsconstraints, such as available systemmemory, etc.memory. An RMBElementelement is identified to the remote SMC-R peer via an RMB ElementTokenToken, which consists of the following: o RMB RToken: The combination of theRkeyRKey and virtual address provided by the RNIC that identifies the start of the RMB for RDMA operations. o RMB Index: Identifies the RMB element index in the RMB. Used to locate a specific RMB element within an RMB. Valid value range is 1-255. o RMBelement length:Element Length: The length of the RMB element'seyecatchereye catcher plus the length of the receive buffer. This length is equal for all RMB elements in a given RMB. This length can be variable across different RMBs. Multiple RMBs can be associated to an SMC-R linkgroupgroup, and each peer in an SMC-R link group manages allocation of its RMBs. RMB allocation can be asymmetric. For example,serverServer X can allocate2two RMBs to an SMC-R link group whileserverServer Y allocates5.five. This provides maximum implementation flexibility to allow hosts to optimize RMB management for their own local requirements. The maximum number of RMBs that can be allocated on one peer to a link group is 255. If more RMBs are required, the peer may fall back to IP for subsequent connections or, if the peer is the server, create a parallel link group. One use case for multiple RMBs is multiple receive buffer sizes. Since every element in an RMB must be the same size, multiple RMBs with different element sizes can be allocated if varying receive buffer sizes are required.AlsoAlso, since the maximum number of TCP connections whose receive buffers can be allocated to an RMB is 255, multiple RMBs may be required to provide capacity for large numbers of TCP connections between two peers. Separately from the RMB, the TCP/IP stack that owns each RMB maintains control data for each RMB element within its local control structures. The control data contains flags for maintaining the state of the TCP data (for example, urgent data indicator)andand, most importantly, the following twocursorscursors, which are illustrated below in Figure 4: o The peer producer cursor: This is a wrapping offset into the RMB element's receive buffer that points to the next byte of data to be written by the remote peer. This cursor is provided by the remote peer in a Connection Data Control(CDC message),(CDC) message, which is sent usingRDMA sendmsgRoCE SendMsg processing, and tells the local peer how far it can consume data in the RMBE buffer. o The peer consumer cursor: This is a wrapping offset into the remote peer's RMB element's receive buffer that points to the next byte of data to be consumed by the remote peer in its own RMBE. The local peer cannot write into the remote peer's RMBE beyond this point without causing data loss. This cursor is also provided by the peer using a Connection Data Control message. Each TCP connection peer maintains its cursors for a TCP connection's RMBE in its local control structures. In other words, the peer who writes into a remote peer's RMBE provides its producer cursor to the peer whose RMBE it has written into. The peer who reads from its RMBE provides its consumer cursor to the writing peer. In thismannermanner, the reads and writes between peers are kept coordinated. For example, referring to Figure 4,peerPeer B writes the hashed data into the receive buffer ofpeerPeer A's RMBE. After that write completes,peerPeer B uses a CDC message to update its producer cursor topeerPeer A, to indicate topeerPeer A how much data is available forpeerPeer A to consume. The CDC message thatpeerPeer B sends topeerPeer A wakes uppeerPeer A and notifies it that there is data to be consumed. Similarly, whenpeerPeer A consumes data written bypeerPeer B, it uses a CDC message to update its consumer cursor topeerPeer B to letpeerPeer B know how much data it has consumed, sopeerPeer B knows how much space is available for further writes. IfpeerPeer B were to write enough data topeerPeer A that it would wrap the RMBE receive buffer and exceed the consumer cursor, data loss would result. Note that this is a simplistic description of the controlflowsflows, and they are optimized to minimize the number of CDC messages required, as described in4.7. RMB data flows.Section 4.7 ("RMB Data Flows"). Peer A's RMBE Control Info Peer B's RMBE Control Info +--------------------------+ +--------------------------+ | | | | /----Peer producer cursor | +-----+-Peer consumer cursor | /| | | | | | +--------------------------+ | +--------------------------+ | Peer A's RMBE | | +--------------------------+ | | | +------------------+ | | | | | | \/ | | | +------------| | |-------------+/////////// | ||//RMA|//RDMA data written by/// |///| | |///peerPeer B that is ////// | | |/available to be consumed/| | |///////////////////////// | | |///////// +---------------| | |----------+/\ | | | | | \| | | \ / | |\---------/ | | | | | Figure44: RMBEcursorsCursors Additional flags and indicators are communicated between peers. In all cases, these flags and indicators are updated by the peer using CDCmessages with the control information contained in inline data.messages, which are sent using RoCE SendMsg. More details on these additional flags and indicators are described in. 4.3. RMBE control information.Section 4.3 ("RMBE Control Information"). 2.2. SMC-R LinkgroupsGroups SMC-R links are logically grouped together to form an SMC-RLink Group.link group. The purpose of theLink Grouplink group is for supporting multiple links between the same two peers to provide for: o Resilience: Provides transparent and dynamic switching of the link used by existing TCP connections during link failures, typically hardware related. TCP traffic using the failing link can be switched to an active link within the linkgroupgroup, thereby avoiding disruptions to application workloads. o Link utilization: Provides an active/active link usage model allowing TCP traffic to be balanced across the links, which increases bandwidth and also avoids hardware imbalances and bottlenecks. Note that both adapter and switch utilization can become potential resource constraintissuesissues. SMC-RLink Grouplink group support is required. Resilience is not optional. However, the user can elect to provision a single RNIC (on one or both hosts). Multiple links that are formed between the same two peers fall into two distinct categories: 1. Equal Links: Links providing equal access to the same RMB(s) at bothendpointsendpoints, whereby all TCP connections associated with the links must have the same VLAN ID and have the same TCP server and TCP client roles or relationship. 2. Unequal Links: Links providing access to unique, unrelated and isolated RMB(s)(i.e.(i.e., for unique VLANs or unique and isolated application workloads, etc.) orhavehaving unique TCP server or client roles. Links that are logically grouped together forming anSMC Link GroupSMC-R link group must be equal links. 2.2.1. Linkgroup typesGroup Types Equal links within a link group also have another "Link Group Type" attribute based on the link's associated underlying physical path. The following SMC-R link types are defined: 1. SingleLink:link: the only active link within a link group 2. ParallelLink:link: not allowed- SMC Links-- SMC-R links having the same physical RNIC at both hosts 3. AsymmetricLink:link: links that have unique RNIC adapters at one host but share a single adapter at the peer host 4. SymmetricLink:link: links that have unique RNIC adapters at both hosts These link group types are further explained in the following figures and descriptions. Figure 2 above shows thesingle linksingle-link case. The single link illustrated in Figure 2 also establishes the SMC-RLink Group.link group. Link groups are supposed to have multiple links, but when only one RNIC is available at both hosts then only a single link can be created. This is expected to be a transient case. Figure 5 shows thesymmetric linksymmetric-link case. Both hosts have unique and redundant RNIC adapters. This configuration meets the objectives for providing full RoCE redundancy required to provide the level of resilience required for high availability for SMC-R. While this configuration is not required, it is a strongly recommended "best practice" for the exploitation of SMC-R. Single and asymmetric links must be supported but are intended to provide forshort termshort-term transientconditions,conditions -- forexampleexample, during a temporary outage or recycle ofaan RNIC. Host X Host Y +-------------------+ +-------------------+ | | | | | Protection | | Protection | | Domain X | | Domain Y | | +------+ +------+ | | QP 8 |RNIC 1| SMC-R Link 1 |RNIC 2| QP 64 | |RToken X| | |<-------------------->| | | | | | | | | | |RToken Y| | \/ +------+ +------+ \/ | |+--------+ | | +--------+ | || | | | | | | || RMB | | | | RMB | | || | | | | | | |+--------+ | | +--------+ | | /\ +------+ +------+ /\ | |RToken Z| | | SMC-R Link 2 | | |RToken W| | | |RNIC 3|<-------------------->|RNIC 4| | | | QP 9 | | | | QP 65 | | +------+ +------+ | +-------------------+ +-------------------+ Figure55: Symmetric SMC-RlinksLinks Host X Host Y +-------------------+ +-------------------+ | | | | | Protection | | Protection | | Domain X | | Domain Y | | +------+ +------+ | | QP 8 |RNIC 1| SMC-R Link 1 |RNIC 2| QP 64 | |RToken X| | |<-------------------->| | | | | | | | .->| | |RToken Y| | \/ +------+ .` +------+ \/ | |+--------+ | .` | +--------+ | || | | .` | | | | || RMB | | .` | | RMB | | || | | .`SMC-R | | | | |+--------+ | .` Link 2 | +--------+ | | /\ +------+ .` +------+ ||Rtoken|RToken Z| | | .` | |down or | | | |RNIC 3|<-` |RNIC 4|unavailable | | QP 9 | | | | | | +------+ +------+ | +-------------------+ +-------------------+ Figure66: Asymmetric SMC-RlinksLinks In the example provided by Figure 6,hostHost X has two RNICs but Host Y only has oneRNIC.RNIC because RNIC 4 is not available. This configuration allows for the creation of an asymmetric link. While an asymmetric link will provide some resilience(i.e.(for example, when RNIC 1fails)fails), ideally each host should provide two redundant RNICs. This should be a transient case, and when RNIC 4 becomes available, this configuration must transition to asymmetric linksymmetric-link configuration. This transition is accomplished by first creating the new symmetriclink,link and then deleting the asymmetric link with reason code "Asymmetric link no longer needed" specified in the DELETE LINK LLC message. Host X Host Y +-------------------+ +-------------------+ | | | | | Protection | | Protection | | Domain X | | Domain Y | | +------+ SMC-RlinkLink 1 +------+ | | QP 8 |RNIC 1|<-------------------->|RNIC 2| QP 64 | |RToken X| | | | | | | | | | |<-------------------->| ||Rtoken|RToken Y| | \/ +------+ SMC-RlinkLink 2 +------+ \/ | |+--------+ QP 9 | | QP 65 +--------+ | || | | | | | | | | || RMB |<-- + | | +---->| RMB | | || | | | | | | |+--------+ | | +--------+ | | +------+ +------+ | | down or| | | |down or | |unavailale|RNICunavailable|RNIC 3| |RNIC 4|unavailable | | | | | | | | +------+ +------+ | +-------------------+ +-------------------+ Figure77: SMC-Rparallel links (not supported)Parallel Links (Not Supported) Figure 7 shows parallel links, which are two links in the link group that use the same hardware. This configuration is not permitted. Because SMC-R multiplexes multiple TCP connections over an SMC-R link and both links are using the exact same hardware, there is no additional redundancy or capacity benefit obtained from this configuration.HoweverIn addition to providing no real benefit, this configurationdoes addadds the unnecessary overhead of additional queue pairs, generation of additionalRkeys,RKeys, etc. 2.2.2. MaximumnumberNumber oflinksLinks inlink groupLink Group The SMC-R protocol defines a maximum of8eight symmetric SMC-R links within a single SMC-R link group. This allows for support for up to8eight unique physical paths between peer hosts. However, in terms of meeting the basic requirements forredundancyredundancy, support for at least2two symmetric links must be implemented. Supportinggreatermore than2two links also simplifies implementation for practical matters relating to dynamically adding and removinglinks,links -- forexampleexample, starting a third SMC-R link prior to taking down one of the two existing links. Recall that all links within a link group must have equal access to all associated RMBs. The SMC-R protocol allows an implementation toimplementassign animplementation specificimplementation-specific and appropriate value for maximum symmetric links. The implementation value must not exceed the architecture limit of8 and8; also, theimplementationvalue must not be lower than 2, because the SMC-R protocol requires redundancy. This does not mean that two RNICs are physically required to enable SMC-R connectivity, but at least two RNICs for redundancy are strongly recommended. The SMC-R peers exchange their implementation maximum link values during the link group establishment using the defined maximum link value in the CONFIRM LINK LLC command. Once the initial exchangecompletescompletes, the value is set for the life of the link group. The maximum link value can be provided by both the server and client. The server must supply a value, whereas the client maximum link value is optional. When the client does not supply a value, it indicates that the client accepts theserver suppliedserver-supplied maximum value. If the client provides avaluevalue, itcan notcannot exceed theserverserver-supplied maximum value. If the client passes a lowervalue thenvalue, this lower value then becomes the final negotiated maximum number of symmetric links for this link group. Again, the minimum value is 2. During runtimetime, the client must never request that the server add a symmetric link to a link group that would exceed the negotiated maximum link value.LikewiseLikewise, the server must never attempt to add a symmetric link to a link group that would exceed the negotiated maximum value. In terms of counting the number of activelink countlinks within a link group, the initial link (or theonly / last)only/last) link is always counted as 1.ThenThen, as additional links areaddedadded, they are either symmetric or asymmetric links. With regards to enforcing the maximum link rules, asymmetric links are an exception having a unique set of rules: o Asymmetric links are always limited to one asymmetric link allowed per linkgroupgroup. o Asymmetric links must not be counted in the maximumsymmetric linksymmetric-link count calculation. When tracking the current count or enforcing the negotiated maximum number of links, an asymmetric link is not to becountedcounted. 2.2.3. Forming andmanaging link groupsManaging Link Groups SMC-R link groups are self-defining. The first SMC-R link in a link group is created using TCP option flows on the TCP three-way handshake followed by CLC message flows over the TCP connection. Subsequent SMC-R links in the link group are created by sending LLC messages over an SMC-R link that already exists in the link group. Once an SMC-R link group is created, no additional SMC-R links in that group are created using TCP and CLC negotiation. Because subsequent SMC-R links are created exclusively by sending LLC messages over an existing SMC-R link in a link group, the membership of SMC-R linkstoin a link group is self-defining. This architecture does not define a specific identifier for an SMC-R link group. This identification may be useful for network management and may be assigned in aplatform specificplatform-specific manner, or in an extension to this architecture. In each SMC-R link group, one peer is the server for all TCP connections and the other peer is the client. If there are additional TCP connections between the peers that use SMC-R and have the client and server roles reversed, another SMC-R link group is set up between them with the opposite client-server relationship. This is required because there are specific responsibilities divided between the client and server in the management of an SMC-R link group. In this architecture, the decision of whetheror notto use an existing SMC-R link group or create a new SMC-R link group for a TCP connection is made exclusively by the server. Management of the links in an SMC-R link group is also a server responsibility. The server is responsible for adding and deleting links in a link group. The client may request that the server take certainactionsactions, but the final responsibility is the server's. 2.2.4. SMC-Rlink identifiersLink Identifiers This architecture defines multiple identifiers to identify SMC-R links and peers. o Link number: This is aone-byte1-byte value that identifies an SMC-R link within a link group. Both the server and the client use this number to distinguish an SMC-R link from other links within the same link group. It is only unique within a link group. In order to prevent timing windows that may occur when a server creates a new link while the client is still cleaning up a previously existing link, link numbers cannot be reused until the entire link numbering space has been exhausted. o LinkUseruser ID: This is an architecturally opaquefour byte4-byte value that a peer uses to uniquely define an SMC-R link within its own space. This means that a link user ID is unique within one peer only. Each peer defines its own link user ID for a link. The peers exchange this information once during linksetupsetup, and it is never used architecturally again. The purpose of this identifier is for network management, display, anddebugging purposes.debugging. Forexampleexample, an operator on a client could provide the operator on the server with the server's link user ID if he requires the server's operator to check on the operation of a link that the client is having trouble with. o Peer ID: The SMC-R peer ID uniquely identifies a specific instance of a specific TCP/IP stack. It is required because in clustered andload balancingload-balancing environments, an IP address does not uniquely identify a TCP/IP stack. An RNIC's MAC/GID also doesn't uniquely or reliably identify a TCP/IPstackstack, because RNICs can go up and down and even be redeployed to other TCP/IP stacks in amultiple partitionedmultiple-partitioned or virtualized environment. The peer ID is not only unique per TCP/IP stack but is also unique per instance of a TCP/IP stack, meaning that if a TCP/IP stack is restarted, its peer ID changes. 2.3. SMC-RresilienceResilience andload balancingLoad Balancing The SMC-Rmulti-linkmultilink architecture provides resilience for network high availability via failover capability to an alternate RoCE adapter. The SMC-R multilink architecture does not define primary,secondarysecondary, or alternate roles to the links.InsteadInstead, there are multiple active links representing multiple redundant RoCE paths over the same LAN. Assignment of TCP connections to links is unidirectional and asymmetric. This means that the client and server may each choose a separate link for their RDMA writes associated with a specific TCP connection. If a hardware failure occurs or a QP failure associated with an individuallink,link occurs, then the TCP connections that were associated with the failing link are dynamically and transparently switched to use another available link. The server or the client can detect afailure andfailure, immediately move their TCPconnectionsconnections, and then notify their peer via the DELETE LINK LLC command. While the client can notify the server of an apparent link failure with the DELETE LINK LLC command, the server performs the actual link deletion. The movement of TCP connections to another link can be accomplished with minimal coordination between the peers. The TCP connection movement is also transparenttoto, andnon disruptive tonon-disruptive to, the TCP socket application workloads for most failure scenarios. After a failure, the surviving links and all associated hardware must handle the link group's workload. As each SMC-R peer begins to move active TCP connections to anotherlinklink, all current RDMA write operations must be allowed to complete.Then theThe moving peer then sends a signal to verify receipt of the last successful write by its peer. If this verification fails, the TCP connection must be reset. Once this verification is complete, all writes that failed may then be retried, in order, over the new link. Any data writes or CDC messages for which the sender did not receive write completion must be replayed before any subsequent data or CDC write operations are sent. LLC messages are not retried over the newlinklink, because they are dependent on a known link configuration, which has just changed because of the failure. The initiator of an LLC message exchange that fails will be responsible for retrying once the link group configuration stabilizes. When a new link becomes available and is re-added to the linkgroup thengroup, each peer is free to rebalance its current TCP connections as needed or only assign new TCP connections to the newly added link. Both the server and client are free to manage TCP connections across the link group as needed. TCP connection movement does not have to be stimulated by a link failure. The SMC-R architecture also defines orderlyvs.versus disorderly failover. The type of failover is communicated in the LLCDelete LinkDELETE LINK command and is simply a means to indicate that the link has terminated (disorderly) or link termination is imminent (orderly). The orderly link deletion could be initiated via operator command or programmatically to bring down an idle link. Forexampleexample, an operator command could initiate orderlyshut downshutdown of an adapter for service. Implementation of the two types is based on implementation requirements and is beyond the scope of the SMC-R architecture. 3. SMC-R Rendezvousarchitecture RendezvousArchitecture "Rendezvous" is the process thatSMC-R capableSMC-R-capable peers use to dynamically discover each others' capabilities, negotiate SMC-R connections, set up SMC-R links and link groups, and manage those link groups. A key aspect of SMC-RrendezvousRendezvous is that it occurs dynamically and automatically, without requiringSMCSMC-R link configuration to be defined by an administrator. SMC-R Rendezvous starts with the TCP/IP three-wayhandshakehandshake, during which connection peers use TCP options to announce their SMC-R capabilities. If both endpoints are SMC-R capable, then Connection Layer Control (CLC) messages are exchanged between the peers' SMC-R layers over the newly established TCP connection to negotiate SMC-R credentials. The CLC message mechanism is analogous to the messages exchanged by SSL for its handshake processing. If a new SMC-R link is being set up, Link Layer Control (LLC) messages are used to confirm RDMA connectivity. LLC messages are also used by the SMC-R layers at each peer to manage the links and link groups. Once an SMC-R link is set up or agreed to by the peers, the TCP sockets are passed to the peerapplicationsapplications, which use them as normal. The SMC-R layer, which resides under the sockets layer, transmits the socket data between peers over RDMA using the SMC-R protocol, bypassing the TCP/IP stack. 3.1. TCPoptionsOptions During the TCP/IP three-way handshake, the client and server indicate their support for SMC-R by including experimental TCP option 254 on the three-way handshake flows, in accordance withRFC 6994 "Shared[RFC6994] ("Shared Use of Experimental TCPOptions".Options"). TheExIDExperiment Identifier (ExID) value used is the string'SMCR'"SMCR" in EBCDIC (IBM-1047) encoding (0xE2D4C3D9). This ExID has been registered in theTCP ExIDs"TCP Experimental Option Experiment Identifiers (TCP ExIDs)" registry maintained by IANA. After completion of the3-waythree-way TCPhandshakehandshake, each peer queries its peer's options. If both peers set the TCP option on the three-way handshake, inline SMC-R negotiation occurs using CLC messages. If neitherpeerpeer, or only onepeer setpeer, sets the TCP option, SMC-R cannot be used for the TCP connection, and the TCP connection completes the setup using the IP fabric. 3.2. Connection Layer Control (CLC)messagesMessages CLC messages are sent as data payload over the IP network using the TCP connection between SMC-R layers at the peers. They are analogous to the messages used to exchange parameters for SSL.UseThe use of CLC messages is detailed in the following sections. The following list provides a summary of the defined CLC messages and their purposes: o SMCPROPOSAL:Proposal: Sent from the client to propose that this TCP connection is eligible to be moved to SMC-R. The client identifies itself and its subnet to the server and passes the SMC-R elements for a suggested RoCE path via the MAC and GID. o SMCACCEPT:Accept: Sent from the server to accept the client's TCP connection SMCproposal.Proposal. The server responds to the client's proposal by identifying itself to the client and passing the elements of a RoCE path that the client can use totoperform RDMA writes to the server. This consists of such SMC-Rinklink elementssuchas RoCE MAC, GID, and RMBinformation etc.information. o SMCCONFIRM:Confirm: Sent from the client to confirm the server's acceptance of the SMC connection. The client responds to the server's acceptance by passing the elements of a RoCE path that the server can use totoperform RDMA writes to the client. This consists of such SMC-Rinklink elementssuchas RoCE MAC, GID, and RMBinformation etc.information. o SMCDECLINE:Decline: Sent from either the server or the client to reject the SMC connection, indicating the reason the peer must decline the SMCproposalProposal and allowing the TCP connection to revert back to IP connectivity. 3.3. LLCmessagesMessages Link Layer Control (LLC) messages are sent between peer SMC-R layers over an SMC-R link to manage the link or the link group. LLC messages are sent using RoCEsendmsg with inline dataSendMsg and are 44 bytes long. The44 bytes44-byte size is based on what can fit into a RoCE Work Queue Element (WQE) without requiring the posting of receive buffers. LLC messages generally follow a request-reply semantic. Each message has a request flavor and a reply flavor, and each request must be confirmed with a reply, except where otherwise noted.UseThe use of LLC messages is detailed in the following sections. The following list provides a summary of the defined LLC messages and their purposes: o ADD LINK:AddUsed to add a new link to a link group. Sent from the server to the client to initiate addition of a new link to the link group, or from the client to the server to request that the server initiate addition of a new link. o ADD LINK CONTINUATION:This is aA continuation of ADDlinkLINK that allows the ADDlinkLINK to span multiple commands, because all of the link information cannot be contained in a single ADD LINKmessagemessage. o CONFIRM LINK: Used to confirm that RoCE connectivity over a newly created SMC-R link is working correctly. Initiated by theserver, and bothserver. Both this message and its reply must flow over the SMC-R link being confirmed. o DELETE LINK: When initiated by the server, deletes a specific link from the link group or deletes the entire link group. When initiated by the client, requests that the server delete a specific link or the entire link group. o CONFIRM RKEY: Informs the peer on the SMC-R link of the addition of an RMB to the link group. o CONFIRM RKEY CONTINUATION:This is aA continuation of CONFIRM RKEY that allows theADD linkCONFIRM RKEY to span multiple commands, in the event that all of the information cannot be contained in a single CONFIRM RKEY message. o DELETE RKEY: Informs the peer on the SMC-R link of the deletion of one or more RMBs from the linkgroupgroup. o TEST LINK: Verifies that an already-active SMC-R link is active andhealthyhealthy. o Optional LLC message: Any LLC message in which the twohigh orderhigh-order bits of the opcode areb'10' is anb'10'. This optional messageandmust be silently discarded by a receiving peer that does not support the opcode. No such messages are defined in this version of thearchitecture, howeverarchitecture; however, the concept is defined to allow for toleration of possible advanced, optional functions. CONFIRM LINK and TEST LINK are sensitive to which link they flow on and must flow on the link being confirmed or tested. The other flows may flow over any active link in the link group. When there are multiple links in a link group, a response to an LLC message must flow over the same link that the original message flowed over, with the following exceptions: o ADD LINK request from a server in response to an ADD LINK from aclientclient. o DELETE LINK request from a server in response to a DELETE LINK from aclientclient. 3.4. CDC Messages Connection Data Control (CDC) messages are sent over the RoCE fabric between peers using RoCEsendmsg with inline data,SendMsg and are 44 byteslong whichlong. The 44-byte size is based on the size that can fit into a RoCEWork Queue Element (WQE)WQE without requiring the posting of receive buffers. CDC messages are used to describe the socket application data passed via RDMA write operations,andas well as TCP connection stateinformationinformation, including producer cursors and consumer cursors, RMBE state information, and failover data validation. 3.5. RendezvousflowsFlows Rendezvous information for SMC-R isbeexchanged as TCP options on the TCP3-waythree-way handshake flows to indicate capability, followed byin- lineinline TCP negotiation messages to actually do the SMC-R setup. Formats of all rendezvous options and messages discussed in this section are detailed in Appendix A. 3.5.1. FirstcontactContact First contact between RoCE peers occurs when a new SMC-R link group is being set up. This could be because no SMC-R links already exist between the peers, or the server decides to create a new SMC-R link group in parallel with an existing one. 3.5.1.1. Pre-negotiation of TCP Optionspre-negotiationThe client and server indicate their SMC-R capability to each other using TCP option 254 on the TCP3-waythree-way handshake flows. A client who wishes to do SMC-R will include TCP option 254 using an ExID equal to the EBCDIC (codepage IBM-1047) encoding of "SMCR" on its SYN flow. A server that supports SMC-R will include TCP option 254 with the ExID value of EBCDIC "SMCR" on its SYN-ACK flow. Because the server is listening for connections and does not know where client connections will come from, the server implementation may choose to unconditionally include this TCP option if it supports SMC-R. This may be required for server implementations where extensions to the TCP stack are not practical. For server implementationswhichthat can add code to examine and react to packets during the three-way handshake, the server should only include the SMC-R TCP option on the SYN-ACK if the client included it on its SYN packet. A client who supports SMC-R and meets the three conditions outlined above may optionally include the TCP option for SMC-R on its ACK flow, regardless of whether or not the server included it on itsSYN- ACKSYN-ACK flow. Some TCP/IP stacks may have to include it if the SMC-R layer cannot modify the options on the socket until the3-waythree-way handshake completes. Proprietary servers should not include this option on the ACK flow, since including it on the SYN flow was sufficient to indicate the client's capabilities. Once the initial three-way TCP handshake is completed, each peer examines the socket options. SMC-R implementations may do this by examining what was actually provided on the SYN and SYN-ACK packets or by performing a getsockopt() operation to determine the optionssetsent by the peer. If neither peer, or only one peer, specified the TCP option for SMC-R, then SMC-R cannot be used on this connection and it proceeds using normal IP flows and processing. If both peers specified the TCP option for SMC-R, then the TCP connection is not started yet and the peers proceed to SMC-R negotiation using inline data flows. The socket is not yet turned over to the applications;insteadinstead, the respective SMC layers exchange CLC messages over the newly formed TCP connection. 3.5.1.2. Client Proposal If SMC-R is supported by both peers, the client sends an SMC Proposal CLC message to the server.OnIt is not immediately apparent on this flow from client to serverit is not immediately apparent ifwhether this is a new or existing SMC-Rlinklink, because in clustered environments a single IP address may represent multiple hosts. This type of cluster virtual IP address can be owned by anetwork basednetwork-based orhost based layerhost-based Layer 4 load balancer that distributes incoming TCP connections across a cluster of servers/hosts.OtherFor purposes of high availability, other clustered environments may also support the movement of a virtual IP address dynamically from one host in the cluster toanother for high availability purposes.another. In summary, the clientcan not pre-determinecannot predetermine that a connection is targeting the same hostsimplyby simply matching the destination IP address for outgoing TCP connections.ThereforeTherefore, it cannotpre-determinepredetermine the SMC-R link that will be used for a new TCP connection. This information will be dynamicallylearnedlearned, and the appropriate actions will be taken as the SMC-R negotiation handshake unfolds.OnIn the SMC-R proposal message, the initiator (client) proposes the use of SMC-R by including its peerID and GIDID, GID, and MAC addresses, as well as the IP subnet number of the outgoing interface (if IPv4) or the IP prefix list for the networkthatover which the proposal is sentover(if IPv6). At this point in the flow, the client makes no local commitments of resources for SMC-R. When the server receives the SMC Proposal CLC message, it uses the peer ID provided by theclientclient, plus subnet or prefix information provided by the client, to determine if it already has a usable SMC-R link with this SMC-R peer. If thereisare one or more existing SMC-R links with this SMC-R peer, the server then decides whichSMCSMC-R link it will use for this TCP connection. Seesubsequent sectionsSections 3.5.2 and 3.5.3 for the cases of reusing an existing SMC-R link or creating a parallelSMCSMC-R link group between SMC-R peers. If this is a first contact between SMC-Rpeerspeers, the server must validate that it is on the same LAN as the client before continuing. For IPv4, the server does this by verifying that it has an interface with an IP subnet number that matches the subnet numbersetsent by the clientonin the SMC Proposal. ForIPv6IPv6, it does this by verifying that it is directly attached to at least one IP prefix that was listed by the client in its SMC Proposal message. If the server agrees to use SMC-R, the server begins the setup of a new SMC-R link by allocating local QP and RMB resources (setting its QP state to INIT) and providing its full SMC-R information in an SMC Accept CLC message to the client over the TCP connection, along with a flag set indicating that this is a first contact flow. While the SMC Accept message could flow over any IP route back to the client depending upon Layer 3 IP routing, the SMC-R credentials provided must be for the common subnet or prefix between the server and client, as determined above. If the server cannot or does not want to do SMC-R with theclientclient, it sends an SMC Decline CLC message to theclientclient, and the connection data may begin flowing using normal TCP/IP flows. 3.5.1.3. ServeracceptanceAcceptance When the client receives the SMC Accept from the server, itusesdetermines whether this is a new or existing SMC-R link, using the combination of the following: the first contact flag, itsGID/MACMAC/GID and theGID/MACMAC/GID returned by theserver plusserver, theLAN thatVLAN over which the connection is settingup overup, and the QP number provided by theserver to determine if this is a new or existing SMC-R link.server. If it is an existing SMC-Rlink,link and the client agrees to use that link for the TCP connection, see3.5.2. Subsequent contactSection 3.5.2 ("Subsequent Contact") below. If it is a new SMC-R link between peers that already have anSMCSMC-R link, then the server is starting a newSMCSMC-R link group. Assuming that either (1) this iseithera first contact between peers or (2) the server is starting a newSMCSMC-R link group, the client now allocates local QP and RMB resources for the SMC-R link (setting the QP state to RTRor "ready(ready toreceive"),receive)), associates them with the server QP as learnedonfrom the SMC Accept CLC message, and sends an SMC Confirm CLC message to the server over the TCP connection with its SMC-R link information included. The client also starts a timer to wait for the server to confirm thereliablereliably connectedQPqueue pair, as described below. 3.5.1.4. ClientconfirmationConfirmation Upon receipt of the client's SMC Confirm CLC message, the server associates its QP for this SMC-R link with the client's QP as learnedonfrom the SMC Confirm CLC message and sets its QP state to RTS (ready to send).Now theThe client and the server now havereliablereliably connectedQPs.queue pairs. 3.5.1.5. Link (QP)confirmationConfirmation Since setting up the SMC-R link and its QPs did not require any network flows on the RoCE fabric, the client and server must now confirm connectivity over the RoCE fabric. To accomplish this, the server will send a"Confirm Link"CONFIRM LINK Link Layer Control (LLC) message to the client over the newly created SMC-R link, using the RoCE fabric. The"Confirm Link"CONFIRM LINK LLC message will provide the server's MAC, GID, and QP information for the connection, allow each partner to communicate the maximum number of links it can tolerate in this link group (the "link limit"), and will additionally provide two link IDs: o aone-byte1-byte server-assignedLinklink number that is used by both peers to identify the link within the link group and is only unique within a link group. o afour byte4-byte link userid.ID. This opaque value is assigned by the server for the server's local use and is provided to the client for managementpurposes,purposes -- forexampleexample, to use in network management displays and products. When the server sends this message, it will set a timer for receiving confirmation from the client. When the client receives the server's confirmation"Confirm Link"in the form of a CONFIRM LINK LLCmessagemessage, it will cancel the confirmation timer it set when it sent the SMC Confirm message.ItThe client will also advance its QP state to RTS and respond over the RoCE fabric with a"Confirm Link"CONFIRM LINK response LLCmessage, providingmessage that (1) provides its MAC, GID, QP number, and link limit,confirming(2) confirms theone byte1-byte link number sent by the server, andproviding(3) provides its ownfour byte4-byte link useridID to the server. Host X -- Server Host Y -- Client +-------------------+ +-------------------+ |PeerIDPeer ID = PS1 | |PeerIDPeer ID = PC1 | | +------+ +------+ | | QP 8 |RNIC 1| |RNIC 2| QP 64 | |RToken X| |MAC MA| |MAC MB| | | | | |GID GA| |GID GB||Rtoken|RToken Y| | \/ +------+ (Subnet S1) +------+ \/ | |+--------+ | | +--------+ | || RMB | | | | RMB | | |+--------+ | | +--------+ | | +------+ +------+ | | |RNIC 3| |RNIC 4| | | |MAC MC| |MAC MD| | | |GID GC| |GID GD| | | +------+ +------+ | +-------------------+ +-------------------+ SYN TCP options(254,"SMCR") <--------------------------------------------------------- SYN-ACK TCPoptions(254, "SMCR")options(254,"SMCR") ---------------------------------------------------------> ACK [TCPoptions(254, "SMCR")]options(254,"SMCR")] <-------------------------------------------------------- SMC Proposal(PC1,MB,GB,S1) <-------------------------------------------------------- SMC Accept(PS1,first contact,MA,GA,MTU,QP8,RToken=X,RMB elemndx)index) ---------------------------------------------------------> SMCConfirm(PC1,MB,GB,MTU,QP64,RToken=Y, RMBConfirm(PC1,MB,GB,MTU,QP64,RToken=Y,RMB element index) <--------------------------------------------------------Confirm Link (MA,GA,QP8,CONFIRM LINK(MA,GA,QP8, link lim,server'sserver linkuserid,user ID, linknum) .........................................................>Confirm Link Rsp(MB,GB,QP64,CONFIRM LINK rsp(MB,GB,QP64, link lim, client linkuserid,user ID, linknum) <........................................................ Legend: ------------ TCP/IP and CLC flows ............ RoCE (LLC) flows Square brackets ("[ ]") indicate optional information Figure88: Firstcontact rendezvous flowsContact Rendezvous Flows Technically, the data for the TCP connection could now flow over the RoCE path.HoweverHowever, if this is a first contact, there is no alternate for this recently established RoCE path. Since in the current architecture there is no failover from RoCE to IP once connection data starts flowing, this means that a failure of this path would disrupt the TCP connection, meaning that the level of redundancy and failover is less than that provided by IP. If the network has alternate RoCE paths available, they would not be usable at thispoint, which is an unacceptable conditionpoint. This situation would be unacceptable. 3.5.1.6. Second SMC-Rlink setupLink Setup Because of the unacceptable situation described above, TCP data will not be allowed to flow on the newly established SMC-R link until a second path has been set up, or at least attempted. If the server has a second RNIC available on the same LAN, it attempts to set up the second SMC-R link over that second RNIC. If it only has one RNIC available on the LAN, it will attempt to set up the second SMC-R link over that one RNIC. In the latter case, the server is attempting to set up an asymmetric link, in case the client does have a second RNIC on the LAN. In eithercasecase, the server allocates a new QP over the RNIC it is attempting to use for the secondlink,link and assigns a link number to the newlink andlink; the server also creates an RToken for the RMB over this second QP (note that this means that the first and second QP eachhas itshave their own RToken to represent the same RMB). The server provides this information, as well as the MAC and GID of the RNIC over which it is attempting to set up the secondlink overlink, in an"Add Link"ADD LINK LLC messagewhichthat it sends to the client over the SMC-R link that is already set up. 3.5.1.6.1. ClientprocessingProcessing of"Add Link"ADD LINK LLCmessageMessage fromserverServer When the client receives the server's"Add Link"ADD LINK LLC message, it examines the GID and MAC provided by the server to determineifwhether the server is attempting to use the same server-side RNIC as the existing SMC-Rlink,link or a different one. If the server is attempting to use the same server-side RNIC as the existing SMC-R link, then the client verifies that it has a second RNIC on the same LAN. If it does not, the client rejects the"Add Link"ADD LINK request from the server, because the resulting link would be a parallellinklink, which is not supported within a link group. If the client does have a second RNIC on the same LAN, it accepts therequestrequest, and an asymmetric link will be set up. If the server is using a different server-side RNIC from the existing SMC-Rlinklink, then the client will accept the request and a second SMC-R link will be set up in this SMC-R link group. If the client has a second RNIC on the same LAN, that second RNIC will be used for the second SMC-R link, creating symmetric links. If the client does not have a second RNIC on the same LAN, it will use the same RNIC as was used for the initial SMC-R link, resulting in the setup of an asymmetric link in the SMC-R link group. In either case, when the client accepts the server's"Add Link"ADD LINK request, it allocates a new QP on the chosen RNIC and creates anRkeyRKey over that new QP for the client-side RMB for theSMCSMC-R link group, then sends an"Add Link"ADD LINK reply LLC message to the server providing that information as well as echoing theLinklink number that wassetsent by the server. If the client rejects the server's"Add Link"ADD LINK request, it sends an"Add Link"ADD LINK reply LLC message to the server with the reason code for the rejection. 3.5.1.6.2. ServerprocessingProcessing of"Add Link" replyADD LINK Reply LLCmessageMessage fromthe clientClient If the client sends a negative response to the server or no reply is received, the server frees the RoCE resources it had allocated for the new link. Having a single link in an SMC-R link group isundesirable and theundesirable. The server's recovery is detailed inC.8. FailureAppendix C.8 ("Failure toadd secondAdd Second SMC-RlinkLink to alink group.Link Group"). If the client sends a positive reply to the server withMAC/GID/QP/RkeyMAC/GID/QP/RKey information, the server associates its QP for the new SMC-R link to the QP that the client provided.NowNow, the new SMC-R link is in the same situation that the first was in after the client sent its ACK packet--- there is areliablereliably connectedQPqueue pair over the new RoCE path, but there have been no RoCE flows to confirm that it's actually usable.SoSo, at thispointpoint, the client and server will exchange"Confirm Link"CONFIRM LINK LLC messages just like they did on the first SMC-R link. If either peer receives a failure during this second"Confirm Link"CONFIRM LINK LLC exchange (either an immediate failure -- which implies that the message did not reach thepartner,partner -- or a timeout), it sends a"Delete Link"DELETE LINK LLC message to the partner over the first (and now only) link in the linkgroup whichgroup. This DELETE LINK LLC message must be acknowledged before data can flow on the single link in the link group. Host X -- Server Host Y -- Client +-------------------+ +-------------------+ |PeerIDPeer ID = PS1 | |PeerIDPeer ID = PC1 | | +------+ +------+ | | QP 8 |RNIC 1| SMC-R Link 1 |RNIC 2| QP 64 | |RToken X| |MACMA| |MACMA|<-------------------->|MAC MB| | | | | |GID GA| |GID GB| |RToken Y| | \/ +------+ +------+ \/ | |+--------+ | | +--------+ | || | | | | | | || RMB | | | | RMB | | || | | | | | | |+--------+ | | +--------+ | | /\ +------+ +------+ /\ | | | |RNIC 3| SMC-R Link 2 |RNIC 4| | | |RToken Z| |MACMC| |MACMC|<-------------------->|MAC MD| |RTokenW|W | | QP 9 |GID GC| (being added) |GID GD| QP 65 | | +------+ +------+ | +-------------------+ +-------------------+ First SMC-R link setup as shown in Figure 8 <-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-> ADD LINK request(QP9,MC,GC, linkrequest (QP9,MC,GC, link number=2)number = 2) ............................................> ADD LINK response(QP65,MD,GD, linkresponse (QP65,MD,GD, link number=2)number = 2) <............................................ ADDlink continuation request (RToken=Z)LINK CONTINUATION request(RToken=Z) ............................................> ADDlink continuationLINK CONTINUATION response(RToken=W) <............................................Confirm Link(MC,GC,QP9,link number=2,CONFIRM LINK(MC,GC,QP9, link number = 2, linkuserid)user ID) .............................................>Confirm Link response(MD,GD,QP65,link number=2,CONFIRM LINK response(MD,GD,QP65, link number = 2, linkuserid)user ID) <............................................. Legend: ------------ TCP/IP and CLC flows ............ RoCE (LLC) flows Figure99: Firstcontact, second link setupContact, Second Link Setup 3.5.1.6.3. Exchange ofRkeysRKeys onsecondSecond SMC-RlinkLink Note that in the scenario describedhere,here -- firstcontact,contact -- there is only one RMBRkeyRKey to exchange on the second SMC-Rlinklink, and it is exchanged in theAdd Link ContinuationADD LINK CONTINUATION request and reply. In scenarios other than firstcontact,contact -- for example, adding a new SMC-R link to a longstanding link group with multipleRMBs,RMBs -- additional flows will be required to exchange additional RMBRkeys.RKeys. See3.5.5.2.3. AddingSection 3.5.5.2.3 ("Adding anewNew SMC-RlinkLink to alink groupLink Group withmultiple RMBsMultiple RMBs") for more details on theseflowsflows. 3.5.1.6.4. Aborting SMC-R andfalling backFalling Back to IP If both partners don't provide the SMC-R TCP option during the3 waythree-way TCP handshake, the connection falls back to normal TCP/IP. During the SMC-R negotiation that occurs after the3 waythree-way TCP handshake, either partner may break off SMC-R by sending an SMC Decline CLC message. The SMC Decline CLC message may be sent in place of any expectedmessage,message and may also be sent during theConfirm LinkCONFIRM LINK LLC exchange if there is a failure before any application data has flowed over the RoCE fabric. For moredetaildetails on exactly when an SMC Decline can flow during link group setup, seeC.1. SMCAppendices C.1 ("SMC Decline during CLCnegotiationNegotiation") andC.2. SMCC.2 ("SMC Decline during LLCnegotiationNegotiation"). If this fallback to IP happens while setting up a new SMC-R link group, the RoCE resources allocated for this SMC-R link group relationship are torndowndown, and it will be retried as a new SMC-R link group next time a connection starts between these peers with SMC-R proposed. Note that if this happens because one side doesn't support SMC-R, there will be very little to teardowndown, as the TCP option will have failed to floweitheron either the initial SYN or theSYN-ACK,SYN-ACK before either side had reserved any local RoCE resources. 3.5.2. SubsequentcontactContact "Subsequent contact" means setting up a new TCP connection between two peers that already have an SMC-R link group betweenthem,them and reusing the existing SMC-R link group. In thiscasecase, it is not necessary to allocate new QPs.HoweverHowever, it is possible that a new RMB has been allocated for this TCP connection, if the previous TCP connection used the last element available in the previously used RMB, or for any other implementation-dependent reason. For this reason, and for convenience and error checking, the same TCP option254254, followed by the inline negotiation method described for initialcontactcontact, will be used for subsequent contact, but the processing differs in some ways. That processing is described below. 3.5.2.1. SMC-RproposalProposal When the client begins the inline negotiation with the server, it does not know if this is a first contact or a subsequent contact. The client cannot know this information until it sees the server's peerIDID, to determine whether or not it already has an SMC-R link with this peer that it can use. There are several reasons why it is not sufficient to use the partner IP address, subnet,VLANVLAN, or other IP information to make this determination. The most obvious reason is distributed systems: if the server IP address is actually a virtual IP address representing a distributed cluster, the actual host serving this TCP connection may not be the same as the host that served the last TCP connection to this same IP address. After the TCPthree waythree-way handshake, assuming that both partners indicate SMC-R capability, the client builds and sends the SMC Proposal CLC message to the server in exactly the same manner as it does in thefirst contact"first contact" case, and in fact at this point doesn't know if it's a first contact or a subsequent contact. As in thefirst contact"first contact" case, the client sends itsPeerpeer ID value, suggested RNICGID/MAC,MAC/GID, and IP subnet or prefix information. Upon receiving the client's proposal, the server looks up the provided peer IDprovidedto determine if it already has a usable SMC-R link group with this peer. If it does already have a usable SMC-R link group, the server then needs to decideifwhether it will use the existing SMC-R linkgroup,group or create a new link group. For the case of the new linkgroup case,group, see3.5.3. First contact variation: creatingSection 3.5.3 ("First Contact Variation: Creating aparallel link group,Parallel Link Group") below. For thisdiscussiondiscussion, assume that the server decides to use the existing SMC-R link group for the TCP connection, which is expected to be the most common case. The server is responsible for making this decision.Then theThe server then needs to communicate that information to the client, but it is not necessary to allocate, associate, and confirm QPs for the chosen SMC-R link. All that remains to be done is to set up RMB space for this TCP connection. If one of the RMBs already in use for this SMC-R link group has an available element that uses the appropriate buffer size, the server merely chooses one for this TCP connection and then sends an SMC Accept CLCmessage,message providing the full RoCE information for the chosen SMC-R link to the client, using the same format as the SMC Accept CLC message described inthe initial contact sectionSection 3.5.1 ("First Contact") above. The server may choose to use the SMC-R link that matches the suggested MAC/GID provided by the clientonin the SMC Proposal for its RDMA writes but is not obligatedto.to do so. The final decision on which specific SMC-R link to assign a TCP connection to is an independent server and client decision. It may be necessary for the server to allocate a new RMB for this connection. The reasons for this are implementation dependent and couldinclude:include the following: o no available space in existing RMB or RMBs, or o desire to allocate a new RMB that uses a different buffer size from the ones already created, or o any otherimplementation dependent reason.implementation-dependent reason In thiscasecase, the server will allocate the new RMB and then perform the flows described in3.5.5.2.1. AddingSection 3.5.5.2.1 ("Adding anewNew RMB to an SMC-Rlink group.Link Group"). Once that processing is complete, the server then provides the full RoCE information, including the newRkey,RKey, for this connectiononin an SMC Confirm CLC message to the client. 3.5.2.2. SMC-RacceptanceAcceptance Upon receiving the SMC Accept CLC message from the server, the client examines the RoCE information provided by the server to determineifwhether this is a first contact for a newSMCSMC-R linkgroup,group or a subsequent contact for an existing SMC-R link group. It is a subsequent contact if theserver sideserver-side peer ID, GID,MACMAC, and QP number providedonin the packet match a known SMC-R link, and the"first contact"first contact flag is not set. If this is not thecase,case -- forexampleexample, the GID and MAC match but the QP isnew,new -- then the server is creating a new, parallel SMC-R linkgroupgroup, and this is treated as a first contact. A different RMB RToken does not indicate a firstcontactcontact, as the server may have allocated a newRMB,RMB or may be using several RMBs for this SMC-R link. The client needs the server's RMB information only for its RDMA writes to the server, and since there is no requirement for symmetric RMBs, this information is simply control information for the RDMA writes on this SMC-R link. The client must validate that the RMB element being provided by the server is not in use by another TCP connection on this SMC-R link group. This validation must validate the new <rtoken, index> across all known <rtoken, index> on this link group. See4.4.2. RMB element reuseSection 4.4.2 ("RMB Element Reuse andconflict resolutionConflict Resolution") for the case in which the server tries to use an RMB element that is already in use on this link group. Once the client has determined that this TCP connection is a subsequent contact over an existingSMCSMC-R link, it performsa similaran RMB allocation processassimilar to what the server did: it either (1) allocates an element from an RMB already associated with this SMC-Rlink,link orit(2) allocates a newRMB andRMB, associates it with this SMC-Rlinklink, and then chooses an element out of it. If the client allocates a new RMB for this TCP connection, it performs the processing described in3.5.5.2.1. AddingSection 3.5.5.2.1 ("Adding anewNew RMB to an SMC-Rlink group.Link Group"). Once that processing is complete, the client provides its full RoCE information for this TCP connectiononin an SMC Confirm CLC message. Because an SMC-R link with a verified connected QP already exists and is being reused, there is no need for verification or alternate QP selection flows or timers. 3.5.2.3. SMC-RconfirmationConfirmation When the server receives the client's SMC Confirm CLC message on a subsequent contact, it verifies the following: otheThe RMB element provided by the client is not already in use by another TCP connection on this SMC-R link group (seesection 4.4.2. RMB element reuseSection 4.4.2 ("RMB Element Reuse andconflict resolutionConflict Resolution") for the case in which it is). o The MAC/GID/QPinfoinformation provided by the client matches an active link within the link group. The client is free to select anyvalid / activevalid/active link. The client is not required to select the same link as the server. If this validation passes, the server stores the client's RMB information for thisconnectionconnection, and the RoCE setup of the TCP connection is complete. 3.5.2.4. TCPdata flow raceData Flow Race with SMC Confirm CLCmessageMessage On a subsequent contact TCP/IP connection, a peer may send data as soon as it has received the peer RMB information for the connection. There are no additional RoCE confirmation flows, since the QPs on theSMCSMC-R link are already reliably connected and verified. In the majority ofcasescases, the first data will flow from the client to the server. The client must send the SMC Confirm CLC message before sending any connection data over the chosen SMC-Rlink, howeverlink; however, the client need not wait for confirmation of this message, and in fact there will be no such confirmation. Since the server is required to have the RMB fully set up and ready to receive data from the client before sending an SMC Accept CLC message, the client can begin sending data over the SMC-R link immediately upon completing the send of the SMC Confirm CLC message. It is possible that data from the client will arriveintoat theserver sideserver-side RMB before the SMC Confirm CLC message from the client has been processed. In thiscasecase, the server must handle this racecondition,condition and not provide the arrived TCP data to the socket application until the SMC Confirm CLC message has been received and fully processed, opening the socket. If the server has initial data to send to the clientwhichthat is not a response to the client (this case should be rare), it can send the data immediately upon receiving and processing the SMC Confirm CLC message from the client. The client must have opened the TCP socket to the client application upon sendingofthe SMC Confirm CLC message so the client will be ready to process data from the server. 3.5.3. Firstcontact variation: creatingContact Variation: Creating aparallel link groupParallel Link Group Recall that parallel SMC-R links within an SMC-R link group are not supported. These are multiple SMC-R links within a link group that use the same network path. However, multiple SMC-R link groups between the same peers are supported. This means that if multiple SMC-R links over the same RoCE path are desired, it is necessary to use multiple SMC-R link groups. While not a recommended practice, this could be done forplatform specificplatform-specific reasons, like QP separation of different workloads. Only the server can drive the creation of multiple SMC-R link groups between peers. At a high level, when the server decides to create an additionalSMC- RSMC-R link group with a client with which it already has an SMC-R linkgroup with,group, the flows are basically the same as the normal "first contact" case described above. The following text provides more detail and clarification of processing in this case. When the server receives the SMC Proposal CLC message from the clientandand, using theGID/MAC infoMAC/GID information, determines that it already has an SMC-R link group with this client, the server can either reuse the existing SMC-R link group (detailed in3.5.2. Subsequent contactSection 3.5.2 ("Subsequent Contact") above) orit cancreate a new SMC-R link group in addition to the existing one. If the server decides to create a new SMC-R link group, it does the same processing it would have done for first contact: allocate QP and RMB resources as well as alternate QP resources, and communicate the QP and RMB information to the clientonin the SMC Accept CLC message with the"first contact"first contact flag set. When the client receives the server's SMC Accept CLC message with the new QP information and the"first contact" flag,first contact flag set, it knows that the server is creating a new SMC-R link group even though it already has anSMC- RSMC-R link group with the server. In thiscasecase, the client will also allocate a new QP for this newSMC link andSMC-R link, allocate an RMB forthis linkit, and generate anRkeyRKey for it. Note that multiple SMC-R link groups between the same peers must access different RMB resources, so new RMBs will be required. Using the same RMBs that are in use in another SMC-R link group is not permitted. The client then associates its new QP with the server's new QP and sends its SMC Confirm CLC message back to the server providing the new QP/RMBinformationinformation, and then sets its confirmation timer for the new SMC-R link. When the server receives the client's SMC Confirm CLCmessagemessage, it associates its QP with the client's QP as learnedonfrom the SMC Confirm CLC message and sends a confirmation LLC message. The rest of the flow, with the confirmation QP and setup of additional SMC-R links, unfolds just like thefirst contact"first contact" case. 3.5.4. NormalSMC-R link terminationSMC-R Link Termination The normalsocketssocket API trigger points are used by the SMC-R layer to initiate SMC-R connection termination flows. The main design point for SMC-R normal connection flows is to use the SMC-R protocol to firstshutdownshut down the SMC-R connection and free up any SMC-R RDMAresourcesresources, and then allow the normal TCP connection termination protocol(i.e.(i.e., FIN processing) to drive cleanup of the TCP connection that exists on the IP fabric. This design point is very important in ensuring that RDMA resources such as the RMBEs are only freed and reused when both SMC-Rend pointsendpoints are completely done with their RDMAWritewrite operations to the partner's RMBE. When the last TCP connection over an SMC-R link group terminates, the link group can be terminated. Similar to creation of SMC-R links and link groups, the primary responsibility for determining that normal termination is needed and initiating it lies with the server. Implementations may opt to set timers to keep SMC-R link groups up for a specified time after the last TCP connection ends, to avoid churn in caseswhenwhere TCP connections come and go regularly. The link or link group may also be terminated as a result ofan operatora command initiatedcommand.by the operator. This command can be entered at either the client or the server. If entered at the client, the client requests that the server perform link or link group termination, and the responsibility for doing so ultimately lies with the server. When the server determines that the SMC-R link group is to be terminated, it sends a DELETE LINK LLC message to the client, with a flag set indicating that all links in the link group are to be terminated. After receiving confirmation from the adapter that the DELETE LINK LLC message has been sent, the server can clean up its end of the link group (QPs, RMBs,etc).etc.). Upon receipt of the DELETE LINK message from the server, the client must immediately comply and clean up its end of the link group. Any TCP connections that the client believes to be active on the link group must be immediately terminated. The client can request that the server delete the link group as well. The client does this by sending a DELETE LINK message to theserverserver, indicating that cleanup of all links is requested. The server must comply by sending a DELETE LINK to the client and processing as describedabove.in the previous paragraph. If there are TCP connections active on the link group when the server receives this request, they are immediately terminated by sending a RST flow over the IP fabric. 3.5.5. Linkgroup management flowsGroup Management Flows 3.5.5.1. Adding anddeleting linksDeleting Links in an SMC-Rlink groupLink Group The server has the lead role in managing the composition of the link group. Links are added to the link group by the server. The client may notify the server of new conditions that may result in the server adding a new link, but the server is ultimately responsible. Ingeneralgeneral, links are deleted from the link group by theserver, howeverserver; however, in certain error cases the client may inform the server that a link must be deleted and treat it as deleted without waiting for action from the server. These flows are detailed in thefollowingsections that follow. 3.5.5.1.1.Server initiated Add Link processingServer-Initiated ADD LINK Processing As described in previous sections, the server initiates anAdd LinkADD LINK exchange to create redundancy in a newly created link group. Once a link group isestablishedestablished, the server may also initiateAdd LinkADD LINK for other reasons, including: o Availability of additional resources on the server host to support an additional SMC-R link. This may include the provisioning of an additional RNIC, more storage becoming available to support additional QP resources, operator command, or any otherimplementation dependentimplementation-dependent reason. Notethat,that in order to be available for an existing linkgroup,group a new RNIC must be attached to the same RoCE LAN that the link group is using. o Receipt of notification from the client that additional resources on the client are available to support an additional SMC-R link. See3.5.5.1.2. Client initiated Add Link processing. Server initiated Add LinkSection 3.5.5.1.2 ("Client-Initiated ADD LINK Processing"). Server-initiated ADD LINK processing in an established SMC-R link group is the same as theAdd LinkADD LINK processing described in3.5.1.6. SecondSection 3.5.1.6 ("Second SMC-Rlink setupLink Setup"), with the following changes: o If an asymmetric SMC-R link already exists in the linkgroupgroup, a second asymmetric link will not be created. Only one asymmetric link is permitted in a link group. o TCP data flow onalready existingalready-existing link(s) in the link group is not halted or otherwise affected during the process of setting up the additional link.In no case will theThe server will not initiateAdd LinkADD LINK processing if the link group already has the maximum number of links negotiated by the partners. 3.5.5.1.2.Client initiated Add Link processingClient-Initiated ADD LINK Processing If an additional RNIC becomes available for an existing SMC-R link group on the client's side, the client notifies the server by sending anAdd LinkADD LINK request LLC message to the server. Unlike anAdd LinkADD LINK request sent by the server to the client, thisAdd LinkADD LINK request merely informs the server that the client has a new RNIC. If the link group lacksredundancy,redundancy or has redundancy only on an asymmetric link with a single RNIC on the client side, the server must initiate anAdd LinkADD LINK exchange in response to this message, to create or improve the link group's redundancy. If the link group already hassymmetric linksymmetric-link redundancy but has fewer than the negotiated maximum number of links, the server may respond by initiating anAdd LinkADD LINK exchange to create a new link using the client's new resource but is not requiredto.to do so. If the link group already has the negotiated maximum number of links, the server must ignore the client'sAdd LinkADD LINK request LLC message. Because the server is not required to respond to the client'sAdd LinkADD LINK LLC message in all cases, the client must not wait for a response or throw an error if one does not come. 3.5.5.1.3.Server initiated Delete LinkServer-Initiated DELETE LINK Processing Reasons that a server may delete a linkinclude:include the following: o The link has not been used for TCP connections for animplementation definedimplementation-defined time interval, and deleting the link will not cause the link group to lackredundancyredundancy. oAn errorErrors in resources supporting thelink.link occur. These errors mayincludeinclude, but are not limitedto:to, RNIC errors, QP errors, and softwareerrorserrors. o The RNIC supporting this SMC-R link is being taken down, either because of an error case or because of an operator or software command. If a link being deleted is supporting TCPconnections,connections and there are one or more surviving links in the link group, the TCP connections are moved to the surviving links. For more information on thisprocessingprocessing, see2.3. SMC-R resilienceSection 2.3 ("SMC-R Resilience andload balancing.Load Balancing"). The server deletes a link from the link group by sending aDelete LinkDELETE LINK request LLC message to the client over any of the usable links in the link group. Because theDelete LinkDELETE LINK LLC message specifies which link is to be deleted, it may flow over any link in the link group. The server must not clean up its RoCE resources for the link until the client responds. The client responds to the server'sDelete LinkDELETE LINK request LLC message by sending the server aDelete LinkDELETE LINK response LLC message. The client must respond positively; it cannot decline to delete the link. Once the server has received the client'sDelete LinkDELETE LINK response, both sides may clean up their resources for the link.PositiveEither a positive write completion or some other indication from the RNIC on the client's side is sufficient to indicate to the client that the server has received theDelete LinkDELETE LINK response. Host X Host Y +-------------------+ +-------------------+ | +------+ +------+ | | QP 8 |RNIC 1| SMC-R Link 1 |RNIC 2| QP 9 | |RToken X| |Failed|<--X----X----X----X-->| | | | | | | | | | | \/ +------+ +------+ | |+--------+ | | | ||deleted|Deleted| | | | || RMB | | | | || | | | | |+--------+ | | | | /\ +------+ +------+ | |RToken Z| | | SMC-R Link 2 | | | | | |RNIC 3|<-------------------->|RNIC 4| | | QP 64| | | | QP 65 | | +------+ +------+ | +-------------------+ +-------------------+ DELETELINK(Request,LINK(request, link number = 1, ................................................> reason code = RNIC failure) DELETELINK(Response,LINK(response, link number = 1) <................................................(note, architecturally(Note: Architecturally, this exchange can flow over either SMC-R link but most likely flows overlink 2Link 2, since the RNIC forlinkLink 1 hasfailed)failed.) Figure10 Server initiated Delete Link flow10: Server-Initiated DELETE LINK Flow 3.5.5.1.4.Client initiated Delete Link requestClient-Initiated DELETE LINK Request The client may request that the server delete a link for the same reasons that the server may delete a link, except for inactivity timeout. Because the client depends on the server to delete links, there are two types of delete requests from client to server: o Orderly:theThe client is requesting that the server delete the link when able. This would result from an operator command to bring down the RNIC or some other nonfatal reason. In thiscasecase, the server is required to delete thelink,link but may not do it right away. o Disorderly:theThe server must delete the link right away, because the client has experienced a fatal error with the link. In eithercasecase, the server responds by initiating aDelete LinkDELETE LINK exchange with theclientclient, as described in the previous section. The difference between the two is whether the server must do so immediately or can delay for an opportunity to gracefully delete the link. Host X Host Y +-------------------+ +-------------------+ | +------+ +------+ | | QP 8 |RNIC 1| SMC-R Link 1 |RNIC 2| QP 9 | |RToken X| | |<---X--X--X--X--X--X->|Failed| | | | | | | | | | \/ +------+ +------+ | |+--------+ | | | ||deleted|Deleted| | | | || RMB | | | | || | | | | |+--------+ | | | | /\ +------+ +------+ | |RToken Z| | | SMC-R Link 2 | | | | | |RNIC 3|<-------------------->|RNIC 4| | | QP 64| | | | QP 65 | | +------+ +------+ | +-------------------+ +-------------------+ DELETELINK(Request,LINK(request, link number = 1, disorderly, <............................................... reason code = RNIC failure) DELETELINK(Request,LINK(request, link number = 1, ................................................> reason code = RNIC failure) DELETELINK(Response,LINK(response, link number = 1) <................................................(note, architecturally(Note: Architecturally, this exchange can flow over either SMC-R link but most likely flows overlink 2Link 2, since the RNIC forlinkLink 1 hasfailed)failed.) Figure11 Client-initiated Delete Link11: Client-Initiated DELETE LINK Flow 3.5.5.2. Managingmultiple RkeysMultiple RKeys overmultipleMultiple SMC-RlinksLinks in alink groupLink Group After the initial contact sequence completes and the number of TCP connectionsincreasesincreases, it is possible that the SMC peers could addadditionalmore RMBs to theLink Group.link group. Recall that each peer independently manages its RMBs. Also recall that an RMB's RToken is specific to a QP, which means that when there are multiple SMC-R links in a link group, each RMB accessed with the link group requires a separate RToken for each SMC-R link in the group. Each RMB that is added to a link must be added to all links within theLink Group.link group. The set of RMBs created for theLinklink is called the "RTokenSet".set". The RTokens must be exchanged with the peer. As RMBs are added and deleted, the RTokenSetset must remain in sync. 3.5.5.2.1. Adding anewNew RMB to an SMC-Rlink groupLink Group A new RMB can be added to an SMC-R link group on either the client side or the server side. When an additional RMB is added to an existingSMC- RSMC-R link group, that RMB must be associated with the QPs for each link in the link group.ThereforeTherefore, when an RMB is added to an SMC-R link group, its RMB RToken for each SMC-R link's QP must be communicated to the peer. The tokens for a new RMB added to an existing SMC-R link group are communicated using"Confirm Rkey"CONFIRM RKEY LLC messages, as shown in Figure 12. The RToken set is specified as pairs: anSMCSMC-R link number, paired with the new RMB's RToken over thatSMC Link.SMC-R link. To preserve failover capability, any TCP connection that uses a newly added RMB cannot go active until all RTokens for the RMB have been communicated for all of the links in the link group. Host X Host Y +-------------------+ +-------------------+ | +------+ +------+ | | QP 8 |RNIC 1| SMC-R Link 1 |RNIC 2| QP 9 | |RToken X| | |<-------------------->| | | | | | | | | | | \/ +------+ +------+ | |+--------+ | | | ||newNew | | | | || RMB | | | | || | | | | |+--------+ | | | | /\ +------+ +------+ | |RToken Z| | | SMC-R Link 2 | | | | | |RNIC 3|<-------------------->|RNIC 4| | | QP 64| | | | QP 65 | | +------+ +------+ | +-------------------+ +-------------------+ CONFIRMRKEY(Request,RKEY(request, Add, ................................................> RToken set((Link 1,RTokenX),(Link2,RTokenX),(Link 2,RToken Z))) CONFIRMRKEY(Response,RKEY(response, Add, <................................................ RToken set((Link 1,RTokenX),(Link2,RTokenX),(Link 2,RToken Z)))(note, this(Note: This exchange can flow over either SMC-Rlink)link.) Figure1212: Add RMB toexisting link groupExisting Link Group Implementations may choose to proactively add RMBs to link groups in anticipation of need. For example, an implementation may add a new RMB when a certain usage threshold (e.g., percentage used) for all of its existing RMBsare over a certain threshold percentage used.has been exceeded. A new RMB may also be added to an existing link group on anas needed basis. Foras-needed basis -- for example, when a new TCP connection is added to the link group but there are no available RMB elements. In thiscasecase, the CLC exchange is paused while the peer that requires the new RMB adds it. An example of this is illustrated infigureFigure 13. Host X -- Server Host Y -- Client +-------------------++-------------------++--------------------+ |PeerIDPeer ID = PS1 | |PeerIDPeer ID = PC1 | | +------+ +------+ | | QP 8 |RNIC 1| SMC-RlinkLink 1 |RNIC 2| QP 64 | |RToken X| |MAC MA|<-------------------->|MAC MB| | | | | |GID GA| |GID GB||RTokenY2||RToken Y2| | \/ +------+ +------+ \/ | |+--------+ | | +--------+ | || | |SUBNETSubnet S1 | | New | | || RMB | | | | RMB | | |+--------+ | | +--------+ | | /\ +------+ +------+ /\ | | | |RNIC 3| SMC-RlinkLink 2 |RNIC 4||RTokenW2||RToken W2| | | |MAC MC|<-------------------->|MAC MD| | | | QP 9 |GID GC| |GID GD|QP65QP 65 | | +------+ +------+ | +-------------------++-------------------++--------------------+ SYN / SYN-ACK /ACTACK TCP3-waythree-way handshake with TCP option <---------------------------------------------------------> SMC Proposal(PC1,MB,GB,S1) <-------------------------------------------------------- SMC Accept(PS1,not 1st contact,MA,GA,QP8,RToken=X,RMB elem index) --------------------------------------------------------->Confirm Rkey(Request,CONFIRM RKEY(request, Add, <........................................................ RTokenset((Link1, RToken Y2),{Link2, RTokenset((Link 1,RToken Y2),(Link 2,RToken W2)))Confirm Rkey(Response,CONFIRM RKEY(response, Add, ........................................................> RTokenset((Link1, RToken Y2),{Link2, RTokenset((Link 1,RToken Y2),(Link 2,RToken W2))) SMC Confirm(PC1,MB,GB,QP64,RToken=Y2, RMB element index) <-------------------------------------------------------- Legend: ------------ TCP/IP and CLC flows ............ RoCE (LLC) flows Figure1313: ClientaddsAdds RMB during TCPconnection setupConnection Setup 3.5.5.2.2. Deleting an RMB from an SMC-Rlink groupLink Group Either peer can delete one or more of its RMBs as long as it is not being used for any TCP connections.IdeallyIdeally, an SMC-R peer would use a timer to avoid freeing an RMB immediately after the last TCP connection stops using it, to keep the RMB available for later TCP connections and avoid thrashing with addition and deletion of RMBs. Once an SMC-R peer decides to delete an RMB, it sends a DELETE RKEY LLC message to its peer. It can then free the RMB once it receives a response from the peer. Multiple RMBs can be deleted in a DELETE RKEY exchange. Note that in a DELETE RKEY message, it is not necessary to specify the full RToken for a deleted RMB. The RMB'sRkeyRKey over one link in the link group is sufficient to specify which RMB is being deleted. Host X Host Y +-------------------+ +-------------------+ | +------+ +------+ | | QP 8 |RNIC 1| SMC-R Link 1 |RNIC 2| QP 9 | |RToken X| | |<-------------------->| | | | | | | | | | | \/ +------+ +------+ | |+--------+ | | | ||deleted|Deleted| | | | || RMB | | | | || | | | | |+--------+ | | | | /\ +------+ +------+ | |RToken Z| | | SMC-R Link 2 | | | | | |RNIC 3|<-------------------->|RNIC 4| | | QP 9 | | | | | | +------+ +------+ | +-------------------+ +-------------------+ DELETERKEY(Request, Rkey list(RkeyRKEY(request, RKey list(RKey X)) ................................................> DELETERKEY(Response, Rkey list(RkeyRKEY(response, RKey list(RKey X)) <................................................(note, this(Note: This exchange can flow over either SMC-Rlink)link.) Figure1414: Delete RMB from SMC-Rlink groupLink Group 3.5.5.2.3. Adding anewNew SMC-RlinkLink to alink groupLink Group withmultipleMultiple RMBs When a new SMC-R link is added to an existing link group, there could be multiple RMBs on each side already associated with the link group. There could also be a different number of RMBs on one sideasthan on the other, because each peer manages its RMBs independently. Each of these RMBs will require a new RToken to be used on the new SMC-R link, andthenthose new RTokens must then be communicated to the peer. This requires two-waycommunicationcommunication, as the server will have to communicate its RTokens to the client and vice versa. RTokens are communicated between peers in pairs. Each RToken pair consists of: o The RToken for the RMB, as is already known on an existing SMC-R link in the linkgroupgroup. o The RToken for the same RMB, to be used on the new SMC-R link. These pairs are required to ensure that each peer knows which RTokens across QPs are equivalent. The"Add Link"ADD LINK request and response LLC messages do not haveroomenough space to contain any RToken pairs."Add Link continuation"ADD LINK CONTINUATION LLC messages are used to communicate these pairs, as shown in Figure 15. The"Add Link Continuation"ADD LINK CONTINUATION LLC messages are sent on the same SMC-R link that the"Add Link"ADD LINK LLC messages were sent over, and in both the"Add Link"ADD LINK andthe "Add Link Continuation"ADD LINK CONTINUATION LLCmessages,messages the first RToken in each RToken pair will be the RToken for the RMB as known on the SMC-R linkthatover which the LLC message is beingsent over.sent. Host X -- Server Host Y -- Client +-------------------+ +-------------------+ |PeerIDPeer ID = PS1 | |PeerIDPeer ID = PC1 | | +------+ +------+ | | QP 8 |RNIC 1| SMC-R Link 1 |RNIC 2| QP 64 ||Rkey Set| |MAC MA||RKey set| |MAC MA|<-------------------->|MAC MB||Rkey|RKey set| |X,Y,Z | |GID GA| |GID GB| |Q,R,S,T | | \/ +------+ +------+ \/ | |+--------+ | | +--------+ | || 3 RMBs | | | | 4 RMBs | | |+--------+ | | +--------+ | | /\ +------+ +------+ /\ ||Rkey|RKey set| |RNIC 3| SMC-R Link 2 |RNIC 4| |RkeyRKey set| |U,V,W | |MACMC| |MACMC|<-------------------->|MAC MD| | L,M,N,P | | QP 9 |GID GC| (being added) |GID GD| QP 65 | | +------+ +------+ | +-------------------+ +-------------------+ ADDlinkLINK request (QP9,MC,GC, linknumber=2)number = 2) ............................................> ADDlinkLINK response (QP65,MD,GD, linknumber=2)number = 2) <............................................ ADDlink continuationLINK CONTINUATION req(RTokenPairs=((X,U),(Y,V),(Z,W)))pairs=((X,U),(Y,V),(Z,W))) ............................................> ADDlink continuationLINK CONTINUATION rsp(RTokenPairs=((Q,L),(R,M),(S,N),(T,P)))pairs=((Q,L),(R,M),(S,N),(T,P))) <.............................................Confirm Link Req/RspCONFIRM LINK req/rsp exchange onlinkLink 2 <.............................................> Legend: ------------ TCP/IP and CLC flows ............ RoCE (LLC) flows Figure1515: ExchangingRkeysRKeys when anew link is addedNew Link Is Added to alink groupLink Group 3.5.5.3. Serialization of LLCexchanges,Exchanges, andcollisionsCollisions LLC flows can be divided into two main groups forserializaionserialization considerations. The first group is LLC messages that are independent and can flow at any time. These are one-time, unsolicited messages that either do not have a requiredresponse,response orthathave a simple response that does not interfere with the operations of another group of messages. These messagesare:are as follows: o TEST LINK from either the client or the server: This message requires a TEST LINK response to bereturned,returned but does not affect the configuration of the link group or theRkeys.RKeys. o ADD LINK from the client to the server: This message is provided as an "FYI" to the server to let it know that the client has an additional RNIC available. The server is not required to act upon or respond to this message. oDELETE_LINKDELETE LINK from the client to the server: This message informs the server that either (1) the client haseitherexperienced an error or problem that requires a link or link group to beterminated,terminated orthat(2) an operator has commanded that a link or link group be terminated. The server does not respond directly to themessage, rathermessage; rather, it initiates a DELETE LINK exchange as a result of receiving it. o DELETE LINK from the server to theclientclient, with the "delete entire link group" flag set: This message informs the client that the entire link group is being deleted. The second group is LLC messages that are part of an exchange of LLC messages that affects link groupconfiguration thatconfiguration; this exchange must complete before another exchange of LLC messages that affects link group configuration can be processed. When a peer knows that one of these exchanges is in progress, it must not start another exchange. These exchangesare:are as follows: o ADD LINK / ADD LINK response / ADD LINK CONTINUATION / ADD LINK CONTINUATION response / CONFIRM LINK / CONFIRM LINKRESPONSE:response: This exchange, by adding a new link, changes the configuration of the link group. o DELETE LINK / DELETE LINK response initiated by theserver:server, without the "delete entire link group" flag set: This exchange, by deleting a link, changes the configuration of the link group. o CONFIRM RKEY / CONFIRM RKEY response or DELETE RKEY / DELETE RKEY response: This exchange changes the RMB configuration of the link group. RKeyscan notcannot change while links are being added or deleted (while an ADD LINK or DELETE LINK is in progress). However, CONFIRM RKEY and DELETE RKEY are unique in that both the client and server can independently manage (add or remove) their own RMBs. This allows each peer to concurrently change their RKeys and therefore concurrently send CONFIRM RKEY or DELETE RKEY requests. The concurrent CONFIRM RKEY or DELETE RKEY requests can be independently processed and do not represent acollisioncollision. Because the server is in control of the configuration of the link group, many timing windows and collisions areavoidedavoided, but there are still some that must be handled. 3.5.5.3.1. Collisions with ADD LINK / CONFIRM LINKexchangeExchange Colliding LLC message: TEST LINK Action to resolve: Send immediate TEST LINKreplyreply. Colliding LLCMessage:message: ADD LINK from client to server Action to resolve: Server ignores the ADD LINK message. When client receives server's ADD LINK, client will consider that message to be in response to its ADD LINK message and the flow works. Since both client and server know not to start this exchange if an ADD LINK operation is already underway, this can only occur if the client sends this message before receiving the server's ADD LINK and this message crosses with the server's ADD LINKmessage, thereforemessage; therefore, the server's ADD LINK arrives at the client immediately after the client sent this message. Colliding LLCMessage:message: DELETE LINK from client to server, specific link specified Action to resolve: Server queues the DELETElinkLINK message and processes it after the ADD LINK exchange completes. If it is an orderly link termination, it can wait until after this exchange continues. If it is disorderly and the link affected is the one that the current exchange is using, the server will discover the outage when a message in this exchange fails. Colliding LLCMessage:message: DELETE LINK from client to server, entire link group to be deleted Action to resolve: Immediately clean up the linkgroupgroup. Colliding LLC message: CONFIRM RKEY fromtheclient Action to resolve: Send a negativeCONFIRM_RKEYCONFIRM RKEY response to the client. Once the current exchange finishes, client will have to recompute itsRkeyRKey set to include the newlink,link and then start a new CONFIRM RKEY exchange. 3.5.5.3.2. Collisions during DELETE LINKexchangeExchange Colliding LLCMessage:message: TEST LINK from either peer Action to resolve: Send immediate TEST LINKresponseresponse. Colliding LLC message: ADDLNKLINK from client to server Action to resolve: Server queues the ADD LINK and processes it after the current exchangecompletescompletes. Colliding LLC message: DELETE LINK from client to server (specific link) Action to resolve: Server queues the DELETElinkLINK message and processes it after the current exchange completes. If it is an orderly link termination, it can wait until after this exchange continues. If it is disorderly and the link affected is the one that the current exchange is using, the server will discover the outage when a message in this exchangefailsfails. Colliding LLC message: DELETE LINK from either client or server, deleting the entire link group Action to resolve:immediatelyImmediately clean up the linkgroupgroup. Colliding LLC message:CONFIRM_RKEYCONFIRM RKEY from client to server Action to resolve: Send a negativeCONFIRM_RKEYCONFIRM RKEY response to the client. Once the current exchange finishes, client will have to recompute itsRkeyRKey set to include the newlink,link and then start a new CONFIRM RKEYexchangeexchange. 3.5.5.3.3. Collisions duringCONFIRM_RKEY exchangeCONFIRM RKEY Exchange Colliding LLCMessage:message: TEST LINK Action to resolve: Send immediate TEST LINKreplyreply. Colliding LLC message: ADD LINK from client to server Action to resolve: Queue the ADDLINKLINK, and process it after the current exchangecompletescompletes. Colliding LLC message: ADD LINK from server to client (CONFIRM RKEY exchange was initiated by theclientclient, and it crossed with the server initiating an ADD LINK exchange) Action to resolve: Process the ADD LINK. Client will receive a negative CONFIRM RKEY from the server and will have to redo this CONFIRM RKEY exchange after the ADD LINK exchange completes. Colliding LLC message: DELETE LINK from client to server, specific link to be deleted (CONFIRM RKEY exchange was initiated by theserverserver, and it crossed with the client's DELETE LINKrequestrequest) Action to resolve: Server queues the DELETElinkLINK message and processes it after theADD LINKCONFIRM RKEY exchange completes. If it is an orderly link termination, it can wait until after this exchange continues. If it is disorderly and the link affected is the one that the current exchange is using, the server will discover the outage when a message in this exchange fails. Colliding LLC message: DELETE LINK from server to client, specific link deleted (CONFIRM RKEY exchange was initiated by theclientclient, and it crossed with the server's DELETE LINK) Action to resolve: Process the DELETE LINK. Client will receive a negative CONFIRM RKEY from the server and will have to redo this CONFIRM RKEY exchange after the ADD LINK exchange completes. Colliding LLC message: DELETE LINK from either client or server, entire link group deleted Action to resolve:immediatelyImmediately clean up the linkgroupgroup. Colliding LLC message: CONFIRM LINK from the peer that did not start the current CONFIRM LINK exchange Action to resolve: Queue therequestrequest, and process it after the current exchange completes. 4. SMC-Rmemory sharing architectureMemory-Sharing Architecture 4.1. RMBelement allocation considerationsElement Allocation Considerations Each TCP connection using SMC-R must be allocatedaan RMBE by eachSMC- RSMC-R peer. This allocation is performed by eachend pointendpoint independently to allow eachend pointendpoint to select an RMBE that best matches the characteristics on its TCP socketend point.endpoint. The RMBE associated with a TCP socket endpoint must have aReceivereceive buffer that is at least as large as the TCP receive buffer size in effect for that connection. The receive buffer size can be determined by what is specified explicitly by the application using setsockopt() or implicitly via thesystem configuredsystem-configured default value. This will allow sufficient data to beRDMA writtenRDMA-written by the SMC-R peer to fill an entire receive buffersizesize's worth of data on a given data flow. Given that each RMB must havefixed length RMBEsfixed-length RMBEs, this implies that an SMC-Rend pointendpoint may need to maintain multiple RMBs of various sizes for SMC-R connections on a givenSMCSMC-R link and can then select an RMBE that most closely fits a connection. 4.2. RMB and RMBEformatFormat An RMB is a virtual memory buffer whose backing real memory ispinned, whichpinned. The RMB isdividedsubdivided into a whole number ofequal sizedequal-sized RMB Elements (RMBEs). Each RMBE begins with afour byte4-byte eye catcher for diagnostic and service purposes, followed by the receive data buffer. The contents of this diagnosticeyecatchereye catcher are implementation dependent and should be used by the local SMC-R peer to check for overlay errors by verifying an intacteyecatchereye catcher with every RMBE access. The RMBE is a wrapping receive buffer for receiving RDMA writes from the peer. Cursors, as described below, are exchanged between peers to manage and track RDMA writes and local data reads from the RMBE for a TCP connection. 4.3. RMBEcontrol informationControl Information RMBE control information consists of consumerandcursors, producer cursors, wrap counts, CDC message sequence numbers, control flags such as urgent data andwriter blocked"writer blocked" indicators, and TCP connection information such as termination flags. This information is exchanged between SMC-R peers using CDC messages, which are passed usingRDMA message passing with inline data, with the control information contained in the inline data.RoCE SendMsg. A TCP/IP stack implementing SMC-R must receive and store this information in its internal datastructuresstructures, as it is used to manage the RMBE and its data buffer. The format and contents of the CDC messageisare described in detail in4.3. RMBE control information.Appendix A.4 ("Connection Data Control (CDC) Message Format"). The following is ahigh levelhigh-level description of what this control information contains. o Connection state flags such as sending done, connection closed, failover data validation, and abnormalcloseclose. o A sequence number that is managed by the sender. This sequence number starts at 1, is increased each send, and wraps to 0. This sequence number tracks the CDC message sent and is not related to the number of bytes sent. It is used for failover data validation. o Producer cursor: a wrapping offset into the receiver's RMBE data area. Set by the peer that is writing into the RMBE, it points to where the writing peer will write the next byte of data into an RMBE. This cursor is accompanied by a wrap sequence number to help the RMBE owner (the receiver) identify full window size wrapping writes. Note that this cursor must account for (i.e., skip over) the RMBEeyecatchereye catcher that is in the beginning of the data area. o Consumer cursor: a wrapping offset into the receiver's RMBE data area. Set by the owner of the RMBE (the peer that is reading from it), this cursor points to the offset of the next byte of data to be consumed by the peer in its own RMBE. The sender cannot write beyond this cursor into the receiver's RMBE without causing data loss. Like the producer cursor, this is accompanied by a wrap count to help the writer identify full window size wrapping reads. Note that this cursor must account for (i.e., skip over) the RMBEeyecatchereye catcher that is in the beginning of the data area. o Data flags such as urgent data, writer blocked indicator, and cursor update requests. 4.4. Use of RMBEs 4.4.1. Initializing andaccessingAccessing RMBEs The RMBEeyecatchereye catcher is initialized by the RMB owner prior to assigning it to a specific TCP connection and communicating its RMB index to the SMC-R partner. After an RMBE index is communicated to the SMC-Rpartnerpartner, the RMBE can only be referenced in"read only"read-only mode" by theownerowner, and all updates to it are performed by the remote SMC-R partner via RDMA write operations. Initialization of an RMBE must include the following: o Zeroing out the entire RMBE receive buffer, which helps minimize data integrity issues(e.g.(e.g., data from a previous connection somehow being presented to the current connection). o Setting the beginning RMBE eye catcher. This eye catcher plays an important role in helping detect accidental overlays of the RMBE. The RMB ownermustshould always validate these eye catchers before each new reference to the RMBE. If the eye catchers are found to becorruptedcorrupted, the local host must reset the TCP connection associated with this RMBE and log the appropriate diagnostic information. 4.4.2. RMBelement reuseElement Reuse andconflict resolutionConflict Resolution RMB elements can be reused once their associated TCP and SMC-R connections are terminated. Under normal and abnormal SMC-R connection terminationprocessingprocessing, both SMC-R peers must explicitly acknowledge that they are done using an RMBE before that element can be freed and reassigned to another SMC-R connection instance. For more details on SMC-R connectionterminationtermination, refer tosectionSection 4.8. However, there are some error scenarios where this2 waytwo-way explicitacknowledgementacknowledgment may not be completed. In thesescenarios (mentioned explicitly elsewhere in this document)scenarios, an RMBE owner maychosechoose tore- assignreassign this RMBE to a new SMC-R connection instance on thisSMCSMC-R link group. When thisoccursoccurs, the partner SMC-R peer must detect this condition during SMC-RrendezvousRendezvous processing when presented with an RMBE that it believes is already in use for a different SMC-R connection. In this case, the SMC-R peer must abort the existing SMC-R connection associated with this RMBE. The abort processingResetsresets the TCP connection (if it is stillactive)active), but it must not attempt to perform any RDMA writes to this RMBE and must also ignore any data sitting in the local RMBE associated with the existing connection. It then proceeds to free up the local RMBE and notify the local application that the connection is being abnormally reset. The remote SMC-R peer then proceeds to normal processing for this new SMC-R connection. 4.5. SMC-Rprotocol considerationsProtocol Considerations The following sections describe considerations for the SMC-R protocol as compared tothe TCP protocol.TCP. 4.5.1. SMC-Rprotocol optimized window size updatesProtocol Optimized Window Size Updates An SMC-R receiver host sends itsConsumer Cursorconsumer cursor information to the sender to convey the progress that the receiving application has made in consuming the sent data. The difference between the writer'sProducer Cursorproducer cursor and the associated receiver'sConsumer Cursorconsumer cursor indicates the window size available for the sender to write into. This is somewhat similar to TCP window update processing and therefore has some similar considerations, such as silly window syndrome avoidance, wherebytheTCPprotocolhas an optimization that minimizes the overhead of very small, unproductive window size updates associated withsub-optimalsuboptimal socket applications consuming very smallamountamounts of data on every receive() invocation. For SMC-R, the receiver only updates itsConsumer Cursorconsumer cursor via a unique CDC message under the following conditions: o The current window size (from a sender's perspective) is less than half of theReceive Buffer spacereceive buffer space, and theConsumer Cursorconsumer cursor update will result in a minimum increase in the window size of 10% of theReceivereceive buffer space. Some examples: a. ReceiveBufferbuffer size: 64K,Currentcurrent window size (from a sender's perspective): 50K. No need to update theConsumer Cursor.consumer cursor. Plenty of space is available for the sender. b. ReceiveBufferbuffer size: 64K,Currentcurrent window size (from a sender's perspective): 30K,Currentcurrent window size from a receiver's perspective: 31K. No need to update theConsumer Cursor;consumer cursor; even though the sender's window size is < 1/2 of the 64K, the window update would only increase that by1K1K, which is < 1/10th of the 64K buffer size. c. ReceiveBufferbuffer size: 64K,Currentcurrent window size (from a sender's perspective): 30K,Currentcurrent window size from a receiver's perspective: 64K. The receiver updates theConsumer Cursorconsumer cursor (sender's window size is < 1/2 of the64K,64K; the window update would increase that by > 6.4K). o The receiver must always include aConsumer Cursorconsumer cursor update whenever it sends a CDC message to the partner for another flow(i.e.(i.e., send flow in the opposite direction). This allows the window size update to be delivered with no additional overhead. This is somewhat similar to TCP DelayAck processing and quite effective for request/response data patterns. o If a peer has set the B-bit in a CDCmessagemessage, then any consumption of data by the receiver causes a CDC message to besentsent, updating the consumer cursor untilthata CDC message with that bit cleared is received from the peer. o The optimized window size updates are overridden when the sender sets the Consumer Cursor Update Requested flag in a CDC message to the receiver. When this indicator isonon, the consumer must send aConsumer Cursorconsumer cursor update immediately when data is consumed by the local application or if the cursor has not been updated for a while(i.e.(i.e., local copy of the consumer cursor does not match the last consumer cursor value sent to thethepartner). This allows the sender to perform optional diagnostics for detecting a stalled receiver application (data has been sent but not consumed). It is recommended that the Consumer Cursor Update Requested flag only be sent for diagnosticproceduresprocedures, as it may result in non-optimal data path performance. 4.5.2. Smalldata sendsData Sends The SMC-R protocol makes no special provisions for handling small data segments sent across a stream socket. Data is always sent if sufficient window space is available.ThereIn contrast to the TCP Nagle algorithm, there are no special provisions in SMC-R for coalescing small datasegments, similar to the TCP Nagle algorithm.segments. An implementation of SMC-Rmaycan be configured to optimize its sending processing by coalescing outbound data for a given SMC-R connection so that it can reduce the number of RDMA write operations itperformedperforms, in asimilarfashion similar to Nagle's algorithm. However, any such coalescing would require a timer on the sending host that would ensure that data was eventually sent.AndAlso, the sending host would have to opt out of this processing if Nagle's algorithm had been disabled (programmatically or via system configuration). 4.5.3. TCP KeepaliveprocessingProcessing TCP keepalive processing allows applications to direct the local TCP/IP host to periodically "test" the viability of an idle TCP connection. Since SMC-R connections havebotha TCP representation along with an SMC-Rrepresentationrepresentation, there are unique keepalive processing considerations: oSMC-R layerSMC-R-layer keepalive processing: If keepalive is enabled for an SMC-Rconnectionconnection, the local host maintains a keepalive timer that reflects how long an SMC-R connection has been idle. The local host also maintains a timestamp of last activity for eachSMCSMC-R link (for any SMC-R connection on that link). When it is determined that an SMC-R connection has been idle longer than the keepaliveintervalinterval, the host checks to see whether or not the SMC-R link has been idle for a duration longer than the keepalive timeout. If both conditions are met, the local host then performs aTest LinkTEST LINK LLC command to test the viability of theSMCSMC-R link over the RoCE fabric (RC-QPs). If aTest LinkTEST LINK LLC command response is received within a reasonable amount oftimetime, then the link is consideredviableviable, and all connections using this link are considered viable as well.If howeverIf, however, a response is not received in a reasonable amount of time or there's a failure in sending theTest LinkTEST LINK LLCcommandcommand, then this is considered a failure in theSMC linkSMC-R link, and failover processing to an alternateSMCSMC-R link must be triggered. If no alternateSMCSMC-R link exists in theSMCSMC-R linkgroupgroup, then all of the SMC-R connections on this link are abnormally terminated by resetting the TCP connections represented by these SMC-R connections. Given that multiple SMC-R connections can share the sameSMCSMC-R link, implementing anSMC link levelSMC-R link-level probe using theTest LinkTEST LINK LLC command will help reduce the amount of unproductive keepalive traffic for SMC-R connections; as long as some SMC-R connections on a givenSMCSMC-R link are active(i.e.(i.e., have had I/O activity within the keepaliveinterval)interval), then there is no need to perform additional link viability testing. oTCP layer keepalivesTCP-layer keepalive processing: Traditional TCP "keepalive" packets are not as relevant for SMC-Rconnectionsconnections, given that the TCP path is not used for these connections once the SMC-RrendezvousRendezvous processing is completed. All SMC-R connections by default have associated TCP connections that are idle. Are TCP keepalive probes still needed for these connections? There are two main scenarios to consider: 1. TCP keepalives that are used to determine whether or not the peer TCP endpoint is still active. This is not needed for SMC-Rconnectionsconnections, as theSMC-R levelSMC-R-level keepalives mentioned above will determine whether or not the remote endpoint connections are still active. 2. TCP keepalives that are used to ensure that TCP connections traversing an intermediate proxy maintain an active state. For example, stateful firewalls typically maintain state representing every valid TCP connection that traverses the firewall. These types of firewalls are known to expire idle connections by removing their state in the firewall to conserve memory. TCP keepalives are often used in this scenario to prevent firewalls from timing out otherwise idle connections. When using SMC-R, bothend pointsendpoints must reside in the samelayerLayer 2 network(i.e.(i.e., the same subnet). As a result, firewallscan notcannot be injected in the path between two SMC-R endpoints. However, other intermediate proxies, such asTCP/IP layerTCP/IP-layer loadbalancersbalancers, may be injected in the path of two SMC-R endpoints. These types of load balancers also maintain connection state so that they can forward TCP connection traffic to the appropriate clusterend point.endpoint. When usingSMC-RSMC-R, these TCP connections will appear to be completelyidleidle, making them susceptible to potential timeouts at theLBload-balancing proxy. As a result, for this scenario, TCP keepalives may still be relevant. The following are theTCP levelTCP-level keepalive processing requirements forSMC-R enabledSMC-R-enabled hosts: o SMC-R peers should allow TCP keepalives to flow on the TCP path of SMC-R connections based on existing TCP keepalive configuration and programming options. However, it is strongly recommended that platforms provide the ability to specify very granular keepalive timers (for example,single digit secondsingle-digit-second timers) and should consider providing a configuration option that limits the minimum keepalive timer that will be used forTCP layerTCP-layer keepalives on SMC-R connections. This is important to minimize the amount of TCP keepalive packets transmitted in the network for SMC-R connections. o SMC-R peers must always respond to inboundTCP layerTCP-layer keepalives (by sending ACKs for these packets) even if the connection is using SMC-R. Typically, once a TCP connection has completed the SMC-RrendezvousRendezvous processing and is using SMC-R for data flows, no new inbound TCP segments are expected on that TCPconnectionconnection, other than TCP termination segments (FIN, RST,etc).etc.). TCP keepalives are the one exception that must be supported.AndAlso, since TCP keepalive probes do not carry anyapplication layer dataapplication-layer data, this has no adverse impact on the application's inbound data stream. 4.6. TCPconnection failoverConnection Failover between SMC-RlinksLinks A peer may change which SMC-R link within a link group it sends its writes over in the event of a link failure. Since each peer independently chooses which link to send writes over for a specific TCP connection, this process is done independently by each peer. 4.6.1. Validatingdata integrityData Integrity Even though RoCE is a reliabletransporttransport, there is a small subset of failure modes that could cause unrecoverable loss of data. When an RNIC acknowledges receipt of an RDMA write to its peer, that creates a write completion event to the sending peer, which allows the sender to release any buffers it is holding for that write. In normal operation and in most failures, this operation is reliable.HoweverHowever, there are failure modes possible in which a receiving RNIC has acknowledged an RDMA write but then was not able to place the received data into its hostmemory,memory -- forexampleexample, a sudden, disorderly failure of the interface between the RNIC and the host. While rare, these types of events must be guarded against to ensure data integrity. The process for switching SMC-R links duringfailover that isfailover, as described in thissectionsection, guards against thispossibility,possibility and is mandatory. Each peer must track the current state of the CDC sequence numbers for a TCP connection. The sender must keep track ofSS, which isthe sequence number of the CDC message that described the last write acknowledged by the peerRNIC.RNIC, or Sequence Sent (SS). In other words, SS describes the last write that the sender believes its peer has successfully received. The receiver must keep track ofSR,the sequence number of the CDC message that described the last write that it has successfullyreceived, i.e.,received (i.e., the data has been successfully placed into anRMBE.RMBE), or Sequence Received (SR). When an RNIC fails and the sender changes SMC-R links, the sender must first send a CDC message with the'F' flagF-bit (failover validation indicator; see Appendix A.4) set over the newSMC- RSMC-R link. This is the failover data validation message. The sequence number in this CDC message is equal to SS. The CDC message key, the length, and the SMC-R alert token are the only other fields in this CDC message that are significant. No reply is expected from this validation message, and once the sender has sent it, the sender may resume sending on the new SMC-R link as described in Section 4.6.2.belowUpon receipt of the failover validation message, the receiver must verify that its SR value for the TCP connection is equal to or greater than the sequence number in the failover validation message. If so, no further action isrequiredrequired, and the TCP connection resumes on the new SMC-R link. If SR is less than the sequence number value in the validation message, data has beenlostlost, and the receiver must immediately reset the TCP connection. 4.6.2. Resuming the TCPconnectionConnection on anew SMCR linkNew SMC-R Link When a connection is moved to a new SMC-R link and the failover validation message has been sent, the sender can immediately resume normal transmission. In order to preserve the application messagestreamstream, the sender must replay any RDMA writes (and their associated CDC messages) that were in progress or failed when the previous SMC-R link failed, before sending new data on the new SMC-R link. The sender has two options for accomplishing this: o Preserve the sequence numbers "as is": Retry all failed and pending operations as they were originally done, including reposting all associated RDMA write operations and their associated CDC messages without making any changes. Then resume sending new data using new sequence numbers. o Combine pending messages and possibly add new data: Combine failed and pending messages into a single new write with a new sequence number. This allows the sender to combine pending messages into fewer operations. As a furtheroptimizationoptimization, this write can also include new data, as long as all failed and pending dataisare also included. If this approach is taken, the sequence number must be increased beyond the last failed or pending sequence number. 4.7. RMBdata flowsData Flows The following sections describe the RDMA wire flows for the SMC-R protocol after a TCP connection has switched into SMC-R mode(i.e.(i.e., SMC-RrendezvousRendezvous processing is complete and a pair of RMB elements has been assigned and communicated by the SMC-R peers). The ladder diagrams below include the following: o RMBE control information kept by each peer. Only a subset of the information is depicted, specifically only the fields that reflect the stream of data written by Host A and read by Host B. o Time line0-x that0-x, which shows the wire flows in atime relative fashiontime-relative fashion. o Note that RMBE control information is only shown in a time interval if its value changed(otherwise(otherwise, assume that the value is unchanged from the previously depictedvalue)value). o The local copy of the producer cursors and consumer cursors that is maintained by each host is not depicted in these figures. Note that the cursor values in the diagram reflect the necessity of skipping over theeyecatchereye catcher in the RMBE data area. They start and wrap at 4, not 0. 4.7.1. Scenario 1: Sendflow, window size unconstrainedFlow, Window Size Unconstrained SMC Host A SMCHostBHost B RMBE A Info RMBE B Info (Consumer Cursors) (Producer Cursors) Cursor Wrap Seq# Time Time Cursor Wrap Seq# Flags 4 0 0 0 4 0 0 0 0 1 ---------------> 1 0 0 0 RDMA-WR Data (4:1003) 4 0 2 ...............> 2 1004 0 0 CDC Message Figure1616: Scenario 1: Sendflow, window size unconstrainedFlow, Window Size Unconstrained Scenario assumptions: o Kernelimplementationimplementation. o New SMC-Rconnection,connection; no data has been sent on theconnectionconnection. o Host A: Application issues send for1,0001000 bytes to HostBB. o Host B: RMBE receive buffer size is10,000,10,000; application has issued a recv for 10,000bytesbytes. Flow description: 1.ApplicationThe application issues a send() for1,000 bytes,1000 bytes; the SMC-R layer copies data into a kernel send buffer. It then schedules an RDMA write operation to move the data into the peer's RMBE receive buffer, at relative position 4-1003 (to skip thefour byte eyecatcher4-byte eye catcher in the RMBE data area). Note that no immediate data or alert(i.e.(i.e., interrupt) is provided tohostHost B for this RDMA operation. 2. Host A sends a CDC message to update theProducer Cursorproducer cursor to byte 1004. This CDC message will deliver an interrupt to Host B. At this point, the SMC-R layer can return control back to the application. Host B, once notified of the completion of the previous RDMA operation, locates the RMBE associated with the RMBE alert token that was included in the message and proceeds to perform normalreceive sidereceive-side processing, waking up the suspended application read thread, copying the data into the application's receive buffer, etc. It will use theProducer Cursorproducer cursor as an indicator of how much data is available to be delivered to the local application. After this processing is complete, the SMC-R layer will also update its localConsumer Cursorconsumer cursor to match theProducer Cursor (i.e.producer cursor (i.e., indicating that all data has been consumed). Note that a message to the peer updating theConsumer Cursorconsumer cursor is not needed at thistimetime, as the window sizeifis unconstrained (> 1/2 of the receive buffer size). The window size is calculatedusingby taking the difference between theProducerproducer cursor and theConsumer cursorsconsumer cursor in the RMBEs(10,000-1,004=8,996).(10,000 - 1004 = 8996). 4.7.2. Scenario 2: Send/Receiveflow, window unconstrainedFlow, Window Size Unconstrained SMC Host A SMCHostBHost B RMBE A Info RMBE B Info (Consumer Cursors) (Producer Cursors) Cursor Wrap Seq# Time Time Cursor Wrap Seq# Flags 4 0 0 0 4 0 0 0 0 1 ---------------> 1 0 0 0 RDMA-WR Data (4:1003) 4 0 2 ...............> 2 1004 0 0 CDC Message 0 0 3 <-------------- 3 1004 0 0 RDMA-WR Data (4:503) 1004 0 4 <.............. 4 1004 0 0 CDC Message Figure1717: Scenario 2:Send/Recv flow, window size unconstrainedSend/Receive Flow, Window Size Unconstrained Scenario assumptions: o New SMC-Rconnection,connection; no data has been sent on theconnectionconnection. o Host A: Application issues send for1,0001000 bytes to HostBB. o Host B: RMBE receive buffer size is10,000,10,000; application has already issued a recv for 10,000 bytes. Once the receive is completed, the application sends a500 byte500-byte response to Host A. Flow description: 1.ApplicationThe application issues a send() for1,000 bytes,1000 bytes; the SMC-R layer copies data into a kernel send buffer. It then schedules an RDMA write operation to move the data into the peer's RMBE receive buffer, at relative position 4-1003. Note that no immediate data or alert(i.e.(i.e., interrupt) is provided tohostHost B for this RDMA operation. 2. Host A sends a CDC message to update theProducer Cursorproducer cursor to byte 1004. This CDC message will deliver an interrupt to Host B. At this point, the SMC-R layer can return control back to the application. 3. Host B, once notified of the receipt of the previous CDC message, locates the RMBE associated with the RMBE alert token and proceeds to perform normalreceive sidereceive-side processing, waking up the suspended application read thread, copying the data into the application's receive buffer, etc. After this processing is complete, the SMC-R layer will also update its localConsumer Cursorconsumer cursor to match theProducer Cursor (i.e.producer cursor (i.e., indicating that all data has been consumed). Note that an update of theConsumer Cursorconsumer cursor to the peer is not needed at thistimetime, as the window size is unconstrained (> 1/2 of the receive buffer size). The application then performs a send() for 500 bytes to Host A. The SMC-R layer will copy the data into a kernel buffer and then schedule an RDMAWritewrite into the partner's RMBE receive buffer. Note that this RDMA write operation includes no immediate data or notification to Host A. 4. Host B sends a CDC message to update the partner's RMBEControlcontrol information with the latestProducer Cursorproducer cursor (set to 503 and not shown in the diagram above) and to also inform the peer that theConsumer Cursorconsumer cursor value is now 1004. It also updates the localCurrent Consumer Cursorcurrent consumer cursor andLast Sent Consumer Cursorthe last sent consumer cursor to 1004. This CDC message includesnotificationnotification, since we are updating ourProducer Cursor whichproducer cursor; this requires attention by the peer host. 4.7.3. Scenario 3: Send Flow,window constrainedWindow Size Constrained SMC Host A SMCHostBHost B RMBE A Info RMBE B Info (Consumer Cursors) (Producer Cursors) Cursor Wrap Seq# Time Time Cursor Wrap Seq# Flags 4 0 0 0 4 0 0 4 0 1 ---------------> 1 4 0 0 RDMA-WR Data (4:3003) 4 0 2 ...............> 2 3004 0 0 CDC Message 4 0 3 3 3004 0 0 4 0 4 ---------------> 4 3004 0 0 RDMA-WR Data (3004:7003) 4 0 5 ................> 5 7004 0 0 CDC Message 7004 0 6 <................ 6 7004 0 0 CDC Message Figure1818: Scenario 3: Send Flow,window size constrainedWindow Size Constrained Scenario assumptions: o New SMC-Rconnection,connection; no data has been sent on thisconnectionconnection. o Host A: Application issues send for3,0003000 bytes to Host B and then another send for4,0004000 bytes. o Host B: RMBE receive buffer size is 10,000. Application has already issued a recv for 10,000bytesbytes. Flow description: 1.ApplicationThe application issues a send() for3,000 bytes,3000 bytes; the SMC-R layer copies data into a kernel send buffer. It then schedules an RDMA write operation to move the data into the peer's RMBE receive buffer, at relative position 4-3003. Note that no immediate data or alert(i.e.(i.e., interrupt) is provided tohostHost B for this RDMA operation. 2. Host A sends a CDC message to update itsProducer Cursorproducer cursor to byte 3003. This CDC message will deliver an interrupt to Host B. At this point, the SMC-R layer can return control back to the application. 3. Host B, once notified of the receipt of the previous CDC message, locates the RMBE associated with the RMBE alert token and proceeds to perform normalreceive sidereceive-side processing, waking up the suspended application read thread, copying the data into the application's receive buffer, etc. After this processing is complete, the SMC-R layer will also update its localConsumer Cursorconsumer cursor to match theProducer Cursor (i.e.producer cursor (i.e., indicating that all data has been consumed). It willnot howevernot, however, update the partner with thisinformationinformation, as the window size is not constrained(10000-3000=7000(10,000 - 3000 = 7000 bytes of available space). The application on Host B also issues a new recv() for10,000.10,000 bytes. 4. On Host A, the application issues a send() for4,0004000 bytes. TheSMC- RSMC-R layer copies the data into a kernel buffer and schedules an async RDMA write into the peer's RMBE receive buffer at relative position 3003-7004. Note that no alert is provided tohostHost B for this flow. 5. Host A sends a CDC message to update theProducer Cursorproducer cursor to byte 7004. This CDC message will deliver an interrupt to Host B. At this point, the SMC-R layer can return control back to the application. 6. Host B, once notified of the receipt of the previous CDC message, locates the RMBE associated with the RMBE alert token and proceeds to perform normalreceive sidereceive-side processing, waking up the suspended application read thread, copying the data into the application's receive buffer, etc. After this processing is complete, the SMC-R layer will also update its localConsumer Cursorconsumer cursor to match theProducer Cursor (i.e.producer cursor (i.e., indicating that all data has been consumed). It will then determine whether or not it needs to update theConsumer Cursorconsumer cursor to the peer. The available window size is now3,0003000 (10,000 -(Producer Cursor(producer cursor -Last Sent Consumer Cursor))last sent consumer cursor)), which is < 1/2 of the receive buffer size(10,000/2=5,000)(10,000/2 = 5000), and the advance of the window size is > 10% of thewindowswindow size(1,000). Therefore(1000). Therefore, a CDC message is issued to update theConsumer Cursorconsumer cursor topeerPeer A. 4.7.4. Scenario 4: Largesend, flow control, full window size writesSend, Flow Control, Full Window Size Writes SMC Host A SMCHostBHost B RMBE A Info RMBE B Info (Consumer Cursors) (Producer Cursors) Cursor Wrap Seq# Time Time Cursor Wrap Seq# Flags 1004 1 0 0 1004 1 0 1004 1 1 ---------------> 1 1004 1 0 RDMA-WR Data (1004:9999) 1004 1 2 ---------------> 2 1004 1 0 RDMA-WR Data (4:1003) 1004 1 3 ...............> 3 1004 2 Wrt CDC Message Blk 1004 2 4 <............... 4 1004 2 Wrt CDC Message Blk 1004 2 5 ---------------> 5 1004 2 Wrt RDMA-WR Data Blk (1004:9999) 1004 2 6 ---------------> 6 1004 2 Wrt RDMA-WR Data Blk (4:1003) 1004 2 7 ...............> 7 1004 3 Wrt CDC Message Blk 1004 3 8 <............... 8 1004 3 Wrt CDC Message Blk Figure1919: Scenario 4: Largesend, flow control, full window size writesSend, Flow Control, Full Window Size Writes Scenario assumptions: o Kernelimplementationimplementation. o Existing SMC-R connection, Host B's receive window size is fullyopen(Peer Consumer Cursoropen (peer consumer cursor =Peer Producer Cursor).peer producer cursor). o Host A: Application issues send for 20,000 bytes to HostBB. o Host B:RMBRMBE receive buffer size is10,000,10,000; application has issued a recv for 10,000bytesbytes. Flow description: 1.ApplicationThe application issues a send() for 20,000bytes,bytes; the SMC-R layer copies data into a kernel send buffer (assumes that send buffer space of 20,000 is available for this connection). It then schedules an RDMA write operation to move the data into the peer's RMBE receive buffer, at relative position 1004-9999. Note that no immediate data or alert(i.e.(i.e., interrupt) is provided tohostHost B for this RDMA operation. 2. Host A then schedules an RDMA write operation to fill the remaining 1000 bytes of available space in the peer's RMBE receive buffer, at relative position 4-1003. Note that no immediate data or alert(i.e.(i.e., interrupt) is provided tohostHost B for this RDMA operation. Also note that an implementation of SMC-R may optimize this processing by combiningstepsteps 1 and 2 into a single RDMAWritewrite operation (with2two different data sources). 3. Host A sends a CDC message to update theProducer Cursorproducer cursor to byte 1004. Since the entire receive buffer space is filled, theProducer Writer Blockedproducer writer blocked flag(WrtBlk(the "Wrt Blk" indicatorabove)(flag) in Figure 19) is set and theProducer Window Wrap Sequence Number (Producer WrapSeq# above)producer cursor wrap sequence number (the producer "Wrap Seq#" in Figure 19) is incremented. This CDC message will deliver an interrupt to Host B. At this point, the SMC-R layer can return control back to the application. 4. Host B, once notified of the receipt of the previous CDC message, locates the RMBE associated with the RMBE alert token and proceeds to perform normalreceive sidereceive-side processing, waking up the suspended application read thread, copying the data into the application's receive buffer, etc. In this scenario, Host B notices that theProducer Cursorproducer cursor has not been advanced (same value asConsumer Cursor),the consumer cursor); however, it notices that theProducer Window Wrap Size Sequenceproducer cursor wrap sequence number is different from its local value(1)(1), indicating that a full window of new data is available. All of the data in the receive buffer can be processed, with the first segment (1004-9999) followed by the second segment(4- 1003).(4-1003). Because theProducer Writer Blockedproducer writer blocked indicator was set, Host B schedules a CDC message to update its latest information to the peer:Consumer Cursorconsumer cursor (1004),Consumer Window Wrap Size Sequence Number (2: theconsumer cursor wrap sequence number (the currentProducer Window Wrap Sequence Numbervalue of 2 is used). 5. Host A, upon receipt of the CDCmessagemessage, locates the TCP connection associated with the alerttoken, andtoken and, upon examining the control informationprovidedprovided, notices that Host B has consumed all of the data (based on theConsumer Cursorconsumer cursor and theConsumer Window Wrap Size Sequenceconsumer cursor wrap sequence number) and initiates the next RDMA write to fill the receive buffer at offset 1003-9999. 6. Host A then moves the next 1000 bytes into the beginning of the receive buffer (4-1003) by scheduling an RDMA write operation. Note that at this point there are still 8 bytes remaining to be written. 7. Host A then sends a CDC message to set theProducer Writer Blockedproducer writer blocked indicator and to increment theProducer Window Wrap Size Sequence Numberproducer cursor wrap sequence number (3). 8. Host B, uponnotificationnotification, completes the same processing as step 4 above, including sending a CDC message to update the peer to indicate that all data has been consumed. At thispointpoint, Host A can write the final 8utesbytes tohostHost B's RMBE into positions1004- 10111004-1011 (not shown). 4.7.5. Scenario 5: Sendflow, urgent data, window size unconstrainedFlow, Urgent Data, Window Size Unconstrained SMC Host A SMCHostBHost B RMBE A Info RMBE B Info (Consumer Cursors) (Producer Cursors) Cursor Wrap Seq# Time Time Cursor Wrap Seq# Flag 1000 1 0 0 1000 1 0 1000 1 1 ---------------> 1 1000 1 0 RDMA-WR Data (1000:1499) 1000 1 2 ...............> 2 1500 1 UrgP CDC Message UrgA 1500 1 3 <............... 3 1500 1 UrgP CDC Message UrgA 1500 1 4 ---------------> 4 1500 1 UrgP RDMA-WR Data UrgA (1500:2499) 1500 1 5 ...............> 5 2500 1 0 CDC Message Figure2020: Scenario 5:sendSend Flow,urgent data, window size openUrgent Data, Window Size Open Scenario assumptions: o Kernelimplementationimplementation. o Existing SMC-Rconnection,connection; window sizeopen,open (unconstrained); all data has been consumed by receiver. o Host A: Application issues send for 500 bytes with urgent data indicator(OOB)(out of band) to Host B, then sends 1000 bytes of normaldatadata. o Host B: RMBEReceivereceive buffer size is10,000,10,000; application has issued a recv for 10,000 bytes and is also monitoring the socket for urgentdatadata. Flow description: 1.ApplicationThe application issues a send() for 500 bytes of urgentdata.data; the SMC-R layer copies data into a kernel send buffer. It then schedules an RDMA write operation to move the data into the peer's RMBE receive buffer, at relative position 1000-1499. Note that no immediate data or alert(i.e.(i.e., interrupt) is provided tohostHost B for this RDMA operation. 2. Host A sends a CDC message to update itsProducer Cursorproducer cursor to byte 1500 and to turn on theProducerproducer Urgent Data Pending (UrgP) and Urgent Data Present (UrgA) flags. This CDC message will deliver an interrupt to Host B. At this point, the SMC-R layer can return control back to the application. 3. Host B, once notified of the receipt of the previous CDC message, locates the RMBE associated with the RMBE alert token, notices that the Urgent Data Pending flag isonon, and proceeds withOut of Bandout-of- band socket APInotification. Fornotification -- for example, satisfying any outstanding select() or poll() requests on the socket by indicating that urgent data is pending(i.e.(i.e., by setting the exception bit on). TheUrgent Data Presenturgent data present indicator allows Host B to also determine the position of the urgent data(Producer(the producer cursor pointsone1 byte beyond the last byte of urgent data). Host B can then perform normalreceive sidereceive-side processing (including specific urgent data processing), copying the data into the application's receive buffer, etc. Host B then sends a CDC message to update the partner's RMBEControlcontrol area with its latestConsumer Cursorconsumer cursor (1500). Note that this CDC message mustoccuroccur, regardless of the current local window size that is available. The partner host (Host A) cannot initiate any additional RDMA writes untilacknowledgementit receives acknowledgment that the urgent data has been processed (or at least processed/remembered at the SMC-R layer). 4. Upon receipt of the message, Host A wakes up, sees that the peer consumed all data up to and including the last byte ofUrgent dataurgent data, and now resumes sending any pending data. In this case, the application had previously issued a send for 1000 bytes of normaldatadata, which would have been copied in the sendbufferbuffer, and control would have been returned to the application. Host A now initiatesaan RDMA write to move that data to thePeer'speer's receive buffer at position 1500-2499. 5. Host A then sends a CDC messagewith inline datato update itsProducer Cursorproducer cursor value (2500) and to turn off the Urgent Data Pending and Urgent Data Present flags. Host B wakes up, processes the new data (resumes application, copies data into the application receivebuffer)buffer), and then proceeds to update theLocallocal current consumer cursor (2500). Given that the window size isunconstrainedunconstrained, there is no need forConsumer Cursora consumer cursor update in the peer's RMBE. 4.7.6. Scenario 6: Sendflow, urgent data, window size closedFlow, Urgent Data, Window Size Closed SMC Host A SMCHostBHost B RMBE A Info RMBE B Info (Consumer Cursors) (Producer Cursors) Cursor Wrap Seq# Time Time Cursor Wrap Seq# Flag 1000 1 0 0 1000 2 Wrt Blk 1000 1 1 ...............> 1 1000 2 Wrt CDC Message Blk UrgP 1000 2 2 <............... 2 1000 2 Wrt CDC Message Blk UrgP 1000 2 3 ---------------> 3 1000 2 Wrt RDMA-WRdata lData Blk (1000:1499) UrgP 1000 2 4 ...............> 4 1500 2 UrgP CDC Message UrgA 1500 2 5 <............... 5 1500 2 UrgP CDC Message UrgA 1500 2 6 ---------------> 6 1500 2 UrgP RDMA-WRdata lData UrgA (1500:2499) 1000 2 7 ...............> 7 2500 2 0 CDC Message Figure2121: Scenario 6: Sendflow, urgent data, window size closedFlow, Urgent Data, Window Size Closed Scenario assumptions: o Kernelimplementationimplementation. o Existing SMC-Rconnection,connection; window sizeclosed,closed; writer is blocked. o Host A: Application issues send for 500 bytes with urgent data indicator(OOB)(out of band) to Host B, then sends 1000 bytes of normal data. o Host B: RMBEReceivereceive buffer size is10,000,10,000; application has no outstanding recv() (for normal data) and is monitoring the socket for urgent data. Flow description: 1.ApplicationThe application issues a send() for 500 bytes of urgentdata.data; the SMC-R layer copies data into a kernel send buffer (if available). Since the writer is blocked (window sizeclosed)closed), it cannot send the data immediately. It then sends a CDC message to notify the peer of the Urgent Data Pending(UrgP)indicator(UrgP) indicator (theWriter Blockedwriter blocked indicator remains on as well). This serves as a signal to Host B that urgent data is pending in the stream. Control is also returned to the application at this point. 2. Host B, once notified of the receipt of the previous CDC message, locates the RMBE associated with the RMBE alert token, notices that the Urgent Data Pending flag isonon, and proceeds withOut of Bandout-of- band socket APInotification. Fornotification -- for example, satisfying any outstanding select() or poll() requests on the socket by indicating that urgent data is pending(i.e.(i.e., by setting the exception bit on). At thispointpoint, it is expected that the application will enter urgent data mode processing, expeditiously processing all normal data (by issuing recv API calls) so that it can get to the urgent data byte. Whether the application has this urgent mode processing or not, at somepointpoint, the application will consume some or all of the pending data in the receive buffer. When this occurs, Host B will also send a CDC messagewith inline datato update itsConsumer Cursorconsumer cursor andConsumer Window Wrap Sequence Numberconsumer cursor wrap sequence number to the peer. In the example above, a fullwindowwindow's worth of data was consumed. 3. Host A, once awakened by themessagemessage, will notice that the window size is now open on this connection (based on theConsumer Cursorconsumer cursor and theConsumer Window Wrap Sequence Numberconsumer cursor wrap sequence number, which now matches theProducer Window Wrap Sequence Number)producer cursor wrap sequence number) and resume sending of the urgent data segment by scheduling an RDMA write into relative position 1000-1499. 4. Host Athethen sends a CDC message to advance itsProducer Cursorproducer cursor (1500) and to also notify Host B of the Urgent Data Present (UrgA) indicator (and turn off theWriter Blockedwriter blocked indicator). This signals to Host B that the urgent data is now in the local receive buffer and that theProducer Cursorproducer cursor points to the last byte of urgent data. 5. Host B wakes up, processes the urgentdata anddata, and, once the urgent data isconsumedconsumed, sends a CDC messagewith inline datato update itsConsumer Cursorconsumer cursor (1500). 6. Host A wakes up, sees that Host B has consumed the sequence number associated with the urgentdatadata, and then initiates the next RDMA write operation to move the 1000 bytes associated with the next send() of normal data into the peer's receive buffer at position(1500-2499).1500-2499. Note thatsend()the send API would have likely completed earlier in the process by copying the 1000 bytes into a send buffer and returning back to theapplicationapplication, even though we could not send any new data until the urgent data was processed and acknowledged by Host B. 7. Host A sends a CDC message to advance itsProducer Cursorproducer cursor to 2500 and to reset the Urgent Data Pending and Urgent Data Present flags. Host B wakes up and processes the inbound data. 4.8. ConnectionterminationTermination Just as SMC-R connections are established using a combination of TCP connection establishment flows and SMC-R protocol flows, the termination of SMC-R connections also uses a similar combination of SMC-R protocol termination flows and normal TCPprotocolconnection termination flows. The following sections describe the SMC-R protocol normal and abnormal connection termination flows. 4.8.1. Normal SMC-Rconnection termination flowsConnection Termination Flows Normal SMC-R connection flows are triggered via the normal stream socket API semantics, namely by the application issuing a close() or shutdown() API. Most applications, after consuming all incoming data and after sending any outbounddatadata, will then issue a close() API to indicate that they are done both sending and receiving data. Some applications, typically a small percentage, make use of the shutdown() API that allowsthenthem to indicate that the application is done sending data, receivingdatadata, or both sending and receiving data. The main use of this API is scenarios where a TCP application wants to alert its partnerend pointendpoint that it is done sendingdata, yetdata but is still receiving data on its socket (shutdown forWrite).write). Issuingshutdownshutdown() for both sending and receiving data is really no different than issuing a close() and can therefore be treated in a similar fashion. Shutdown for read is typically not a very useful operation and in normal circumstances does not trigger any network flows to notify the partner TCPend pointendpoint of this operation. These same trigger points will be used by the SMC-R layer to initiate SMC-Rconnectionsconnection termination flows. The main design point for SMC-R normal connection flows is to use the SMC-R protocol to firstshutdownshut down the SMC-R connection and free up any SMC-R RDMAresourcesresources, and then allow the normal TCP connection termination protocol(i.e.(i.e., FIN processing) to drive cleanup of the TCP connection. This design point is very important in ensuring that RDMA resources such as the RMBEs are only freed and reused when both SMC-Rend pointsendpoints are completely done with their RDMAWritewrite operations to the partner's RMBE. 1 +-----------------+ |-------------->| CLOSED |<-------------| 3D | | | | 4D | +-----------------+ | | | | | 2 | | | V | +----------------+ +-----------------+ +----------------+ |AppFinCloseWait | | ACTIVE | |PeerFinCloseWait| | | | | | | +----------------+ +-----------------+ +----------------+ | | | | | Active Close | 3A | 4A | Passive Close | | V | V | | +--------------+ | +-------------+ | |--<----|PeerCloseWait1| | |AppCloseWait1|--->----| 3C | | | | | | | 4C | +--------------+ | +-------------+ | | | | | | | | 3B | 4B | | | V | V | | +--------------+ | +-------------+ | |--<----|PeerCloseWait2| | |AppCloseWait2|--->----| | | | | | +--------------+ | +-------------+ | | Figure2222: SMC-Rconnection statesConnection States Figure2322 describes the states that an SMC-R connection typically goes through. Note that there are variations to these states that can occur when an SMC-R connection is abnormally terminated, similar in a way to when a TCP connection is reset. The following are thehigh levelhigh-level state transitions for an SMC-R connection: 1. An SMC-R connection begins in the Closed state. This state is meant to reflect an RMBE that is not currently in use (was previously in use but no longerisis, orone thatwas neverallocated)allocated). 2. An SMC-R connection progresses to the Active state once theSMC- R rendezvousSMC-R Rendezvous processing has successfully completed, RMB element indices have beenexchangedexchanged, and SMC-R links have been activated. In this state, the TCP connection is fully established, rendezvous processing has beencompletedcompleted, and SMC-R peers can begin the exchange of data via RDMA. 3. Active close processing (on the SMC-R peer that is initiating the connectiontermination)termination). A. When an application on one of the SMC-R connection peers issues aclose() or shutdown(writeclose(), a shutdown() for write, orboth)a shutdown() for both read and write, the SMC-R layer on that host will initiate SMC-R connection termination processing.FirstFirst, if a close() or shutdown(both) isissuedissued, it will check to see that there's no data in the local RMB element that has not been read by the application. If unread data is detected, the SMC-R connection must be abnormallyreset -reset; for moredetaildetails onthisthis, refer to"SMC-R connection reset".Section 4.8.2 ("Abnormal SMC-R Connection Termination Flows"). If no unread data is pending, it then checks to see whether or not any outstanding data is waiting to be written to thepeerpeer, or if any outstanding RDMA writes for this SMC-R connection have not yet completed. If either of these two scenariosareis true, an indicator that this connection is in a pending close state is saved in internal data structures representing this SMC-Rconnectionconnection, and control is returned to the application. If all data to be written to the partner hascompletedcompleted, this peer will send a CDC message to notify the peer of either the PeerConnectionClosed indicator (close or shutdown for both was issued) or the PeerDoneWriting indicator. This will providestimulusan interrupt totheinform that partner SMC-R peer that the connection is terminating. At thispointpoint, the local side of the SMC-R connection transitions in the PeerCloseWait1statestate, and control can be returned to the application. If this process could not be completed synchronously(close(the pending close condition mentionedabove)above), it is completed when all RDMA writes for data and control cursors have been completed. B. At somepointpoint, the SMC-R peer application (passive close) will consume all incoming data, realize that that partner is done sending data on thisconnectionconnection, and proceed to initiate its own close of the connection once it has completed sending all data from its end. The partner application can initiate this connection termination processing viaaclose() or shutdown() APIs. If the application does so by issuing a shutdown() for write, then the partner SMC-R layer will send a CDC message to notify the peer(active(the active close side) of the PeerDoneWriting indicator. When the "active close" SMC-R peer wakes up as a result of the previous CDC message, it will notice that the PeerDoneWriting indicator is now on and transition to the PeerCloseWait2 state. This state indicates that the peer is done sending data and may still be reading data.TheAt this point, the "active close" peer will alsoat this pointneed to ensure that any outstanding recv() calls for this socket are woken up and remember thatthatno more data is forthcoming on this connection (in case the local connection was shutdown() for writeonly)only). C. This flow is a common transition from3a3A or3b3B above. When the SMC-R peer (passive close) consumes alldata,data and updates all necessary cursors to thepeerpeer, and the application closes its socket (close or shutdown forboth)both), it will send a CDC message to the peer (the active close side) with the PeerConnectionClosed indicator set. At thispointpoint, the connection can transition back to the Closed state if the local application has already closed (or issued shutdown for both) the socket. Once in the Closed state, the RMBE can now be safelybereused for a new SMC-R connection. When the PeerConnectionClosed indicator is turned on, the SMC-R peer is indicating that it is done updating the partner's RMBE. D. ConditionalState:state: If the local application has not yet issued a close() orshutdown(both) yet,shutdown(both), we need to wait until the application doesso (ApplFinWaitState).so. Once it does, the local host will send a CDC message to notify the peer of the PeerConnectionClosed indicator and then transition to the Closed state. 4. Passive close processing (on the SMC-R peer that receives an indication that the partner is closing theconnection)connection). A. Upon receipt ofan inbound RDMA write noticea CDC message, the SMC-R layer will detect that the PeerConnectionClosed indicator or PeerDoneWriting indicator is on. If any outstanding recv() calls arependingpending, they are completed with an indicator that the partner has closed the connection(zero length(zero-length data presented to the application). If there is any pending data to be written and PeerConnectionClosed isonon, then an SMC-R connection reset must be performed. The connection then enters theApplCloseWait1AppCloseWait1 state on the passive close side waiting for the local application to initiate its own closeprocessingprocessing. B. If the local application issues a shutdown() forwritingwriting, then the SMC-R layer will send a CDC message to notify the partner of the PeerDoneWriting indicator and then transition the local side of the SMC-R connection to theApplCloseWait2AppCloseWait2 state. C. When the application issues a close() or shutdown() for both, the local SMC-R peer will send a message informing the peer of the PeerConnectionClosed indicator and transition to the Closed state if the remote peer has also sent the local peer the PeerConnectionClosed indicator. If the peer has not sent the PeerConnectionClosed indicator, we transition into thePeerFinalCloseWaitPeerFinCloseWait state. D. The local SMC-R connection stays in this state until the peer sends the PeerConnectionClosed indicator inour RMBE.a CDC message. When the indicator issentsent, we transition to the Closed state and are then free to reuse this RMBE. Note that each SMC-R peer needs to provide some logic that will prevent being stranded in a termination state indefinitely. For example, if an Active Close SMC-R peer is in a PeerCloseWait (1 or 2) stateawaitingwaiting for the remote SMC-R peer to update its connection terminationstatusstatus, it needs to provide a timer that will prevent it from waiting in that state indefinitely should the remote SMC-R peer not respond to this termination request. This could occur in errorscenarios;scenarios -- for example, if the remote SMC-R peer suffered a failure prior to being able to respond to the termination request or the remote application is not responding to this connection termination request by closing its own socket. This latter scenario is similar to the TCP FINWAIT2state thatstate, which has been known to sometimes cause issues when remote TCP/IP hosts lose track of established connections and neglect to close them. Even though the TCP standards do not mandate atime outtimeout from the TCP FINWAIT2 state, most TCP/IP implementationsimplementassign a timeout for this state. A similar timeout will be required for SMC-R connections. When this timeout occurs, the local SMC-R peer performs TCP reset processing for this connection. However, no additional RDMA writes to the partner RMBE can occur at this point (we have already indicated that we are done updating the peer's RMBE). After the TCP connection isResetreset, the RMBE can be returned to the free pool for reallocation. Seesection 3.2.5Section 4.4.2 for more details. Also note that it is possible to have two SMC-Rend pointsendpoints initiate an Active close concurrently. In thatscenarioscenario, the flows above stillapply,apply; however, bothend pointsendpoints follow the active close path (path 3).4.8.1.1.4.8.2. Abnormal SMC-Rconnection termination flowsConnection Termination Flows Abnormal SMC-R connection termination can occur for a variety of reasons,including:including the following: o The TCP connection associated with an SMC-R connection is reset. Inthe TCP protocolTCP, eitherend pointendpoint can send a RST segment to abort an existing TCP connection when error conditions are detected for the connection or the application overtly requests that the connection be reset. o Normal SMC-R connection termination processing has unexpectedly stalled for a given connection. When the stall is detected (connection termination timeoutcondition)condition), an abnormal SMC-R connection termination flow is initiated. In thesescenariosscenarios, it is very important that resources associated with the affected SMC-R connections are properly cleaned up to ensure that there are no orphaned resources and that resources can reliably be reused for new SMC-R connections. Given that SMC-R relies heavily on the RDMAWritewrite processing, special care needs to be taken to ensure that an RMBE is no longer being used byaan SMC-R peer before logically reassigning that RMBE to a new SMC-R connection. When an SMC-R peer initiates a TCP connectionresetreset, it also initiates an SMC-R abnormal connection flow at the same time. The SMC-R peers explicitly signal their intent to abnormally terminate an SMC-R connection and await explicitacknowledgementacknowledgment that the peer has received this notification and has also completed abnormal connection termination on its end. Note that TCP connection reset processing can occur in parallel to these flows. +-----------------+ |-------------->| CLOSED |<-------------| | | | | | +-----------------+ | | | | | | | |+-----------------++-----------------------+ | | | AnyStatestate | | |1B | (before setting | 2B| | |PeerConnClosedPeerConnectionClosed | | | |Indicatorindicator in | | | |Peer'speer's RMBE) | | |+-----------------++-----------------------+ | | 1A | | 2A | | Active Abort | | Passive Abort | | V V | | +--------------+ +--------------+ | |-------|PeerAbortWait | | Process Abort|------| | | | | +--------------+ +--------------+ Figure2323: SMC-Rabnormal connection termination state diagramAbnormal Connection Termination State Diagram Figure2423 above shows the SMC-R abnormal connection termination state diagram: 1. Active abort designates the SMC-R peer that is initiating the TCP RST processing. At the time that the TCP RST issentsent, the active abort side must also do the following: A. Send the PeerConnAbort indicator to the partnervia RDMA messaging with inline datain a CDC message, and then transition to the PeerAbortWait state. During thisstatestate, it will monitor thisSMC- RSMC-R connection waiting for the peer to send its corresponding PeerConnAbort indicator but will ignore any other activity in this connection(i.e.(i.e., new incoming data). It will alsosurfacegenerate an appropriate error to any socket API calls issued against this socket(e.g.(e.g., ECONNABORTED,ECONNRESET, etc.)ECONNRESET). B. Once the peer sends the PeerConnAbort indicator to the local host, the local host can transition this SMC-R connection to the Closed state and reuse this RMBE. Note that the SMC-R peer that goes into theActiveactive abort state must provide some protection against staying in that state indefinitely should the remoteSMC- RSMC-R peer not respond by sending its own PeerConnAbort indicator to the local host. While this should be a rarescenarioscenario, it could occur if the remote SMC-R peer (passive abort) suffered a failure right after the local SMC-R peer (active abort) sent the PeerConnAbort indicator. To protect against these types of failures, a timer can be set after entering the PeerAbortWaitstatestate, andwhenif that timer pops before the peer has sent its local PeerConnAbort indicator (to the active abortside) thenside), this RMBE can be returned to the free pool for possiblere- allocation. See sectionreallocation. Seesection 3.2.5Section 4.4.2 for more details. 2. Passive abort designates the SMC-R peer that is the recipient of an SMC-R abort from the peer designated by the PeerConnAbort indicator being sent by the peer in a CDC message. Upon receiving this request, the local peer must do the following: A.IndicateUsing the appropriate error codes, indicate to the socket application that this connection has beenaborted using the appropriate error codes,aborted, and then purge allin- flightin-flight data for this connection that is waiting to be read or waiting to be sent. B. Send a CDC message to notify the peer of the PeerConnAbort indicatorandand, once that iscompletedcompleted, transition this RMBE to the Closed state. If an SMC-R peer receives a TCP RST for a given SMC-Rconnectionconnection, it also initiates SMC-R abnormal connection termination processing if it has not already been notified (via the PeerConnAbort indicator) that the partner is severing the connection. It is possible to have two SMC-R endpoints concurrently be in anActiveactive abort role for a given connection. In thatscenarioscenario, the flows above still apply but bothend pointsendpoints take the active abort path (path 1).4.8.1.2.4.8.3. OtherSMC-R connection termination conditionsSMC-R Connection Termination Conditions The following are additional conditions that have implicationsoffor SMC-R connection termination: oAAn SMC-R peer being gracefully shut down. If an SMC-R peer supports a graceful shutdownoperationoperation, it should attempt to terminate all SMC-R connections as part of shutdown processing. This could be accomplished via LLCDelete LinkDELETE LINK requests on all activeSMC Links.SMC-R links. o Abnormal termination of an SMC-R peer. In this example, there may be no opportunity for the host to perform any SMC-R cleanup processing. In thisscenarioscenario, it is up to the remote peer to detect a RoCE communications failure with the failing host. This could triggeran SMCSMC-R linkswitchswitchover, but that would alsosurfacegenerate RoCEerrorserrors, causing the remote host to eventually terminate all existing SMC-R connections to this peer. o Loss of RoCE connectivity between two SMC-R peers. If two peers are no longer reachable across any links in theirSMC Link groupSMC-R link group, then both peers perform a TCP reset for the connections,surfacegenerate an error to the localapplicationsapplications, and free up all QP resources associated with the link group. 5. SecurityconsiderationsConsiderations 5.1. VLANconsiderationsConsiderations The concepts and access control of virtual LANs (VLANs) must be extended to also cover the RoCE network traffic flowing across theethernet.Ethernet. The RoCE VLAN configuration andaccessesaccess permissions must mirror the IP VLAN configuration andaccessesaccess permissions over theCEEConverged Enhanced Ethernet fabric. This means that hosts,routersrouters, and switches that have access to specific VLANs on the IP fabric must also have the same VLAN access across the RoCE fabric. In other words, the SMC-R connectivity will follow the same virtual network access permissions as normal TCP/IP traffic. 5.2. FirewallconsiderationsConsiderations As mentioned above, the RoCE fabric inherits the same VLAN topology/access as the IP fabric. RoCE is alayerLayer 2 protocol that requires bothend pointsendpoints to reside in the samelayerLayer 2 network(i.e.(i.e., VLAN). RoCE trafficcan notcannot traverse multipleVLANsVLANs, as there is no support for routing RoCE traffic beyond a single VLAN. As a result, SMC-R communications will also be confined to peers that are members of the same VLAN.IP basedIP-based firewalls are typically inserted between VLANs (or physicallans)LANs) and rely on normal IP routing to insert themselves in the data path. Since RoCE (and by extension SMC-R) is not routable beyond the local VLAN, there is no ability to insert a firewall in the network path of two SMC-R peers. 5.3.Host-basedHost-Based IP Filters Because SMC-R maintains the TCP three-way handshake for connection setup before switching to RoCE out of band, existing IP filters that control connection setup flows remain effective in an SMC-R environment. IP filters that operate on traffic flowing in an active TCP connection are not supported, because the connection data does not flow over IP. 5.4. Intrusion Detection Services Similar to IP filters, intrusion detection services that operate on TCP connection setups are compatible with SMC-R with no changes required.HoweverHowever, once the TCP connection has switched to RoCE out of band, packets are not available for examination. 5.5. IP Security(IPSec)(IPsec) IPSecuritysecurity is not compatible withSMC-RSMC-R, because there are no IP packets on which tooperate on.operate. TCP connections that require IP security must opt out of SMC-R. 5.6. TLS/SSLTLS/SSLTransport Layer Security/Secure Socket Layer (TLS/SSL) is preserved in an SMC-R environment. The TLS/SSL layer resides above the SMC-Rlayerlayer, and outgoing connection data is encrypted before being passed down to the SMC-R layer forRMDARDMA write. Similarly, incoming connection data goes through the SMC-R layer encrypted and is decrypted by the TLS/SSL layer as it is today. The TLS/SSL handshake messages flow over the TCP connection after the connection has switched to SMC-R, and so they are exchanged using RDMA writes by the SMC-R layer, transparently to the TLS/SSL layer. 6. IANAconsiderationsConsiderations The scarcity of TCP option codes available for assignment isunderstoodunderstood, and this architecture uses experimental TCP options following the conventions ofRFC 6994 "Shared[RFC6994] ("Shared Use of Experimental TCPOptions".Options"). TCP ExID 0xE2D4C3D9 has been registered with IANA as a TCP Experiment Identifier. See Section 3.1. If this protocol achieves wideacceptanceacceptance, a discrete option code may be requested by subsequent versions of this protocol. 7.References 7.1.Normative References[ROCE] RDMA over Converged Ethernet specification, URL, http://members.infinibandta.org/kwspub/spec/Annex_RoCE_fina l.pdf [IBTA] Infiniband Architecture specification, URL, http://www.infinibandta.org/specs[RFC793]University of Southern California Information Services Institute,Postel, J., "Transmission Control Protocol", STD 7, RFC 793, DOI 10.17487/RFC0793, September1981. [RFC4727] Fenner B., "Experimental Values in IPv4, IPv6, ICMPv4, ICMPv6, UDP, and TCP Headers", RFC 4727, November 2006. 7.2. Informative References [RFC 6994]1981, <http://www.rfc-editor.org/info/rfc793>. [RFC6994] Touch, J., "ShareduseUse of Experimental TCP Options",draft URL, https://tools.ietf.org/html/rfc6994 8. Acknowledgments This document was prepared using 2-Word-v2.0.template.dot. 9. Conventions used in this document In the rendezvous flow diagrams, dashed lines (----) are used to indicate flows over the TCP/IP fabric and dotted lines (....) are used to indicate flowsRFC 6994, DOI 10.17487/RFC6994, August 2013, <http://www.rfc-editor.org/info/rfc6994>. [RoCE] InfiniBand, "RDMA overthe RoCE fabric. In the data transfer ladder diagrams, dashed lines (----) are used to indicate RDMA write operations and dotted lines (....) are used to indicate CDC messages, which are RDMA messages with inline data that contain control information for the connection.Converged Ethernet specification", <https://cw.infinibandta.org/wg/Members/documentRevision/ download/7149>. Appendix A. Formats A.1. TCPoptionOption The SMC-R TCP option is formatted in accordance withRFC 6994 "Shared[RFC6994] ("Shared Use of Experimental TCPOptions".Options"). The ExID value is IBM-1047 (EBCDIC) encoding for'SMCR'"SMCR". 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Kind = 254 | Length = 6 | x'E2' | x'D4' | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | x'C3' | x'D9' | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure2424: SMC-R TCPoption formatOption Format A.2. CLCmessagesMessages The following rules apply to all CLC messages: General rules on formats: o Reserved fields must be set to zero and notvalidatedvalidated. o Each message has aneyecatchereye catcher at the start and anothereyecatchereye catcher at the end. These must both be validated by the receiver. o SMC version indicator: The only SMC-R version defined in this architecture is version 1. In the future, if peers have a mismatch of versions, the lowest common version number is used. A.2.1. Peer IDformatFormat All CLC messages contain a peer ID that uniquely identifies an instance of a TCP/IP stack. This peer ID is required to be universally unique across TCP/IP stacks and instances (including restarts) of TCP/IP stacks. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Instance ID | RoCE MAC (firsttwo2 bytes) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RoCE MAC (lastfour4 bytes) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure2525: Peer IDformatFormat Instance ID Atwo-byte2-byte instance count that ensures that if the same RNIC MAC is later used in the peer ID for a different TCP/IPstack,stack -- forexampleexample, if an RNIC is redeployed to anotherstack,stack -- the values are unique. It also ensures that if a TCP/IP stack is restarted, the instance ID changes.ValueThe value is implementation defined, with one suggestion beingtwo2 bytes of the system clock. RoCE MAC The RoCE MAC address for one of the peer's RNICs. Note that in a virtualized environment this will be the virtual MAC of one of the peer's RNICs. A.2.2. SMC Proposal CLCmessage formatMessage Format 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | x'E2' | x'D4' | x'C3' | x'D9' | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 1 | Length |Version| Rsrvd | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- Client's Peer ID -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- -+ | | +- Client's preferred GID -+ | | +- -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Client's preferred RoCE | +- MAC address +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |Offset to mask/prefix area (0) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ . . . Area for future growth . . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | IPv4 Subnet Mask | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | IPv4 Mask Lgth| Reserved |Num IPv6 prfx | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ : : :(Variable length) arrayArray of IPv6Prefixesprefixes (variable length) : : : +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | x'E2' | x'D4' | x'C3' | x'D9' | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure2626: SMC Proposal CLCmessage formatMessage Format The fields present in the SMC Proposal CLC message are:EyecatchersEye catchers Like all CLC messages, the SMC Proposal has beginning and endingeyecatcherseye catchers to aid with verification and parsing. The hex digits spell'SMCR'"SMCR" in IBM-1047(EBCDIC)(EBCDIC). Type CLC messagetypeType 1 indicates SMCProposalProposal. Length The length of this CLC message. If this is an IPv4 flow, this value is 52.OtherwiseOtherwise, it isvariablevariable, depending upon how many prefixes are listed. Version Version of the SMC-R protocol. Version 1 is the only currently definedvaluevalue. Client's Peer ID As described inA.2.1. aboveAppendix A.2.1 above. Client's preferred RoCE GIDThis is theThe IPv6 address of the client's preferred RNIC on the RoCEfabricfabric. Client's preferred RoCE MAC address The MAC address of the client's preferred RNIC on the RoCE fabric. It isrequiredrequired, as some operating systems do not have neighbor discovery or ARP support for RoCE RNICs. Offset to mask/prefix area Provides the number of bytes that must be skipped after this field, to access the IPv4 Subnet Mask field and the fields that follow it. Allows for future growth of this signal. In this version of the architecture, this value is always zero. Area for future growth In this version of the architecture, this field does not exist. This indicates where additional information may be inserted into the signal in the future."The OffsetThe "Offset to mask/prefix area" field must be used to skip over this area. IPv4 SubnetmaskMask If this message is flowing over an IPv4 TCP connection, the value of the subnet mask associated with the interface over which the client sent thismessage over.message. If this is an IPv6flowflow, this field is allzeroes.zeros. This field, along with all fields that follow it in this signal, must be accessed by skipping the number of bytes listed in the "Offset to mask/prefix area" field after the end of that field. IPv4 Mask Lgth If this message is flowing over an IPv4 TCP connection, the number of significant bits in the IPv4subnet mask.Subnet Mask field. If this is an IPv6 flow, this field is zero. Num IPv6 prfx If this message is flowing over an IPv6 TCP connection, the number of IPv6 prefixes that follow, with a maximum value of 8.ifIf this is an IPv4flowflow, this field is zero and is immediately followed by the endingeyecatcher.eye catcher. Array of IPv6Prefixesprefixes For IPv6 TCP connections, a list of the IPv6 prefixes associated with the network over which the client sent thismessage over,message, up to a maximum of8eight prefixes. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + IPv6Prefixprefix value + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Prefix Length | +-+-+-+-+-+-+-+-+ Figure2727: Format for IPv6 Prefixarray elementArray Element A.2.3. SMC Accept CLCmessage formatMessage Format 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | x'E2' | x'D4' | x'C3' | x'D9' | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 2 | Length = 68|Version|F|Rsvd ||Version|F|Rsrvd| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- Server's Peer ID -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- -+ | | +- Server's RoCE GID -+ | | +- -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Server's RoCE | +- MAC address +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Server QP (bytes 1-2) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+---+ |Srvr QP byte 3 | Server RMBRkeyRKey (bytes 1-3) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Srvr RMB byte 4|Server RMB indx| Srvr RMB alert tkn (bytes 1-2)| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Srvr RMB alert tkn (bytes 3-4)|Bsize | MTU | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- Server's RMB virtual address -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | Server's initial packet sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | x'E2' | x'D4' | x'C3' | x'D9' | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure2828: SMC Accept CLCmessage formatMessage Format The fields presentonin the SMC Accept CLC message are:EyecatchersEye catchers Like all CLC messages, the SMC Accept has beginning and endingeyecatcherseye catchers to aid with verification and parsing. The hex digits spell'SMCR'"SMCR" in IBM-1047(EBCDIC)(EBCDIC). Type CLC messagetypeType 2 indicates SMCAcceptAccept. Length The SMC Accept CLC message is 68 byteslonglong. Version Version of the SMC-R protocol. Version 1 is the only currently defined value. F-bit FirstContactcontact flag: A 1-bit flag that indicates that the server believes this TCP connection is the first SMC-R contact for this linkgroupgroup. Server's Peer ID As described inA.2.1. aboveAppendix A.2.1 above. Server's RoCE GIDThis is theThe IPv6 address of the RNIC that the server chose for thisSMC LinkSMC-R link. Server's RoCE MAC address The MAC address of the server's RNIC for theSMCSMC-R link. It isrequiredrequired, as some operating systems do not have neighbor discovery or ARP support for RoCE RNICs. Server's QP number The number for the reliably connected queue pair that the server created for thisSMC linkSMC-R link. Server's RMBRkeyRKey The RDMARkeyRKey for the RMB that the server created or chose for this TCPconnectionconnection. Server's RMB element indexThis indexesIndexes which element within the server's RMB will represent this TCPconnectionconnection. Server's RMB element alert token Aplatform defined,platform-defined, architecturally opaque token that identifies this TCP connection. Added by the client as immediate data on RDMA writes from the client to the server to inform the server that there is data for this connection to retrieve from the RMBelementelement. Bsize: Server's RMB element buffer size infour bits4-bit compressed notation:x=4x = 4 bits. Actual buffer size value is(2^(x+4))(2^(x + 4)) * 1K. Smallest possible value is 16K. Largest size supported by this architecture is 512K. MTU An enumerated value indicating this peer's QP MTU size. The two peers exchangethis valuetheir MTU values, andthe minimum of the peer'swhichever value is smaller will be used for the QP. This field should only be validatedon ain the first contact exchange. The enumerated MTU values are: 0: reserved 1: 256 2: 512 3: 1024 4: 2048 5: 4096 6-15: reserved Server's RMB virtual address The virtual address of the server's RMB as assigned by the server's RNIC. Server's initial packet sequence number The starting packet sequence number that this peer will use when sending to the other peer, so that the other peer can prepare its QP for the sequence number to expect. A.2.4. SMC Confirm CLCmessage formatMessage Format 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | x'E2' | x'D4' | x'C3' | x'D9' | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 3 | Length = 68 |Version| Rsrvd | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- Client's Peer ID -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- -+ | | +- Client's RoCE GID -+ | | +- -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Client's RoCE | +- MAC address +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Client QP (bytes 1-2) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+---+ |Clnt QP byte 3 | Client RMBRkeyRKey (bytes 1-3) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Clnt RMB byte 4|Client RMB indx| Clnt RMB alert tkn (bytes 1-2)| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Clnt RMB alert tkn (bytes 3-4)|Bsize | MTU | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- Client's RMB Virtual Address -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | Client's initial packet sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | x'E2' | x'D4' | x'C3' | x'D9' | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure2929: SMC Confirm CLCmessage formatMessage Format The SMC Confirm CLC message is nearly identical to the SMCAcceptAccept, except that it contains client information and lacks a first contact flag. The fields presentonin the SMC Confirm CLC message are:EyecatchersEye catchers Like all CLC messages, the SMC Confirm has beginning and endingeyecatcherseye catchers to aid with verification and parsing. The hex digits spell'SMCR'"SMCR" in IBM-1047(EBCDIC)(EBCDIC). Type CLC messagetypeType 3 indicates SMCConfirmConfirm. Length The SMC Confirm CLC message is 68 byteslonglong. Version Version of the SMC-R protocol. Version 1 is the only currently defined value. Client's Peer ID As described inA.2.1. above Clients'sAppendix A.2.1 above. Client's RoCE GIDThis is theThe IPv6 address of the RNIC that the client chose for thisSMC LinkSMC-R link. Client's RoCE MAC address The MAC address of the client's RNIC for theSMCSMC-R link. It isrequiredrequired, as some operating systems do not have neighbor discovery or ARP support for RoCE RNICs. Client's QP number The number for the reliably connected queue pair that the client created for thisSMC linkSMC-R link. Client's RMBRkeyRKey The RDMARkeyRKey for the RMB that the client created or chose for this TCPconnectionconnection. Client's RMB element indexThis indexesIndexes which element within the client's RMB will represent this TCPconnectionconnection. Client's RMB element alert token Aplatform defined,platform-defined, architecturally opaque token that identifies this TCP connection. Added by the server as immediate data on RDMA writes from the server to the client to inform the client that there is data for this connection to retrieve from the RMBelementelement. Bsize: Client's RMB element buffer size infour bits4-bit compressed notation:x=4x = 4 bits. Actual buffer size value is(2^(x+4))(2^(x + 4)) * 1K. Smallest possible value is 16K. Largest size supported by this architecture is 512K. MTU An enumerated value indicating this peer's QP MTU size. The two peers exchangethis valuetheir MTU values, andthe minimum of the peer'swhichever value is smaller will be used for the QP. The values are enumerated in Appendix A.2.3. This value should only be validatedonin the first contact exchange. Client's RMBvirtual addressVirtual Address The virtual address of theserver'sclient's RMB as assigned by the server's RNIC. Client's initial packet sequence number The starting packet sequence number that this peer will use when sending to the other peer, so that the other peer can prepare its QP for the sequence number toexpect .expect. A.2.5. SMC Decline CLCmessage formatMessage Format 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | x'E2' | x'D4' | x'C3' | x'D9' | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 4 | Length = 28 |Version|S|Rsrvd| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- Sender's Peer ID -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Peer Diagnosis Information | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | x'E2' | x'D4' | x'C3' | x'D9' | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure3030: SMC Decline CLCmessage formatMessage Format The fields presentonin the SMC Decline CLC message are:EyecatchersEye catchers Like all CLC messages, the SMC Decline has beginning and endingeyecatcherseye catchers to aid with verification and parsing. The hex digits spell'SMCR'"SMCR" in IBM-1047(EBCDIC)(EBCDIC). Type CLC messagetypeType 4 indicates SMCDeclineDecline. Length The SMC Decline CLC message is 28 byteslonglong. Version Version of the SMC-R protocol. Version 1 is the only currently defined value. S-bitSynchSync Bit. Indicates that the link group is out ofsynchsync and the receiving peer must clean up its representation of the linkgroupgroup. Sender's Peer ID As described inA.2.1. aboveAppendix A.2.1 above. Peer Diagnosis InformationFour4 bytes of diagnosis information provided by the peer. These values are defined by the individualpeerspeers, and it is necessary to consult the peer's system documentation to interpret the results. A.3. LLCmessagesMessages LLC messages are sent over an existing SMC-R link using RoCEmessage passingSendMsg and are always 44 bytes long so that they fit into the space available in a single WQE without requiring the receiver to post receive buffers. If all 44 bytes are not needed, they are padded out withzeroes.zeros. LLC messages are in a request/response format. The message type is the same for request and response, and a flag indicates whether a message is flowing as a request or a response. The twohigh orderhigh-order bits of an LLC message opcode indicate how it is to be handled by a peer that does not support the opcode. If thehigh orderhigh-order bits of the opcode areb'00'b'00', then the peer must support the LLC message and indicate a protocol error if it does not. If thehigh orderhigh-order bits of the opcode areb'10'b'10', then the peer must silently discard the LLC message if it does not support the opcode. This requirement isinsertedincluded to allow for toleration of advanced, butoptional function. High orderoptional, functionality. High-order bits of b'11' indicate a Connection Data Control (CDC) message as described in Appendix A.4. A.3.1. CONFIRM LINK LLCmessage formatMessage Format 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |typeType = 1 |lengthLength = 44 | Reserved |R| Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sender's RoCE | +- MAC address +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | | +- -+ | Sender's RoCE GID | +- -+ | | +- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |Sender's QP number, bytes 1-2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Sender QP byte3| Link number |Sender's linkuserid,userID, bytes 1-2| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Sender's linkuserid bytes,userID, bytes 3-4| Max links | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- Reserved -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure3131: CONFIRM LINK LLCmessage formatMessage Format The CONFIRM LINK LLC message is required to be exchanged between the server and client over a newly created SMC-R link to complete the setup of anSMCSMC-R link. Its purpose is to confirm that the RoCE path is actually usable. On firstcontactcontact, this message flows after the server receives the SMC Confirm CLC message from the client over the IP connection. For additional links added to anSMCSMC-R link group, it flows after the ADD LINK and ADD LINK CONTINUATION exchange. This flow provides confirmation that the queue pair is in fact usable. Each peer echoes its RoCE information back to the other. The contents of the CONFIRM LINK LLC message are: Type Type 1 indicates CONFIRMLINKLINK. LengthAllThe CONFIRM LINK LLCmessages aremessage is 44 byteslonglong. R Reply flag. Whensetset, indicates that this is a CONFIRM LINKREPLYreply. Sender's RoCE MAC address The MAC address of the sender's RNIC for theSMCSMC-R link. It isrequiredrequired, as some operating systems do not have neighbor discovery or ARP support for RoCE RNICs. Sender's RoCE GIDThis is theThe IPv6 address of the RNIC that the sender is using for this SMC-RLinklink. Sender's QP number The number for the reliably connected queue pair that the sender created for this SMC-Rlinklink. Link number An identifier assigned by the server that uniquely identifies the link within the link group. This identifier is ONLY unique within a link group. Provided by the server and echoed back by theclientclient. LinkUseruser ID An opaque,implementation definedimplementation-defined identifier assigned by the sender and provided to the receiver solely for purposes of display, diagnosis, network management, etc. The link user ID should be unique across the sender's entire software space, including alllinkother link groups. MaxLinkslinks The maximum number of links the sender can support in a link group. The maximum for this link group is thethesmaller of the values provided by the two peers. A.3.2. ADD LINK LLCmessage formatMessage Format 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |typeType = 2 |lengthLength = 44 | Rsrvd |RsnCode|R|Z| Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sender's RoCE | +- MAC address +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | | +- -+ | Sender's RoCE GID | +- -+ | | +- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |Sender's QP number, bytes 1-2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Sender QP byte3| Link number |Rsrvd | MTU |Initial PSN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | InitialPSN, continuedPSN (continued) | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -+ | Reserved | +- -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure3232: ADD LINK LLCmessage formatMessage Format The ADD LINK LLC message is sent over an existing link in the link group when a peer wishes to add an SMC-R link to an existing SMC-R link group. It is sent by the server to add a new SMC-R link to the group, or by the client to request that the server add a newlink,link -- forexampleexample, when a new RNIC becomes active. When sent from the client to the server, it represents a request that the server initiate an ADD LINK exchange. This message is sent immediately after the initialSMCSMC-R link in the group completes, as described in3.5.1. First contact.Section 3.5.1 ("First Contact"). It can also be sent over an existing SMC-R link group at any time as new RNICs are added and become available.ThereforeTherefore, there can be as few as1one new RMBRTokensRToken tocommunicate,be communicated, or several.RtokensRTokens will be communicated using ADD LINK CONTINUATION messages. The contents of the ADD LINK LLC message are: Type Type 2 indicates ADDLINKLINK. LengthAllThe ADD LINK LLCmessages aremessage is 44 byteslonglong. RsnCode If the Z (rejection) flag is set, this field provides the reason code. Values can be: X'1' - no alternate path available: set when the server provides the same MAC/GID as an existing SMC-R link in the group, and the client does not have any additional RNICs available (i.e., the server is attempting to set up an asymmetric link but none isavailable)available). X'2' - Invalid MTU valuespecifiedspecified. R Reply flag. Whensetset, indicates that this is an ADD LINKREPLYreply. Z Rejection flag. When set onreplyreply, indicates that the server's ADD LINK was rejected by the client. When this flag is set, the reason code will also be set. Sender's RoCE MAC address The MAC address of the sender's RNIC for the new SMC-R link. It isrequiredrequired, as some operating systems do not have neighbor discovery or ARP support for RoCE RNICs. Sender's RoCE GID The IPv6 address of the RNIC that the sender is using for the new SMC-RLinklink. Sender's QP number The number for the reliably connected queue pair that the sender created for the new SMC-Rlinklink. Link number An identifier for the new SMC-R link. This is assigned by the server and uniquely identifies the link within the link group. This identifier is ONLY unique within a link group. Provided by the server and echoed back by theclientclient. MTU An enumerated value indicating this peer's QP MTU size. The two peers exchangethis valuetheir MTU values, andthe minimum of the peer'swhichever value is smaller will be used for the QP. The values are enumerated in Appendix A.2.3. Initial PSN The starting packet sequence number (PSN) that this peer will use when sending to the other peer, so that the other peer can prepare its QP for the sequence number to expect. A.3.3. ADD LINK CONTINUATION LLCmessage formatMessage Format 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |typeType = 3 |lengthLength = 44 | Reserved |R| Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Linknum | NumRTokens | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- -+ | | +-Rkey/Rtoken PairRKey/RToken pair -+ | | +- -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- -+ | | +-Rkey/Rtoken PairRKey/RToken pair orzeroeszeros -+ | | +- -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure3333: ADD LINK CONTINUATION LLCmessage formatMessage Format When a new SMC-R link is added to an SMC-R link group, it is necessary to communicate the new link's RTokens for the RMBs that theSMC-rSMC-R link group can access. This message follows the ADD LINK and provides the RTokens. The server kicks off this exchange by sending the first ADD LINK CONTINUATION LLC message, and the server controls the exchange as described below. o If the client and the server require the same number of ADD LINK CONTINUATION messages to communicate their RTokens, the server starts the exchange by sending theclient thefirst ADD LINK CONTINUATION request to the client with itsRTokens, then the(the server's) RTokens. The client then responds with an ADD LINK CONTINUATION response with its RTokens, and so on until the exchange is completed. o If the server requires more ADD LINK CONTINUATION messages than the client, then after the client has communicated all of its RTokens, the server continues to send ADD LINK CONTINUATION request messages to the client. The client continues to respond, using empty (number of RTokens to be communicated = 0) ADD LINK CONTINUATION response messages. o If the client requires more ADD LINK CONTINUATION messages than the server, then after communicating all of itsRTokensRTokens, the server will continue to send empty ADD LINK CONTINUATION messages to the client to solicit replies with the client's RTokens, until all have been communicated. The contents ofthisthe ADD LINK CONTINUATION LLC message are: Type Type 3 indicates ADD LINKCONTINUATIONCONTINUATION. LengthAllThe ADD LINK CONTINUATION LLCmessages aremessage is 44 byteslonglong. R Reply flag. Whensetset, indicates that this is an ADD LINK CONTINUATIONREPLYreply. LinkNum The link number of the new link within theSMCSMC-R link groupthat Rkeysfor which RKeys are beingcommunicated forcommunicated. NumRTokens Number of RTokens remaining to be communicated (including the ones in this message). If the value is less than or equal to 2, this is the last message. If it is greater than 2, another continuation message will be required, and its value will be the value in this message minus 2, and so on until allRkeysRKeys are communicated. The maximum value for this field is 255.Up to 2 Rkey/RTokenRKey/RToken pairs (two or less) These consist of anRkeyRKey for an RMB that is known on the SMC-R linkthatover which this message was sentover(the referenceRkey),RKey), paired with the same RMB's RToken over the newSMCSMC-R link. A full RToken is not required for thereferencereference, because it is only being used to distinguish which RMB it applies to, not address it. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ReferenceRkeyRKey | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NewRkeyRKey | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- New Virtual Address -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure34 Rkey/Rtoken pair format34: RKey/RToken Pair Format The contents of the RKey/RToken pair are: ReferenceRkeyRKey TheRkeyRKey of the RMB as it is already known on the SMC-R link over which this message is being sent. Required so that the peer knows with which RMB to associate the newRtoken with.RToken. NewRkeyRKey TheRkeyRKey of this RMB as it is known over the new SMC-Rlinklink. New Virtual Address The virtual address of this RMB as it is known over the new SMC-R link. A.3.4. DELETE LINK LLCmessage formatMessage Format 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |typeType = 4 |lengthLength = 44 | Reserved |R|A|O| Rsrvd | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Linknum |Reasonreason code (bytes 1-3) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |RsnCode byte 4 | | +-+-+-+-+-+-+-+-+ -+ | | +- -+ | | +- -+ | | +- Reserved -+ | | +- -+ | | +- -+ | | +- -+ | | +- -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure3535: DELETE LINK LLCmessage formatMessage Format When the client or server detects that a QP or SMC-R link goes down or needs to come down, it sends this message over one of the other links in the link group. When the DELETELinkLINK is sent from theclientclient, it only serves as a notification, and the client expects the server tosendrespond by sending a DELETE LINKRequest in response.request. To avoid races, only the server will initiate the actual DELETE LINKRequestrequest andResponseresponse sequence that results from notification from the client. The server can also initiate the DELETELinkLINK without notification from the client if it detects an error or if orderly link termination was initiated. The client may also request termination of the entire linkgroupgroup, and the server may terminate the entire link group using this message. The contents ofthisthe DELETE LINK LLC message are: Type Type 4 indicates DELETELINKLINK. LengthAllThe DELETE LINK LLCmessages aremessage is 44 byteslonglong. R Reply flag. Whensetset, indicates that this isana DELETE LINKREPLYreply. AAll"All" flag. Whensetset, indicates that all links in the link group are to be terminated. This terminates the link group. O Orderly flag. Indicates orderly termination. Orderly termination is generally caused by an operator command rather than an error on the link. When the client requests orderly termination, the server may wait to complete other work before terminating. LinkNum The link number of the link to be terminated. If the A flag is set, this field has no meaning and is set to 0. RsnCode The termination reason code. Currently defined reason codes are: RequestReason Codes: oreason codes: X'00010000' =lostLost pathoX'00020000' =operatorOperator initiated terminationoX'00030000' = Program initiated termination (link inactivity)oX'00040000' = LLC protocol violationoX'00050000' = Asymmetric link no longer needed ResponseReason Codes: oreason code: X'00100000' = UnknownLinklink ID (no link)o Others TBDA.3.5. CONFIRM RKEY LLCmessage formatMessage Format 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |typeType = 6 |lengthLength = 44 | Reserved |R|0|Z|C|Rsrvd | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NumTkns | New RMBRkeyRKey for this link (bytes 1-3) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |ThisLink byte 4| | +-+-+-+-+-+-+-+-+ -+ | New RMB virtual address for this link | +- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | +-+-+-+-+-+-+-+-+ -+ | | +- Other link RMB specification or zeros -+ | | +- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -+ | | +- -+ | Other link RMB specification orzeroeszeros | +- +-+-+-+-+-+-+-+-+ | | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure3636: CONFIRM RKEY LLCmessage formatMessage Format TheCONFIRM_RKEYCONFIRM RKEY flow can be sent at any time from either the client or the server, to inform the peer that an RMB has been created or deleted. The creator of a new RMB must inform its peer of the new RMB's RToken for all SMC-R links in the SMC-R link group.The deleter of an RMB must inform its peer of the deleted RMB's RToken for all SMC-R links.For RMB creation, the creator sends this message over theSMCSMC-R link that the first TCP connection that uses the new RMB is using. This message contains the new RMB RToken for theSMCSMC-R linkthatover which the message issent over,sent. It thenitlists the sender'sSMCSMC-R links in the link group paired with the new RToken for the new RMB for that link. This message can communicate the new RTokens for3three QPs: the QP for the link over which this message issent over,sent, and2two others. If there are more than3three links in the SMC-R link group,CONFIRM_RKEY_CONTINUATIONa CONFIRM RKEY CONTINUATION will be required.For RMB deletion, the creator sends the same format of message with a delete flag set, to inform the peer that the RMB's RTokens on all links in the group are deleted. In both cases, theThe peer responds by simply echoing the message with the response flag set. If the response is a negative response, the sender must recalculate the RToken set and start a newCONFIRM_RKEYCONFIRM RKEY exchange from the beginning. The timing of this retry is controlled by the Cflagflag, as described below. The contents ofthisthe CONFIRM RKEY LLC message are: Type Type 6 indicates CONFIRMRKEYRKEY. LengthAllThe CONFIRM RKEY LLCmessages aremessage is 44 byteslonglong. R Reply flag. Whensetset, indicates that this is a CONFIRM RKEYREPLYreply. 0 Reservedbitbit. Z Negative responseflagflag. C Configuration Retry bit. If this is a negative response and this flag is set, the originator should recalculate theRkeyRKey set and retry this exchange as soon as the current configuration change is completed. If this flag is not set on a negative response, the originator must wait for the next natural stimulus (for example, a new TCP connection started that requires a new RMB) before retrying. NumTkns The number of other link/RToken pairs, including those provided in this message, to be communicated. Note that this value does not include theRtokenRToken for the link on which this message was senton(i.e., the maximum value is 2). If this value isthree3 orfewerless, this is the only message in the exchange. If this value is greater thanthree,3, a CONFIRM RKEY CONTINUATION message will be required. Note:inIn this version of the architecture,8eight is the maximum number of links supported in a link group. New RMBRkeyRKey for this link The new RMB'sRkeyRKey as assigned on the link over which this message is beingsent over.sent. New RMB virtual address for this link The new RMB's virtual address as assigned on the link over which thismessagesmessage is beingsent over.sent. Other link RMB specification The new RMB's specification on the other links in the link group, as shown in Figure38.37. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Link number | RMB'sRkeyRKey for the specified link (bytes 1-3) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |NewRkeyRKey byte 4| | +-+-+-+-+-+-+-+-+ -+ | RMB's virtual address for the specified link | +- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+-+ Figure3737: Format oflink number/Rkey pairsLink Number/RKey Pairs Link number The link number for a link in the linkgroupgroup. RMB'sRkeyRKey for the specified link TheRkeyRKey used to reach the RMB over the link whose number was specified in thelinkLink number field. RMB's virtual address for the specified link The virtual address used to reach the RMB over the link whose number was specified in thelinkLink number field. A.3.6. CONFIRM RKEY CONTINUATION LLCmessage formatMessage Format 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |typeType = 8 |lengthLength = 44 | Reserved |R|0|Z| Rsrvd | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NumTknsLeft | | +-+-+-+-+-+-+-+-+ -+ | | +- Other link RMB specification -+ | | +- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | +-+-+-+-+-+-+-+-+ -+ | | +- Other link RMB specification or zeros -+ | | +- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -+ | | +- -+ | Other link RMB specification orzeroeszeros | +- +-+-+-+-+-+-+-+-+ | | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 38: CONFIRM RKEY CONTINUATION LLC Message Format The CONFIRM RKEY CONTINUATION LLC message is used to communicate any additional RMB RTokens that did not fit into the CONFIRM RKEY message. Each of these messages can hold up to3three RMB RTokens. TheNumlinksNumTknsLeft field indicates how many RMB RTokens are to be communicated, including the ones in this message. If the value is 3 or less, this is the last message of the group. If the value is 4 or higher, additional CONFIRM RKEY CONTINUATION messages will follow, and theNumlinksNumTknsLeft value will be a countdown until all are communicated. Like the CONFIRM RKEY message, the peer responds by echoing the message back with the reply flag set. The contents ofthisthe CONFIRM RKEY CONTINUATION LLC message are: Type Type 8 indicates CONFIRM RKEYCONTINUATIONCONTINUATION. LengthAllThe CONFIRM RKEY CONTINUATION LLCmessages aremessage is 44 byteslonglong. R Reply flag. Whensetset, indicates that this is a CONFIRM RKEY CONTINUATIONREPLYreply. 0 Reservedbitbit. Z Negative responseflagflag. NumTknsLeft The number of link/RToken pairs, including those provided in this message, that are remaining to be communicated. If this value isthree3 orfewerless, this is the last message in the exchange. If this value is greater thanthree,3, another CONFIRM RKEY CONTINUATION message will be required. Note that in this version of the architecture,8eight is the maximum number of links supported in a link group. Other link RMBspecificationsspecification The new RMB's specification on other links in the link group, as shown in Figure38.37. A.3.7. DELETE RKEY LLCmessage formatMessage Format 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |typeType = 9 |lengthLength = 44 | Reserved |R|0|Z| Rsrvd | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Count | Error Mask | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | First deletedRkeyRKey | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Second deletedRkeyRKey or zeros | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Third deletedRkeyRKey or zeros | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Fourth deletedRkeyRKey or zeros | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Fifth deletedRkeyRKey or zeros | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sixth deletedRkeyRKey or zeros | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Seventh deletedRkeyRKey or zeros | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Eighth deletedRkeyRKey or zeros | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 39: DELETE RKEY LLC Message Format TheDELETE_RKEYDELETE RKEY flow can be sent at any time from either the client or the server, to inform the peer that one or more RMBs have been deleted. Because the peer already knows every RMB'sRkeyRKey on each link in the link group, this message only specifies oneRkeyRKey for each RMB being deleted. TheRkeyRKey provided for each deleted RMB will be itsRkeyRKey as known on the SMC-R linkthatover which this message issent over.sent. It is not necessary to provide the entire RToken. TheRkeyRKey alone is sufficient for identifying an existing RMB. The peer responds by simply echoing the message with the response flag set. If the peer did not recognize anRkey,RKey, a negative response flag will beset, howeverset; however, no aggressive recovery action beyond logging the error will be taken. The contents ofthisthe DELETE RKEY LLC message are: Type Type 9 indicates DELETERKEYRKEY. LengthAllThe DELETE RKEY LLCmessages aremessage is 44 byteslonglong. R Reply flag. Whensetset, indicates that this is a DELETE RKEYREPLYreply. 0 Reservedbitbit. Z Negative responseflagflag. Count Number of RMBs being deleted by this message. Maximum value is88. Error Mask If this is a negative response, indicates which RMBs were not successfully deleted. Each bit corresponds to a listedRMB. SoRMB; forexampleexample, b'01010000' indicates that the second and fourthRkeysRKeys weren't successfully deleted. DeletedRkeysRKeys A list of CountRkeys.RKeys. Provided on the request flow and echoed back on the response flow. EachRkeyRKey is valid on the link over which this message is sentover,and represents a deleted RMB. Up to eight RMBs can be deleted in this message. A.3.8. TEST LINK LLCmessage formatMessage Format 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |typeType = 7 |lengthLength = 44 | Reserved |R| Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- -+ | | +- User Data -+ | | +- -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- -+ | | +- -+ | Reserved | +- -+ | | +- -+ | | +- -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure3840: TEST LINK LLCmessage formatMessage Format TheTEST_LINKTEST LINK request can be sent from either peer to the other on an existing SMC-R link at any time to test that the SMC-R link is active and healthy at the software level. A peerwhichthat receives aTEST_LINKTEST LINK LLC message immediately sends back aTEST_LINKTEST LINK reply, echoing back the user data.Also referRefer also to4.5.3. TCPSection 4.5.3 ("TCP Keepaliveprocessing.Processing"). The contents ofthisthe TEST LINK LLC message are: Type Type 7 indicates TESTLINKLINK. LengthAllThe TEST LINK LLCmessages aremessage is 44 byteslonglong. R Reply flag. Whensetset, indicates that this is a TEST LINKREPLYreply. User Data The receiver of this message echoes the sender's data back in aTEST_LINKTEST LINK response LLCmessagemessage. A.4. Connection Data Control (CDC)message formatMessage Format The RMBE control data is communicated using Connection Data Control (CDC) messages, which useRDMA message passing using inline data,RoCE SendMsg, similar to LLC messages.Also similar toAlso, as with LLC messages,this data block isCDC messages are 44 bytes long to ensure thatitthey canitfit into private data areas of receiveWQEs,WQEs without requiring the receiver to post receive buffers. Unlike LLC messages, this data is integral to the datapathpath, so its processing must be prioritized and optimized similarly to other data path processing. While LLC messages may be processed on a slower path than data, these messages cannot be. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = x'FE' | Length = 44 | Sequence number | 4 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SMC-R alert token | 8 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | Producer cursor wrap seqno | 12 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Producer Cursor | 16 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | Consumer cursor wrap seqno | 20 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Consumer Cursor | 24 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |B|P|U|R|F|Rsrvd|D|C|A| Reserved | 28 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 32 +- -+ | | 36 +- Reserved -+ | | 40 +- -+ | | 44 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure3941: Connection Data Control (CDC) Message Format Type = x'FE' This type number has the twohigh orderhigh-order bits turned on to enable processing to quickly distinguish it from an LLCmessagemessage. Length = 44 The length of inline data that does not require the posting of a receive buffer. Sequence number A2 byte2-byte unsigned integer that represents a wrapping sequence number. The initial value isone1, and this value can wrap to 0. Incremented with every control messagesend,sent, except for the failover data validation message, and used to guard against processing an old control message out ofsequence, and alsosequence. Also used in failover data validation. In normal usage, if this number is less than the last received value, discard this message. If greater,processesprocess this message. Old control messages can be lost with no illeffect,effect but cannot be processed after newer ones. If this is a failover validation CDC message (F flag set), then the receiver must verify that it has received and fully processed the RDMA write that was described by the CDC message with the sequence number in this message. If not, the TCP connection must bereset,reset to guard against data loss. Details of this processing are provided insectionSection 4.6.1. SMC-R alert token The endpoint-assigned alert token that identifies to which TCP connection on the link group this control messagerefers to.refers. Producer cursor wrap seqno A2 byte2-byte unsigned integer that represents a wrapping counter incremented by the producer whenever the data written into this RMBEreceiverreceive buffer causes a wrap(i.e.(i.e., the producer cursor wraps). This is used by the receiver to determine when new data is available even though the cursors appearunchangedunchanged, such as when a full window size write is completed(Producer(producer cursor of this RMBE sent by peer =Local Consumer Cursor)local consumer cursor) or in scenarios where theProducer Cursorproducer cursor sent for this RMBE <Local Consumer Cursor).local consumer cursor. Producercursor Unsigned, 4 byteCursor A 4-byte unsigned integer that is a wrapping offset into the RMBE data area. Points to the next byte of data to be written by the sender. Can advance up to the receiver'sConsumer Cursorconsumer cursor as known by the sender. When the urgent data present indicator ison thenon, pointsone1 byte beyond the last byte of urgent data. When computing this cursor, the presence of theeyecatchereye catcher in the RMBE data area must be accounted for. The firstwriteablewritable data location in the RMBE is at offset 4, so this cursor begins at 4 and wraps to 4. Consumer cursor wrap seqno2 byteA 2-byte unsigned integer that mirrors the value of theProducerproducer cursor wrap sequence number when the last read from this RMBE occurred. Used as an indicatoronof how far along the consumer is in reading data(i.e.(i.e., processed last wrap point or not). The producer side can use this indicator to detect whether or not more data can be written to the partner in full window write scenarios (where theProducer Cursorproducer cursor =Consumer Cursorconsumer cursor as known on the remote RMBE). In thisscenarioscenario, if the consumer sequence number equals the local producer sequencenumbernumber, the producer knows that more data can be written. Consumer CursorUnsigned 4 byteA 4-byte unsigned integer that is a wrapping offset into the sender's RMBE data area. Points to the offset of the next byte of data to be consumed by the peer in its own RMBE. When computing this cursor, the presence of theeyecatchereye catcher in the RMBE data area must be accounted for. The firstwriteablewritable data location in the RMBE is at offset 4, so this cursor begins at 4 and wraps to 4. The sender cannot write beyond this cursor into the peer's RMBE without causing data loss. B-bit Writer blocked indicator: Sender is blocked forwriting, requireswriting. If this bit is set, sender will require explicit notification when receive buffer space is available. P-bit Urgent data pending: Sender has urgent data pending for thisconnectionconnection. U-bit Urgent data present: Indicates that urgentisdata is present in the RMBE data area, and the producer cursor points toone1 byte beyond the last byte of urgent data. R-bit Request for consumer cursor update: Indicates thataan immediate consumer cursor update isrequested bypassing anyrequested, regardless of whether or not one is warranted according to the window size optimizationalgorithms.algorithm described in Section 4.5.1. F-bit Failover validation indicator:sentSent by a peer to guard against data loss during failover when the TCP connection is being moved to another SMC-R link in the link group. When this bit issetset, the only other fields in the CDC message that are significant are thetype, length,Type, Length, SMC-R alerttokentoken, andthe sequence number.Sequence number fields. The receiver must validate that it has fully processed the RDMA write described by the previous CDC message bearing the same sequence number as this validation message. If it has, no further action is required. If it has not, the TCP connection must be reset. This processing is described in detail insectionSection 4.6.1. D-bit Sending done indicator: Sent by a peer when it is done writing new data into the receiver's RMBE data area. C-bitPeer Closed ConnectionPeerConnectionClosed indicator: Sent by a peer when it is completely done with this connection and will no longer be making any updates to the receiver'sRMBE, and will also not beRMBE or sending any more control messages. A-bit AbnormalCloseclose indicator: Sent by a peer when the connection is abnormally terminated (for example, the TCP connection wasReset).reset). Whensentsent, it indicates that the peer is completely done with this connection and will no longer be making any updates to this RMBE or sending any more control messages. It also indicates that the RMBE owner must flush any remaining data on this connection andsurfacegenerate an error return code to any outstanding socket APIs on this connection (same processing as receivingana RST segment on a TCP connection). Appendix B. Socket APIconsiderationsConsiderations A key design goal for SMC-R is to require no application changes for exploitation. It is confined to socket applications using stream(i.e. TCP protocol)(i.e., TCP) sockets over IPv4 or IPv6. By virtue of the fact that the switch to the SMC-R protocol occurs after a TCP connection isestablishedestablished, no changes are required in a socket address family or in the IP addresses and ports that the socketapplicationapplications are using. Existing socket APIs that allowthe applicationapplications to retrieve local and remote socket address structures for an established TCP connection (for example, getsockname() and getpeername()) will continue to function as they have before. Existing DNS setup and APIs for resolving hostnames to IP addresses and vice versa also continue to function without any changes. Ingeneralgeneral, all of the usual socket APIs that are used for TCPcommunicatescommunications (send APIs, recv APIs, etc.) will continue to function as they dotodaytoday, even if SMC-R is used as the underlying protocol. EachSMC-R enabledSMC-R-enabled implementationdoes howeverdoes, however, need to pay special attention to any socket APIs that have a reliance on the underlying TCP and IP protocols and also ensure that their behavior in an SMC-R environment is reasonable and minimizes impacttoon the application. While the basic socket API set is fairly similar across differentOperating Systems,operating systems, there is more variability when it comes to advanced socket APIoptions there is more variability.options. Each implementation needs to perform a detailed analysis of its APIoptions and SMC-Roptions, any possible impact that SMC-R may have, and any resultant implications. As part of thatstepstep, a discussion or review with other implementations supporting SMC-R would be useful to ensureaconsistent implementation.setsockopt()/B.1. setsockopt() / getsockopt()considerationsConsiderations These APIs allow socket applications to manipulate socket, transport(TCP/UDP)(TCP/UDP), andIP levelIP-level options associated with a given socket. Typically, a platform restricts the number of IP options available to stream (TCP) socketapplicationsapplications, given theirconnection orientedconnection-oriented nature. The general guideline here is to continue processing these APIs in a manner that allows for application compatibility. Some options will be relevant to the SMC-R protocol and will require special processingunder"under thecovers.covers". For example, the ability to manipulate TCP send and receive buffer sizes is still valid forSMC- R.SMC-R. However, other options may have no meaning for SMC-R. For example, if an application enabled the TCP_NODELAY socket option to disable Nagle'salgorithmalgorithm, it should have no real effectinon SMC-Rcommunicationscommunications, as there is no notion of Nagle's algorithm with this new protocol. But the implementation must accept the TCP_NODELAY option as it does today and save it so that it can be later extracted via getsockopt() processing. Note that any TCP orIP levelIP-level options will still have an effect on any TCP/IP packets flowing for an SMC-R connection(i.e.(i.e., as part of TCP/IP connection establishment and TCP/IP connection termination packet flows). Under thecoverscovers, manipulation of the TCP options will also include theSMC layer setting andSMC-layer setting, as well as reading the SMC-R experimental option before and after completion of the3 waythree-way TCP handshake. Appendix C. Rendezvous Error Scenarios This section discusses error scenariosError scenarios infor setting up and managing SMC-Rlinks are discussed in this section.links. C.1. SMC Decline during CLCnegotiationNegotiation A peer to the SMC-R CLC negotiation can send an SMC Decline in lieu of any expected CLC message to decline SMC and force the TCP connection back to the IP fabric. There can be several reasons for an SMC Decline during the CLCnegotiation including:negotiation, including the following: o RNIC wentdown,down o SMC-R forbidden by localpolicy,policy o subnet (IPv4) or prefix (IPv6) doesn'tmatch,match o lack of resources to performSMC-R.SMC-R In allcasescases, when an SMC Decline is sent in lieu of an expected CLC message, no confirmation isrequiredrequired, and the TCP connection immediately falls back to using the IP fabric. To prevent ambiguity between CLC messages and application data, an SMC Decline cannot "chase" another CLC message. An SMC Decline can only be sent in lieu of an expected CLC message. For example, if the client sends an SMC Proposal and then its RNIC goes down, it must wait for the SMC Acceptforfrom the server and thenit canreply tothatthe SMC Accept with an SMC Decline. This "no chase" rule means that if this TCP connection is not a first contact between RoCE peers, a server cannot send an SMC Decline after sending an SMC Accept--- it can only either break the TCPconnection.connection or fail over if a problem arises in the RoCE fabric after it has sent the SMC Accept. Similarly, once the client sends an SMC Confirm on a TCP connection that isn't a first contact, it is committed to SMC-R for this TCP connection and cannot fall back to IP. C.2. SMC Decline during LLCnegotiationNegotiation For a TCP connection that represents a first contact between RoCE pairs, it is possible for SMC tofailfall back to IP during the LLC negotiation. This is possible until the first contactSMCSMC-R link is confirmed. For example, see Figure40.42. After a first contactSMCSMC-R link is confirmed, fallback to IP is no longer possible.The rule that thisThis translates tois:the following rule: a first contact peer can send an SMC Decline at any time during LLC negotiation until it has successfully sent its CONFIRM LINK (request or response) flow. After that point, it cannot fall back to IP. Host X -- Server Host Y -- Client +-------------------+ +-------------------+ |PeerIDPeer ID = PS1 | |PeerIDPeer ID = PC1 | | +------+ +------+ | | QP 8 |RNIC 1| SMC-RlinkLink 1 |RNIC 2| QP 64 | | RKey X | |MAC MA|<-------------------->|MAC MB| | | | | |GID GA| attempted setup |GID GB| | RKey Y2| | \/ +------+ +------+ \/ | |+--------+ | | +--------+ | || RMB | | | | RMB | | |+--------+ | | +--------+ | | /\ +------+ +------+ /\ | | | |RNIC 3| |RNIC 4| |RkeyRKey W2| | | |MAC MC| |MAC MD| | | | QP 9 |GID GC| |GID GD|QP65QP 65 | | +------+ +------+ | +-------------------+ +-------------------+ SYN / SYN-ACK /ACTACK TCP3-waythree-way handshake with TCP option <---------------------------------------------------------> SMC Proposal / SMC Accept / SMC Confirm exchange <--------------------------------------------------------> CONFIRM LINK(request,linkLink 1) .........................................................> CONFIRM LINK(response,linkLink 1) X................................... : :ROCERoCE writefaliurefailure :.................................> SMC Decline(PC1, reason code) <-------------------------------------------------------- Connection data flows over IP fabric <-------------------------------------------------------> Legend: ------------ TCP/IP and CLC flows ............ RoCE (LLC) flows Figure4042: SMC Decline during LLCnegotiationNegotiation C.3. The SMC DeclinewindowWindow Because SMC-R does not supportfall-backfallback to IP for a TCP connection that is already using RDMA, there are specific rules on when the SMCDecline,Decline CLC message, which signals afall-backfallback to IP because of an error or problem with the RoCE fabric, can be sent during TCP connection setup. There is apoint"point of noreturnreturn" after which a connection cannot fall back to IP, and RoCE errors that occur after this point require the connection to be broken with a RST flow in the IP fabric. For a first contact, that point of no return is after theAdd LinkADD LINK LLC message has been successfully sent for the second SMC-R link. Specifically, the server cannot fall back to IP after receiving either (1) a positive write completion indication for theAdd Link request,ADD LINK request orafter receiving(2) theAdd LinkADD LINK response from the client, whichever comes first. The client cannot fall back to IP aftereithersending a negativeAdd LinkADD LINK response, receiving a positive write complete on a positiveAdd LinkADD LINK response, or receiving aConfirm LinkCONFIRM LINK for the second SMC-R link from the server, whichever comes first. For a subsequent contact, that point of no return is after the last send of the CLC negotiation completes. This, in combination with the rule that error "chasers" are not allowed during CLC negotiation, means that the server cannot send an SMC Decline after sending an SMC Accept, and the client cannot send an SMC Decline after sending an SMC Confirm. C.4.Out of synch conditionsOut-of-Sync Conditions during SMC-RnegotiationNegotiation The SMC Accept CLC message contains a"first contact"first contact flag that indicates to the client whetheror notthe server believes it is setting up a new linkgroup,group or using an existing link group. This flag is used to detect anout of synchout-of-sync condition between the client and the server. The scenariodetectedfor such a condition is as follows:Therethere is a single existing SMC-R link between the peers. After the client sends the SMC Proposal CLC message, the existing SMC-R link between the client and the server fails. The client cannot chase the SMC Proposal CLC message with an SMC Decline CLC message in thiscasecase, because the client does not yet know that the server would have wanted to choose the SMC-R link that just crashed. The QP that failed recovers before the server returns its SMC Accept CLC message. This means that there is a QP but noSMCSMC-R link. Since the server had not yet learned of theSMCSMC-R link failure when it sent the SMC Accept CLC message, it attempts tore-usereuse theSMCSMC-R link that just failed. This means that the server would not set the"first contact"first contact flag, indicating to the client that the server thinks it is reusing anSMC- RSMC-R link.HoweverHowever, the client does not have an SMC-R link that matches the server's specification. Because the"first contact"first contact flag is off, the client realizes it is out ofsynchsync with the server and sends an SMC Decline to cause the connection to fall back to IP. C.5. Timeouts during CLCnegotiationNegotiation Because the SMC-R negotiation flows as TCP data, there are built-in timeouts and retransmits at the TCP layer for individual messages. Implementations also musttoprotect the overall TCP/CLC handshake with a timer or timers to prevent connections from hanging indefinitely due to SMC-R processing. This can be done with individual timers for individual CLC messages or an overall timer for the entire exchange, which may include the TCP handshake and the CLC handshake under one timer or separate timers. This decision is implementation dependent. If the TCP and/or CLC handshakes time out, the TCP connection must be terminated as it would be in a legacy IP environment when connection setup doesn't complete in a timely manner. Because the CLC flows are TCP messages, if they cannot be sent and received in a timely fashion, the TCP connection is not healthy and would not work if fallback to IP were attempted. C.6. ProtocolerrorsErrors during CLCnegotiationNegotiation Protocol errors occur during CLC negotiation when a message is received that is not expected. For example, a peer that is expecting a CLC message but instead receives application data has experienced a protocolerror, anderror; this also indicates a likely softwareerrorerror, as the two sides are out ofsynch.sync. When application data is expected, this data is not parsed to ensure that it's not a CLC message. When a peer is expecting a CLC negotiation message, any parsing error except a bad enumerated value in that message must be treated as application data. The CLC negotiation messages are designed with beginning and endingeyecatcherseye catchers to help verify thatthey area CLC negotiation message is actually the expected message. If other parsing errors in an expected CLC message occur, such as incorrect length fields or incorrectly formatted fields, the message must be treated as application data. All protocolerrorserrors, with the exception of bad enumeratedvaluesvalues, must result in termination of the TCP connection. No fallback to IP is allowed in the case of a protocolerrorerror, because if the protocols are out ofsynch,sync, mismatched, or corrupted, then data and security integrity cannot be ensured. The exception to this rule is enumeratedvalues,values -- forexampleexample, the QP MTU values on SMC Accept and SMC Confirm. If a reserved value is received, the proper error response is to send an SMC Decline and fall back toIP. The reason forIP; this isthatbecause the use of a reserved enumerated value indicates that the other partner likely has additional support that the receiving partner does not have. This indicated mismatch of SMC-R capabilities is not an integrityproblem,problem but indicates that SMC-R cannot be used for thisconnectionconnection. C.7. Timeouts during LLCnegotiationNegotiation Whenever a peer sends an LLC message to which a reply is expected, it sets a timer after the send posts to wait for the reply. An expected response may be a reply flavor of the LLC message (forexampleexample, a CONFIRM LINKREPLY)reply) or a new LLC message (forexampleexample, an ADD LINK CONTINUATION expected from the server by the client if there are moreRkeysRKeys tocommunicate).be communicated). On LLC flows that are part of a first contact setup of a link group, the value of the timer is implementation dependent but should be long enough to allow the other peer to have a write complete timeout and 2-3 retransmits of an SMC Decline on the TCP fabric. For LLC flows that are maintaining the link group and are not part of a first contact setup of a link group, the timers may be shorter. Upon receipt of an expectedreplyreply, the timer is cancelled. If a timer pops without a reply having been received, the sender must initiate a recoveryactionaction. During first contact processing, failure of an LLC verification timer is ashould-not-occur which"should-not-occur" that indicates a problem with one of theendpoints. The reason forendpoints; this isthatbecause if there is a "routine" failure in the RoCE fabric that causes an LLC verification send to fail, the sender will get a write completion failure and will then send an SMC Decline to the partner. The only time an LLC verification timer will expire on a first contact is when the sender thinks the send succeeded but it actually didn't. Because of thereliablereliably connected nature of QP connections on the RoCE fabric, thisisindicates a problem with one of the peers, not with the RoCE fabric. After thereliablereliably connectedQPqueue pair for the first SMC-R link in a link group is set up on initial contact, the client sets a timer to wait for a RoCE verification message from the server that the QP is actually connected and usable. If the server experiences a failure sending its QP confirmation message, it will send an SMC Decline, which should arrive at the client before the client's verification timer expires. If the client's timer expires without receiving either an SMC Decline or a RoCE message confirmation from the server, there is a problemeitherwith either the server orwiththe TCP fabric. In eithercasecase, the client must break the TCP connection and clean up the SMC-R link. There are two scenarios in which the client's response to the QP verification message fails to reach the server. The main difference is whether or not the client has successfully completed the send of the CONFIRM LINK response. In the normal case of a problem with the RoCE path, the client will learn of the failure by getting a write completion failure, before the server's timer expires. In this case, the client sends an SMC Decline CLC message to theserverserver, and the TCP connection falls back to IP. If the client's send of theConfirmationconfirmation message receives a positive return code but for some reason still does not reach the server, or the client's SMC Decline CLC message fails to reach the server after the client fails to send its RoCE confirmation message, then the server's timer will time out and the server must break the TCP connection by sending a RST. This is expected to be a very rare case, because if the client cannot send its CONFIRM LINKRSPresponse LLC message, the client should get a negative return code and initiate fallback to IP. A client receiving a positive return code on a send that fails to reach the server should also be an extremelyrare.rare case. C.7.1. RecoveryactionsActions for LLCtimeoutsTimeouts andfailuresFailures The followingtablelist describes recovery actions for LLC timeouts. A write completion failure or other indication offailure to send on thesendof thefailure for an LLC command is treated the same as a timeout. LLCMessage:message: CONFIRM LINK from server (first contact, first link in the link group) Timer waits for: CONFIRM LINK reply fromclientclient. Recovery action: Break the TCP connection by sendingRSTa RST, and clean up the link. The server should have received an SMC Decline from the client by now if the client had an LLC send failure. LLCMessage:message: CONFIRM LINK from server (first contact, second link in the link group) Timer waits for: CONFIRM LINK reply fromclientclient. Recovery action: The second link was not successfully set up. Send a DELETE LINK to the client. Connection data cannot flow in the first link in the link group, until the reply to this DELETE LINK is received, to prevent the peers from being out ofsynchsync on the state of the link group. LLCMessage:message: CONFIRM LINK from server (not first contact) TimerWaitswaits for: CONFIRM LINK reply fromclientclient. Recovery action: Clean up the newlinklink, and set a timer to retry. Send a DELETE LINK to the client, in case the client has a longer timer interval, so the client can stopwaitingwaiting. LLCMessage:message: CONFIRM LINKREPLYreply from client (first contact) Timer waits for: ADD LINK fromserverserver. Recovery action: Clean up the SMC-Rlinklink, and break the TCP connection by sending a RST over the IP fabric. There is a problem with the server. If the server had a send failure, it should havehavesent an SMC Decline by now. LLCMessage:message: ADD LINK from server (first contact) Timer waits for: ADD LINK reply fromclientclient. Recovery action: Break the TCP connection withRSTa RST, and clean up RoCE resources. The connection is past the point where the server can fall back to IP, and if the client had a send problem it should have sent an SMC Decline by now. LLCMessage:message: ADD LINK from server (not first contact) Timer waits for: ADD LINK reply fromclientclient. Recovery action: Clean up resources (QP,RMB keys, etc)RKeys, etc.) for the newlinklink, and treat the linkthatover which the ADD LINK was sentoveras if it had failed. If there is another link available to resend the ADD LINK and the link group still needs another link, retry the ADD LINK over another link in the link group. LLCMessage:message: ADD LINKREPLYreply from client (and there are moreRkeysRKeys to be communicated) Timer waits for: ADD LINK CONTINUATION fromserverserver. Recovery action: Treat the same as ADD LINK timerfailurefailure. LLCMessage:message: ADD LINKREPLYreply or ADD LINK CONTINUATION reply from client (and there are no moreRkeysRKeys to be communicated, for the second link in a first contact scenario) Timer waits for: CONFIRM LINK from theserver onserver, over the newlinklink. Recovery action: The setup of the new linkhas failed to set up.failed. Send a DELETE LINK to the server. Do not consider the socket opened to the client application until receiving confirmation from the server in the form of a DELETE LINK request for this link and sending the reply (to prevent the partners from being out ofsynchsync on the state of the link group). Set a timer to send another ADD LINK to the server if there is still an unused RNIC on the client side. LLCMessage:message: ADD LINKREPLYreply or ADD LINK CONTINUATION reply fromtheclient (and there are no moreRkeysRKeys to be communicated) Timer waits for: CONFIRM LINK from the server, over the newlinklink. Recovery action: Send a DELETE LINK to the server for the new link, then clean up any resource allocated for the new link and set a timer to send an ADD LINK to the server if there is still an unused RNIC on the client side. The setup of the new linkhas failed to set up,failed, but the linkthatover which the ADD LINK exchange occurredoveris unaffected. LLCMessage:message: ADD LINK CONTINUATION from server Timer waits for: ADD LINK CONTINUATIONREPLYreply fromclientclient. Recovery action: Treat the same as ADD LINK timerfailurefailure. LLCMessage:message: ADD LINK CONTINUATION reply from client (first contact, and RMB count fields indicate that the server owes more ADD LINK CONTINUATION messages) Timer waits for: ADD LINK CONTINUATION fromthe serverserver. Recovery action: Clean up theSMC linkSMC-R link, and break the TCP connection by sending a RST. There is a problem with the server. If the server had a send failure, it should havehavesent an SMC Decline by now. LLCMessage:message: ADD LINK CONTINUATION reply from client (not firstcontactcontact, and RMB count fields indicate that the server owes more ADD LINK CONTINUATION messages) Timer waits for: ADD LINK CONTINUATION fromserverserver. Recovery action: Treat asisif client detected link failure on the link that the ADD LINK exchange is using. Send a DELETE LINK to the server over another active link if oneexists, otherwiseexists; otherwise, clean up the link group. LLCMessage:message: DELETE LINK from client Timer waits for: DELETE LINK request fromserverserver. Recovery action: If the scope of the request is to delete a single link, the survivinglink,link over which the client sent the DELETE LINK is no longer usable either. If this is the last link in the link group, end TCP connections over the link group by sending RST packets. If there are other surviving links in the link group, resend over a surviving link. Also send a DELETE LINK over a surviving link for the linkthatover which the client attempted to send the initial DELETE LINKmessage over.message. If the scope of the request is to delete the entire link group, try resending on other links in the link group until success is achieved. If all sends fail, tear down the link group and any TCP connections that exist on it. LLCMessage:message: DELETE LINK from server (scope: entire link group) Timer waits for: Confirmation from the adapter that the message was delivered. Recovery action: Tear down the link group and any TCP connections that existoveron it. LLCMessage:message: DELETE LINK from server (scope: single link) Timer waits for: DELETE LINK reply fromthe clientclient. Recovery action: The link over which theclientserver sent the DELETE LINK is no longer usable either. If this is the last link in the link group, end TCP connections over the link group by sending RST packets. If there are other surviving links in the link group, resend over a surviving link. Also send a DELETE LINK over a surviving link for the linkthatover which the server attempted to send the initial DELETE LINKmessage over.message. If the scope of the request is to delete the entire link group, try resending on other links in the link group until success is achieved. If all sends fail, tear down the link group and any TCP connections that exist on it. LLCMessage:message: CONFIRM RKEY fromtheclient Timer waits for: CONFIRM RKEYREPLYreply fromthe serverserver. Recovery action: Perform normal client procedures for detection of failed link. The link over which the message was sent has failed. LLCMessage:message: CONFIRM RKEY fromtheserver Timer waitsfor :for: CONFIRM RKEYREPLYreply fromthe clientclient. Recovery action: Perform normal server procedures for detection of failed link. The link over which the message was sent has failed. LLCMessage:message: TEST LINK fromtheclient Timer waits for: TEST LINKREPLYreply fromthe serverserver. Recovery action: Perform normal client procedures for detection of failed link. The link over which the message was sent has failed. LLCMessage:message: TEST LINK fromtheserver Timer waitsfor :for: TEST LINKREPLYreply fromthe clientclient. Recovery action: Perform normal server procedures for detection of failed link. The link over which the message was sent has failed. The followingtablelist describes recovery actions for invalid LLC messages. These could be misformatted or containout of synchout-of-sync data. LLCMessagemessage received: CONFIRM LINK from server Whatcould be bad:it indicates: Incorrect linkinformationinformation. Recovery action: Protocol error. The link must be brought down by sending a DELETE LINK for the link over another link in the link group if one exists. If this is a first contact, fall back to IP by sending an SMC Decline to the server. LLCMessagemessage received: ADD LINK Whatcould be bad:it indicates: Undefined enumerated MTUvaluevalue. Recovery action: Send a negative ADD LINK reply with reason codex'2'x'2'. LLCMessagemessage received: ADD LINK reply from client Whatcould be bad: Client sideit indicates: Client-side link information that would result in a parallel link being setupup. Recovery action: Parallel links are not permitted. Delete the link by sending a DELETE LINK to the client over another link in the link group. LLCMessagemessage received: Any link group command from theserverserver, except DELETE LINK for the entire link group Whatcould be bad:it indicates: Client has sent a DELETE LINK for the linkthaton which the message wasreceived onreceived. Recovery action: Ignore the LLC message. Worstcasecase: the server will time out. Bestcasecase: the DELETE LINK crosses with the command from theserverserver, and the server realizes it failed. LLCMessagemessage received: ADD LINK CONTINUATION fromtheserver or ADD LINK CONTINUATIONREPLYreply fromtheclient Whatcould be bad:it indicates: Number of RMBs provided doesn't match count given on initial ADD LINK or ADD LINK replymessagemessage. Recovery action: Protocol error. Treat as if detected linkoutageoutage. LLCMessagemessage received: DELETE LINK from client Whatcould be bad:it indicates: Link indicated doesn'texistexist. Recovery action: If the link is in the process of being cleaned up, assume timing window and ignore message. Otherwise, send a DELETE LINKREPLYreply with reason code 1. LLCMessagemessage received: DELETE LINK from server Whatcould be bad:it indicates: Link indicated doesn'texistexist. Recovery action: Send a DELETE LINKREPLYreply with reason code 1. LLCMessagemessage received: CONFIRM RKEYformfrom either client or server Whatcould be bad:it indicates: NoRkeyRKey provided for one or more of the links in the linkgroupgroup. Recovery action: Treat as if detected failure of the link(s) for which noRKEYRKey wasprovidedprovided. LLC message received: DELETE RKEY What it indicates: Specified RKey doesn'texistexist. Recovery action: Send a negative DELETE RKEY response. LLC message received: TEST LINK reply Whatcould be bad:it indicates: User data doesn't match what was sent in the TEST LINKrequestrequest. Recovery action: Treat as if detected that the link has gone down. This is a protocolerrorerror. LLC message received: Unknown LLC type withhigh orderhigh-order bits of opcode equal to b'10' Whatcould be bad:it indicates: This is an optional LLC messagewhichthat the receiver does notsupportsupport. Recovery action: Ignore (silently discard) themessagemessage. LLC message received:anyAny unambiguously incorrect orout of synchout-of-sync LLC message What it indicates: Link is out ofsyncsync. Recovery action: Treat as if detected that the link has gone down. Note that an unsupported or unknown LLC opcode whose twohigh orderhigh-order bits are b'10' is not anerror,error and must be silently discarded. Any other unknown or unsupported LLC opcode is an error. C.8. Failure toadd secondAdd Second SMC-RlinkLink to alink groupLink Group When there is any failure in setting up the second SMC-R link in an SMC-R link group, including confirmation timer expiration, the SMC-R link group is allowed tocontinue,continue without available failover.HoweverHowever, this situation is extremelyundesirableundesirable, and the server must endeavor to correct it as soon as it can. The server peer in the SMC-R link group must set a timer to drive it to retry setup of a failed additional SMC-R link. The server will immediately retry the SMC-R link setup when the first of the following events occurs: o The retry timerexpiresexpires. o A new RNIC becomes available to the server, on the same LAN as the SMC-R linkgroupgroup. o An"Add Link"ADD LINK LLC request message is received from theclient, whichclient; this indicates the availability of a new RNIC on the client side. Authors' Addresses Mike Fox IBM 3039 Cornwallis Rd. Research Triangle Park, NC 27709 United States Email: mjfox@us.ibm.com Constantinos (Gus) Kassimis IBM 3039 Cornwallis Rd. Research Triangle Park, NC 27709 United States Email: kassimis@us.ibm.com Jerry Stevens IBM 3039 Cornwallis Rd. Research Triangle Park, NC 27709 United States Email: sjerry@us.ibm.com