Data Stream Interface

Last updated

The Data Stream Interface (DSI) is a session layer used to carry Apple Filing Protocol traffic over Transmission Control Protocol.

The Apple Filing Protocol (AFP), formerly AppleTalk Filing Protocol, is a proprietary network protocol, and part of the Apple File Service (AFS), that offers file services for macOS and the classic Mac OS. In macOS, AFP is one of several file services supported, with others including Server Message Block (SMB), Network File System (NFS), File Transfer Protocol (FTP), and WebDAV. AFP currently supports Unicode file names, POSIX and access control list permissions, resource forks, named extended attributes, and advanced file locking. In Mac OS 9 and earlier, AFP was the primary protocol for file services.

The Transmission Control Protocol (TCP) is one of the main protocols of the Internet protocol suite. It originated in the initial network implementation in which it complemented the Internet Protocol (IP). Therefore, the entire suite is commonly referred to as TCP/IP. TCP provides reliable, ordered, and error-checked delivery of a stream of octets (bytes) between applications running on hosts communicating via an IP network. Major internet applications such as the World Wide Web, email, remote administration, and file transfer rely on TCP. Applications that do not require reliable data stream service may use the User Datagram Protocol (UDP), which provides a connectionless datagram service that emphasizes reduced latency over reliability.

Contents

Overview

When Apple introduced TCP with MacTCP and Open Transport in System 7 in the 1990s, they needed their file sharing protocol (AFP) to run on both TCP and AppleTalk. They introduced AppleTalk Session Protocol (ASP) and DSI for TCP coincidentally with AFP 2.x.

MacTCP was the standard TCP/IP implementation for the classic Mac OS through version 7.5.1. It was the first application-independent implementation of a TCP stack for a non-Unix platform and predates Winsock by over 5 years. Released in 1988, it is considered obsolete and has reliability issues and incomplete features that sometimes prevent it from operating properly on the modern Internet. In addition, the API was unique to the Mac OS, and at least one developer released a Berkeley Sockets-derived API to make porting from other platforms easier.

Open Transport was the name given by Apple Inc. to its implementation of the Unix-originated System V STREAMS networking stack. Based on code licensed from Mentat's Portable Streams product, Open Transport was built to provide the classic Mac OS with a modern TCP/IP implementation, replacing MacTCP. Apple also added its own implementation of AppleTalk to the stack to support legacy networks.

System 7 operating system

System 7 is a graphical user interface-based operating system for Macintosh computers and is part of the classic Mac OS series of operating systems. It was introduced on May 13, 1991, by Apple Computer, Inc. It succeeded System 6, and was the main Macintosh operating system until it was succeeded by Mac OS 8 in 1997. Features added with the System 7 release included virtual memory, personal file sharing, QuickTime, QuickDraw 3D, and an improved user interface.

DSI is implemented directly into AFP clients such as in Mac OS and afpfs-ng.

Protocol

DSI is spoken between a client and an AFP server. All DSI communication contains the following DSI header:

Packet structure

DSI Header [1]
Bit offsetBits 0–78-1515-2324-31
0FlagsCommandRequest ID
32Error code/ enclosed data offset
64Total data length
96Reserved
128Payload

The fields are:

Commands

There are seven possible commands: [2]

DSI Commands
NameCodeDirectionDescription
DSICloseSession1BothCloses an established session
DSICommand2From clientAttached payload contains an AFP command
DSIGetStatus3From clientGet information about the server
DSIOpenSession4From clientEstablish a new session
DSITickle5BothEnsure the connection is active
DSIWrite6From clientWrite data to the server
DSIAttention8From serverGet the attention of the client

Requests and replies

Upon receiving most DSI requests, the client or server sends a reply message. This reply contains:

The DSITickle and DSICloseSession commands do not trigger a reply.

Session creation, maintenance and teardown

A session is set up by the client sending a DSIOpenSession, which will include the size of the receive buffer the client has for packets (called the request quantum, typically 1024 bytes). The server acknowledges the request and returns the size of its data receive buffer (typically 256k on Mac OS X Leopard).

