Data Stream Interface

Data Stream Interface

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

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.

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 offset Bits 0–7 8-15 15-23 24-31
0 Flags Command Request ID
32 Error code/ enclosed data offset
64 Total data length
96 Reserved
128 Payload

The fields are:

  • Flags: whether the packet is a request (0x00) or a reply (0x01)
  • Command: one of 7 possible commands (see below)
  • Request ID: a sequential identifier set on the request and copied in the reply
  • Error code/ enclosed data offset:
    • For requests, this is left as 0, except when using the DSIWrite command.
    • For replies, this is an error code.
  • Total data length: the entire length of data after the DSI header
  • Reserved: for future expansion
  • Payload: this is where limited DSI data or more commonly AFP header is placed

Commands

There are seven possible commands[2]:

DSI Commands
Name Code Direction Description
DSICloseSession 1 Both Closes an established session
DSICommand 2 From client Attached payload contains an AFP command
DSIGetStatus 3 From client Get information about the server
DSIOpenSession 4 From client Establish a new session
DSITickle 5 Both Ensure the connection is active
DSIWrite 6 From client Write data to the server
DSIAttention 8 From server Get 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 flags field set to 0x01 (reply)
  • the command field set to the same value as the request's command field
  • the same request ID sent in the request (used for the client to find the request being acknowledged)
  • totalDataLength set to the payload length (if applicable).
  • where applicable, the data payload itself following the DSI header. (See the individual command for details.)

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:

  • flags for basic server characteristics
  • server name (7-bit ASCII and UTF-8)
  • signature: used to uniquely identify the server for other AFP transactions
  • server type: typically "Macintosh" or "Netatalk"
  • a list of strings describing AFP versions spoken (e.g. "AFP3.2")
  • UAM list: a list of strings describing User Authentication Methods (e.g. "DHX2")
  • a 64x64 pixel icon
  • directory server list

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

References

  • AppleTalk Filing Protocol Version 2.1 and 2.2 [1]
  • Inside AppleTalk Sidhu, Gurharan S.; Andrews, Richard F.; Oppenheimer, Alan B. (May 1990), Inside AppleTalk, Second Edition, Addison-Wesley Publishing Company, Inc., ISBN 0-201-55021-0 
  • Apple Filing Protocol Programming Guide [2]
  • Apple Filing Protocol Reference [3]

Wikimedia Foundation. 2010.

См. также в других словарях:

  • Serial Data Transport Interface — is a way of transmitting data packets over a Serial Digital Interface datastream. This means that standard SDI infrastructure can be used.Developed to address the needs of the growing number of compressed video standards (DV, DVCPRO, BetaSX,… …   Wikipedia

  • IBM Intelligent Printer Data Stream (IPDS) — Intelligent Printer Data Stream (IPDS) is IBM’s Systems Application Architecture host to printer data stream for Advanced Function Presentation subsystems. It provides an attachment independent interface for controlling and managing all points… …   Wikipedia

  • Data Link Layer — The Data Link Layer is Layer 2 of the seven layer OSI model. It responds to service requests from the Network Layer and issues service requests to the Physical Layer.The Data Link Layer is the protocol layer which transfers data between adjacent… …   Wikipedia

  • Data link layer — The OSI model 7 Application layer 6 Presentation layer 5 Session layer 4 Transport layer 3 Network layer 2 …   Wikipedia

  • Data structure — In computer science, a data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.[1][2] Different kinds of data structures are suited to different kinds of applications, and some are highly …   Wikipedia

  • Data type — For other uses, see Data type (disambiguation). In computer programming, a data type is a classification identifying one of various types of data, such as floating point, integer, or Boolean, that determines the possible values for that type; the …   Wikipedia

  • Data Access in Real Time — (DART) is a Real time operating system used by EMC Celerra. It is a modified UNIX Kernel with additional functionality. DART is an embedded, real time, operating system comprising a modified UNIX kernel and dedicated file server software that… …   Wikipedia

  • Data file — A data file is a computer file which stores data to use by a computer application or system. It generally does not refer to files that contain instructions or code to be executed (typically called program files), or to files which define the… …   Wikipedia

  • Stream Control Transmission Protocol — In computer networking, the Stream Control Transmission Protocol (SCTP) is a Transport Layer protocol, serving in a similar role as the popular protocols TCP and UDP. Indeed, it provides some of the same service features of both, ensuring… …   Wikipedia

  • Stream (disambiguation) — A stream is a moving body of water, such as a creek or a river.Stream may also refer to:* Stream (computing), succession of data elements supplied over time * Streams (networking API), a computer programming interface for implementing network… …   Wikipedia


Поделиться ссылкой на выделенное

Прямая ссылка:
Нажмите правой клавишей мыши и выберите «Копировать ссылку»