8 .Nd Native Mode ATM protocol layer
12 ATM software comes with a
13 .Em native mode ATM protocol layer
14 which provides socket level access to AAL0 and AAL5 virtual circuits.
15 To enable this protocol layer, add
18 to your kernel configuration file and re-make the kernel (do not forget
23 .Vt struct sockaddr_natm
24 to specify a virtual circuit:
25 .Bd -literal -offset indent
26 struct sockaddr_natm {
27 uint8_t snatm_len; /* length */
28 uint8_t snatm_family; /* AF_NATM */
29 char snatm_if[IFNAMSIZ]; /* interface name */
30 uint16_t snatm_vci; /* vci */
31 uint8_t snatm_vpi; /* vpi */
35 To create an AAL5 connection to a virtual circuit with VPI 0, VCI 201
36 one would use the following:
37 .Bd -literal -offset indent
38 struct sockaddr_natm snatm;
40 s = socket(AF_NATM, SOCK_STREAM, PROTO_NATMAAL5);
41 /* note: PROTO_NATMAAL0 is AAL0 */
42 if (s < 0) { perror("socket"); exit(1); }
43 bzero(&snatm, sizeof(snatm));
44 snatm.snatm_len = sizeof(snatm);
45 snatm.snatm_family = AF_NATM;
46 sprintf(snatm.snatm_if, "en0");
47 snatm.snatm_vci = 201;
49 r = connect(s, (struct sockaddr *)&snatm, sizeof(snatm));
50 if (r < 0) { perror("connect"); exit(1); }
51 /* s now connected to ATM! */
56 call simply creates an unconnected NATM socket.
59 call associates an unconnected NATM socket with a
60 virtual circuit and tells the driver to enable that virtual circuit
68 to the socket to perform ATM I/O.
69 .Sh Internal NATM operation
70 Internally, the NATM protocol layer keeps a list of all active virtual
71 circuits on the system in
73 This includes circuits currently being used for IP to prevent NATM and
74 IP from clashing over virtual circuit usage.
76 When a virtual circuit is enabled for receiving data, the NATM
77 protocol layer passes the address of the protocol control block down
78 to the driver as a receive
80 When inbound data arrives, the driver passes the data back with the
81 appropriate receive handle.
82 The NATM layer uses this to avoid the
83 overhead of a protocol control block lookup.
84 This allows us to take
85 advantage of the fact that ATM has already demultiplexed the data for
95 of Washington University implemented the NATM protocol layer
96 along with the EN ATM driver in 1996 for
99 The NATM protocol support is subject to change as
100 the ATM protocols develop.
101 Users should not depend on details of the current implementation, but rather
102 the services exported.