Socket Addresses in the Operating System Network Device Driver (NDD)

In the operating system NDD domain, socket addresses contain the NDD name, which associates the socket with the local device (or adapter). Socket addresses also contain a protocol-dependent part.

Typically, applications use the bind subroutine to bind a socket to a particular local device and 802.2 service access point (SAP). The information used to bind to a particular NDD and packet type are specified in the NDD socket address passed into the bind subroutine. After the socket is bound, it can be used to receive packets for the bound SAP addressed to the local host's medium access control (MAC) address (or the broadcast address) for that device. Raw packets can be transmitted using the send, sendto, and sendmsg socket subroutines.

The protocol-dependent parts of the operating system NDD socket address structure are defined as follows:
Item Description
Ethernet The Ethernet NDD sockaddr is defined in the sys/ndd_var.h file. The sockaddr structure name is sockaddr_ndd_8022. This sockaddr allows you to bind to an Ethernet type number or an 802.2 SAP number. When bound to a particular type or SAP, a socket can be used to receive packets of that type or SAP. Packets to be transmitted must be complete Ethernet packets that include the MAC and logical link control (LLC) headers.
Token Ring The token-ring NDD sockaddr is defined in the sys/ndd_var.h file. The sockaddr structure name is sockaddr_ndd_8022. This sockaddr allows you to bind to an 802.2 SAP number. When bound to a particular type or SAP, a socket can be used to receive packets of that type or SAP. Packets to be transmitted must be complete token ring packets that include the MAC and LLC headers.
FDDI The Fiber Distributed Data Interface (FDDI) NDD sockaddr is defined in the sys/ndd_var.h file. The sockaddr structure name is sockaddr_ndd_8022. This sockaddr allows you to bind to an 802.2 SAP number. When bound to a particular type or SAP, a socket can be used to receive packets of that type or SAP. Packets to be transmitted must be complete FDDI packets that include the MAC and LLC headers.
FCS The FCS NDD sockaddr is defined in the sys/ndd_var.h file. The sockaddr structure name is sockaddr_ndd_8022. This sockaddr allows you to bind to an 802.2 SAP number. When bound to a type or SAP, a socket can be used to receive packets of that type or SAP. Packets to be transmitted must be complete FCS packets that include the MAC and LLC headers.
ATM Defined in the sockaddr_ndd_atm structure in the /sys/atmsock.h file. The sndd_atm_vc_type field specifies CONN_PVC or CONN_SVC, for Asynchronous Transfer Mode (ATM) permanent virtual circuit (PVC) and ATM switched virtual circuit (SVC), respectively. For ATM PVCs, the first four octets of the sndd_atm_addr field contain the virtual path identifier:virtual channel identifier (VPI:VCI) for a virtual circuit. For ATM SVCs, the sndd_atm_addr field contains the 20-octet ATM address, and the sndd_atm_subaddr field contains the 20-octet ATM subaddress, if applicable.
NDD protocols of the operating system that support 802.2 LLC encapsulation use the sockaddr_ndd_8022 structure for defining the NDD and 802.2 SAP to be used for input filtering. Currently, the only NDD protocol that does not use this structure is ATM. The sockaddr_ndd_8022 structure contains the following fields:
Item Description
sndd_8022_len Contains the socket address length.
sndd_8022_family Contains the socket address family (for example, AF_NDD).
sndd_8022_nddname[NDD_MAXNAMELEN] Contains the NDD device name for the Ethernet device (for example, ent0).
sndd_8022_filterlen Contains the size of the remaining fields that define the input filter. For 802.2 encapsulated protocols, this is the size of struct ns_8022.
sndd_8022_ns Contains the filter structure and allows the application to specify the types of packets to be received by this socket. This structure contains the following fields:
filtertype
Contains the type of filter. This includes 802.2 LCC, 802.2 Logical Link Control/Sub-Network Access Protocol (LLC/SNAP), as well as standard Ethernet. A special "wildcard" filter type is supported that allows ALL packets to be received. This type, NS_TAP, and all standard filter types are defined in the sys/ndd_var.h file.
dsap
For 802.2 LLC filters, this specifies the SAP used for filtering incoming packets. The application "binds" to this SAP and then receives packets addressed to this SAP, for example, 0xaa for 802.2 LLC/SNAP encapsulations.
orgcode[3]
For 802.2 LLC filters, this specifies the organization code.
ethertype
For 802.2 LLC SNAP and standard Ethernet filter types, this field specifies the ethertype. An example is 0x800 for IP over Ethernet and IP over 802.2 LLC/SNAP encapsulations.