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
17 to your kernel configuration file and re-make the kernel (do not forget
22 .Vt struct sockaddr_natm
23 to specify a virtual circuit:
24 .Bd -literal -offset indent
25 struct sockaddr_natm {
26 u_int8_t snatm_len; /* length */
27 u_int8_t snatm_family; /* AF_NATM */
28 char snatm_if[IFNAMSIZ]; /* interface name */
29 u_int16_t snatm_vci; /* vci */
30 u_int8_t snatm_vpi; /* vpi */
34 To create an AAL5 connection to a virtual circuit with VPI 0, VCI 201
35 one would use the following:
36 .Bd -literal -offset indent
37 struct sockaddr_natm snatm;
39 s = socket(AF_NATM, SOCK_STREAM, PROTO_NATMAAL5);
40 /* note: PROTO_NATMAAL0 is AAL0 */
41 if (s < 0) { perror("socket"); exit(1); }
42 bzero(&snatm, sizeof(snatm));
43 snatm.snatm_len = sizeof(snatm);
44 snatm.snatm_family = AF_NATM;
45 sprintf(snatm.snatm_if, "en0");
46 snatm.snatm_vci = 201;
48 r = connect(s, (struct sockaddr *)&snatm, sizeof(snatm));
49 if (r < 0) { perror("connect"); exit(1); }
50 /* s now connected to ATM! */
55 call simply creates an unconnected NATM socket.
58 call associates an unconnected NATM socket with a
59 virtual circuit and tells the driver to enable that virtual circuit
67 to the socket to perform ATM I/O.
68 .Sh Internal NATM operation
69 Internally, the NATM protocol layer keeps a list of all active virtual
70 circuits on the system in
72 This includes circuits currently being used for IP to prevent NATM and
73 IP from clashing over virtual circuit usage.
75 When a virtual circuit is enabled for receiving data, the NATM
76 protocol layer passes the address of the protocol control block down
77 to the driver as a receive
79 When inbound data arrives, the driver passes the data back with the
80 appropriate receive handle.
81 The NATM layer uses this to avoid the
82 overhead of a protocol control block lookup.
83 This allows us to take
84 advantage of the fact that ATM has already demultiplexed the data for
87 The NATM protocol support is subject to change as
88 the ATM protocols develop.
89 Users should not depend on details of the current implementation, but rather
90 the services exported.
99 of Washington University implemented the NATM protocol layer
100 along with the EN ATM driver in 1996 for