AF_SMC(7)

πŸ’– AF_SMC πŸ’–

okay bestie, gather round, because this one is a whole address family and she is iconic. this is from the Linux Programmer's Manual, and it's all about Sockets for SMC communication. no cap. πŸ¦‹


✨ NAME ✨

AF_SMC β€” Sockets for SMC communication πŸ’…


🌸 SYNOPSIS 🌸

#include <sys/socket.h>

#define AF_SMC 43

#define SMCPROTO_SMC  0

#define SMCPROTO_SMC6 1

tcp_sockfd = socket(AF_SMC, SOCK_STREAM, SMCPROTO_SMC);

tcp_sockfd = socket(AF_SMC, SOCK_STREAM, SMCPROTO_SMC6);

see how it's literally just socket()? your TCP app doesn't even have to know. she's giving effortless. πŸŽ€


πŸ’œ DESCRIPTION πŸ’œ

so, Shared Memory Communication via RDMA (SMC) β€” say that five times fast, or don't, I'm not your mom β€” is a socket that rides on top of the RDMA communication protocol. the whole point? your existing TCP socket applications get to transparently benefit from RDMA when they're exchanging data over an RDMA over Converged Ethernet (RoCE) network. 🫢

⚠️ heads up bestie: those networks are not routable. periodt.

SMC gives you host-to-host direct memory access without all that traditional TCP/IP processing overhead. she also offers preservation of existing IP topology and IP security, and introduces minimal administrative and operational changes. and the exploitation of SMC? completely transparent to TCP socket applications. they don't even notice. main character energy but in the background. ✨

the new address family AF_SMC supports the SMC protocol on Linux. it keeps the address format of AF_INET and AF_INET6 sockets and supports streaming socket types only. that's it. that's the whole vibe. πŸ’€

πŸ¦‹ Usage modes πŸ¦‹

two usage modes are possible, and yes you have to pick:

  • AF_SMC native usage β€” uses the socket domain AF_SMC instead of AF_INET and AF_INET6. specify SMCPROTO_SMC for AF_INET compatible socket semantics, and SMC_PROTO_SMC6 for AF_INET6 respectively.
  • Usage of AF_INET socket applications with SMC preload library β€” converts AF_INET and AF_INET6 sockets to AF_SMC sockets. the SMC preload library is part of the SMC tools package.

SMC socket capabilities are negotiated at connection setup. and if one peer is not SMC capable? further socket processing falls back to TCP usage automatically. she's polite like that. πŸ’…

to run RDMA traffic to a peer, a so-called link is established between a local RoCE card and a remote RoCE card. and because we love redundancy in this house, to enhance availability you can configure alternate links with automatic fail over. primary and backup links to a certain peer get combined in a so-called link group. it's giving squad goals. πŸ‘‘

πŸŽ€ RoCE adapter mapping: Creation of a pnet table πŸŽ€

the SMC protocol requires grouping of multiple physical networks β€” standard Ethernet and RoCE networks. such groups are called Physical Networks (PNets). for SMC, RoCE adapter mapping is configured within a table called a pnet table.

any available Ethernet interface can be combined with available RDMA-capable network interface cards (RNICs), if they belong to the same Converged Ethernet fabric. to configure RoCE Adapter mapping, you must create a pnet table. modify the table with the smc-tools command smc_pnet. 🧚

for details see smc_pnet(8).

🌈 Displaying SMC socket state information 🌈

SMC socket state information can be obtained with the smc-tools command smcss. for details see smcss(8). go peek, she tells you everything. πŸ™ˆ

⭐ Starting a TCP application to work with SMC ⭐

to use an existing TCP application to work with SMC, use the SMC preload library. the SMC Tools package provides the command smc_run to convert AF_INET and AF_INET6 socket calls to AF_SMC socket calls by means of the preload technique. for more information about the preload mechanism, see also ld.so(8).

Example:

smc_run ftp

this command-line example starts an FTP client over SMC. look at her go. πŸ”₯

πŸ“ MTU and Infiniband data transfer πŸ“

Infiniband traffic may use MTU values 256, 512, 1024, 2048, or 4096. SMC determines the configured MTU size of the RoCE Ethernet port, announces this MTU size to the peer during connection start, and chooses the minimum MTU size of both peers. so basically she asks, and then takes the smaller one, because that's what works. no drama. πŸ’–


🌟 SEE ALSO 🌟

socket(2), ip(7), tcp(7), socket(7), smc_chk(8) smc_run(8), smcss(8), smc_pnet(8)


πŸ‘‘ HISTORY πŸ‘‘

AF_SMC, version 1.0.0

  • Initial version.

and that's the whole page bestie, slay πŸ’…βœ¨

this one comes to you from smc-tools, dated January 2017, and it lives at AF_SMC(7) in the manual. iykyk πŸ¦‹πŸŽ€πŸ’œ