Session closure can be initiated by either side by sending DSICloseSession. The sender does not need to wait for a reply and should immediately close the session after sending the message.

Maintaining the connection is done by tickling. DSI provides a mechanism for ensuring that client and server know that the other is still active. Every 30 seconds of inactivity, the server sends a tickle request to the client. Similarly, the client also sends its own tickle. (This is NOT a response packet.) Either the client or server can terminate the DSI session if they fail to hear from the other for 120 seconds. The client may also disconnect if a request is in flight and neither a response nor tickle is received within 60 seconds (in Mac OS X v.10.2 and later).

Getting server information with GetStatus

This DSI command encapsulates an FPGetSrvrInfo packet. It is used by a client to get information from a server it isn't logged into.

The data elements are organized in the packet with a catalog of indices pointing to structured data. [3]

The request to a DSIGetStatus request will cause the server to respond with the following information:

DSIGetStatus reply format is identical to AFP's FPGetSrvrInfo and is used for ASPGetStatus. [4]

Error codes

The error codes returned are AFP result codes. [5]

Further research

DSI is never documented separately, and is sufficiently simple and static that older references are suitable for modern implementations. The concepts of DSI are identical to AppleTalk Session Protocol (ASP), and the overview in Inside AppleTalk, Second Edition can be helpful.

The most succinct guide is the "AFP over TCP" chapter of Apple Filing Protocol Programming Guide.

A significant source of information in understanding DSI can be found by analyzing communication between AFP clients and servers using a packet sniffer.

Footnotes

  1. "DSIHeader" in "Apple Filing Protocol Reference"
  2. "DSI Commands" in "Apple Filing Protocol Programming Guide"
  3. "FPGetSrvrInfo" in "Apple Filing Protocol Reference"
  4. "DSIGetStatus" in "Apple Filing Protocol Reference"
  5. "Result Codes" in "Apple Filing Protocol Reference"

Related Research Articles

AppleTalk is a discontinued proprietary suite of networking protocols developed by Apple Inc. for their Macintosh computers. AppleTalk includes a number of features that allow local area networks to be connected with no prior setup or the need for a centralized router or server of any sort. Connected AppleTalk-equipped systems automatically assign addresses, update the distributed namespace, and configure any required inter-networking routing.

The Internet Control Message Protocol (ICMP) is a supporting protocol in the Internet protocol suite. It is used by network devices, including routers, to send error messages and operational information indicating, for example, that a requested service is not available or that a host or router could not be reached. ICMP differs from transport protocols such as TCP and UDP in that it is not typically used to exchange data between systems, nor is it regularly employed by end-user network applications.

ping (networking utility) Computer network administration utility used to test the reachability of a host

Ping is a computer network administration software utility used to test the reachability of a host on an Internet Protocol (IP) network. It is available for virtually all operating systems that have networking capability, including most embedded network administration software.

The Real Time Streaming Protocol (RTSP) is a network control protocol designed for use in entertainment and communications systems to control streaming media servers. The protocol is used for establishing and controlling media sessions between end points. Clients of media servers issue VHS-style commands, such as play, record and pause, to facilitate real-time control of the media streaming from the server to a client or from a client to the server.

In computer networking, the User Datagram Protocol (UDP) is one of the core members of the Internet protocol suite. The protocol was designed by David P. Reed in 1980 and formally defined in RFC 768. With UDP, computer applications can send messages, in this case referred to as datagrams, to other hosts on an Internet Protocol (IP) network. Prior communications are not required in order to set up communication channels or data paths.

The File Transfer Protocol (FTP) is a standard network protocol used for the transfer of computer files between a client and server on a computer network.

OBEX is a communications protocol that facilitates the exchange of binary objects between devices. It is maintained by the Infrared Data Association but has also been adopted by the Bluetooth Special Interest Group and the SyncML wing of the Open Mobile Alliance (OMA). One of OBEX's earliest popular applications was in the Palm III. This PDA and its many successors use OBEX to exchange business cards, data, even applications.

Explicit Congestion Notification (ECN) is an extension to the Internet Protocol and to the Transmission Control Protocol and is defined in RFC 3168 (2001). ECN allows end-to-end notification of network congestion without dropping packets. ECN is an optional feature that may be used between two ECN-enabled endpoints when the underlying network infrastructure also supports it.

In computer networking, Server Message Block (SMB), one version of which was also known as Common Internet File System, operates as an application-layer or presentation-layer network protocol mainly used for providing shared access to files, printers, and serial ports and miscellaneous communications between nodes on a network. It also provides an authenticated inter-process communication mechanism. Most usage of SMB involves computers running Microsoft Windows, where it was known as "Microsoft Windows Network" before the introduction of Active Directory. Corresponding Windows services are LAN Manager Server and LAN Manager Workstation.

In computer networking, Layer 2 Tunneling Protocol (L2TP) is a tunneling protocol used to support virtual private networks (VPNs) or as part of the delivery of services by ISPs. It does not provide any encryption or confidentiality by itself. Rather, it relies on an encryption protocol that it passes within the tunnel to provide privacy.

AppleShare was a product from Apple Computer which implemented various network services. Its main purpose was to act as a file server, using the AFP protocol. Other network services implemented in later versions of AppleShare included a print server using the Printer Access Protocol (PAP), web server, electronic mail server, and SMB / CIFS server to support file sharing to Microsoft Windows clients.

The NetWare Core Protocol (NCP) is a network protocol used in some products from Novell, Inc. It is usually associated with the client-server operating system Novell NetWare which originally supported primarily MS-DOS client stations, but later support for other platforms such as Microsoft Windows, the classic Mac OS, Linux, Windows NT, Mac OS X, and various flavors of Unix was added.

Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by Macromedia for streaming audio, video and data over the Internet, between a Flash player and a server. Macromedia is now owned by Adobe, which has released an incomplete version of the specification of the protocol for public use.

In computer networking, Internet Protocol Control Protocol (IPCP) is a Network Control Protocol (NCP) for establishing and configuring Internet Protocol over a Point-to-Point Protocol link. IPCP is responsible for configuring the IP addresses as well as for enabling and disabling the IP protocol modules on both ends of the point-to-point link. IPCP uses the same packet exchange mechanism as the Link Control Protocol. IPCP packets may not be exchanged until PPP has reached the Network-Layer Protocol phase, and any IPCP packets received before this phase is reached should be silently discarded. IPCP has the NCP protocol code number 0x8021.

NetBoot is a technology from Apple which enables Macs with capable firmware to boot from a network, rather than a local hard disk or optical disc drive. NetBoot is a derived work from the Bootstrap Protocol (BOOTP), and is similar in concept to the Preboot Execution Environment. The technology was announced as a part of the original version of Mac OS X Server at Macworld Expo on 5 January 1999. NetBoot has continued to be a core systems management technology for Apple, and has been adapted to support modern Mac Intel machines. NetBoot, USB, and FireWire are some of the external volume options for Mac OS re-install.

A network socket is an internal endpoint for sending or receiving data within a node on a computer network. Concretely, it is a representation of this endpoint in networking software, such as an entry in a table, and is a form of system resource.

An ICMP tunnel establishes a covert connection between two remote computers, using ICMP echo requests and reply packets. An example of this technique is tunneling complete TCP traffic over ping requests and replies.

TOPS is a peer-to-peer LAN-based file sharing system best known in its Macintosh implementation, but also available for Windows and able to interoperate with Unix's NFS. Originally written by Centram Systems West, the company was purchased by Sun Microsystems as part of Sun's development of the NFS ecosystem. Sales of TOPS dried up after the introduction of System 7, which featured a similar file sharing system built-in, and Sun spun off their NFS developments to Sitka.

References

International Standard Book Number Unique numeric book identifier

The International Standard Book Number (ISBN) is a numeric commercial book identifier which is intended to be unique. Publishers purchase ISBNs from an affiliate of the International ISBN Agency.