Inside Appletalk¨ Second Edition
Total Page:16
File Type:pdf, Size:1020Kb
K ® Inside AppleTalk® Second Edition Gursharan S. Sidhu Technical Director Richard F. Andrews Staff Engineer Alan B. Oppenheimer Staff Engineer Network Systems Development Apple Computer, Inc. ∆∆ Addison-Wesley Publishing Company, Inc. Reading, Massachusetts ■ Menlo Park, California ■ New York Don Mills, Ontario ■ Wokingham, England ■ Amsterdam ■ Bonn Sydney ■ Singapore ■ Tokyo ■ Madrid ■ San Juan APPLE COMPUTER, INC. IBM and SNA are registered UNIX is a registered trademark of trademarks of International AT&T Information Systems. Copyright © 1990 by Apple Business Machines Corporation. Computer, Inc. Varityper is a registered trade- InBox is a trademark of Symantec mark, and VT600 is a trademark, All rights reserved. No part of this Corporation’s Think Technologies. of AM International, Inc. publication may be reproduced, stored in a retrieval system, or ITC Garamond and ITC Zapf Zilog is a trademark of Infocom, transmitted, in any form or by Dingbats are registered Inc. any means, mechanical, electronic, trademarks of International Simultaneously published in the photocopying, recording, or Typeface Corporation. United States and Canada. otherwise, without prior written Kinetics is a trademark of ISBN 0-201-55021-0 consent of Apple Computer, Inc. Kinetics, Inc. ABCDEFGHIJ-DO-90 Printed in the United States of LANSTAR and Meridian are First printing, May 1990 America. registered trademarks of Apple Computer, Inc. Northern Telecom. 20525 Mariani Avenue LANSTAR AppleTalk is a joint Cupertino, CA 95014 trademark of Northern Telecom (408) 996-1010 and Apple Computer, Inc. Apple, the Apple logo, AppleShare, Linotronic is a registered AppleTalk, Apple IIe, Apple IIGS, trademark of Linotype Co. EtherTalk, ImageWriter, Microsoft and MS-DOS are LaserWriter, Macintosh, ProDOS, registered trademarks of and TokenTalk are registered Microsoft Corporation. trademarks of Apple Computer, Inc. Netway is a registered trademark of Tri-Data Systems, Inc. Apple Desktop Bus, Finder, LocalTalk, and MultiFinder are NFS is a trademark of Sun trademarks of Apple Computer, Microsystems. Inc. PacerShare is a registered AlisaShare is a trademark of Alisa trademark of Pacer Software, Inc. Systems. PhoneNET is a registered CL/1 is a trademark of Network trademark of Farallon Computing. Innovations. PostScript is a registered DECnet and VAX are trademarks trademark, and Illustrator is a of Digital Equipment Corporation. trademark, of Adobe Systems Incorporated. Contents Figures and tables / xv Acknowledgments / xx Acknowledgments to First Edition / xxiii Introduction / I-1 Network systems / I-4 Protocols—What are they? / I-4 AppleTalk / I-4 Why did we design it? / I-5 Key goals of the AppleTalk architecture / I-6 The AppleTalk network system / I-8 AppleTalk connectivity / I-9 AppleTalk end-user services / I-15 AppleTalk protocol architecture and the ISO-OSI reference model / I-20 AppleTalk Phase 2 / I-24 Thoughts of the future / I-25 Scope / I-25 Reach / I-25 About Inside AppleTalk / I-26 Typographic and graphic conventions used in this book / I-27 Where to go for more information / I-28 iii Part I Physical and Data Links 1 LocalTalk Link Access Protocol / 1-1 Link access control / 1-3 Node addressing / 1-3 Node IDs / 1-4 Dynamic node ID assignment / 1-4 Data transmission and reception / 1-6 LLAP packet / 1-6 LLAP frame / 1-9 Data packet transmission / 1-10 Carrier sensing and synchronization / 1-10 Transmission dialogs / 1-11 Directed data packet transmission / 1-14 Broadcast data packet transmission / 1-15 Packet reception / 1-15 2 AppleTalk Address Resolution Protocol / 2-1 Protocol families and stacks / 2-3 Protocol and hardware addresses / 2-3 Address resolution / 2-3 AARP services / 2-5 AARP operation / 2-6 Address mapping / 2-7 Dynamic protocol address assignment / 2-8 Retransmission of AARP packets / 2-9 Filtering incoming packets / 2-9 AMT entry aging / 2-10 AARP packet formats / 2-11 iv C O N T E N T S 3 EtherTalk and TokenTalk Link Access Protocols / 3-1 802.2 / 3-3 ELAP packet format / 3-5 TLAP packet format / 3-6 Address mapping in ELAP and TLAP / 3-7 Use of AARP by ELAP and TLAP / 3-8 AARP specifics for ELAP and TLAP / 3-9 Zone multicast addresses used by ELAP and TLAP / 3-10 AppleTalk AARP packet formats on Ethernet and token ring / 3-11 Part II End-to-End Data Flow 4 Datagram Delivery Protocol / 4-1 Internet routers / 4-5 Sockets and socket identification / 4-5 Network numbers and a node’s AppleTalk address / 4-6 Special DDP node IDs / 4-6 AppleTalk node address acquisition / 4-7 Node address acquisition on nonextended networks / 4-8 Node address acquisition on extended networks / 4-8 DDP type field / 4-9 Socket listeners / 4-10 DDP interface / 4-10 Opening a statically assigned socket / 4-11 Opening a dynamically assigned socket / 4-12 Closing a socket / 4-12 Sending a datagram / 4-12 Datagram reception by the socket listener / 4-13 DDP internal algorithm / 4-13 DDP packet format / 4-13 Short and extended headers / 4-14 DDP checksum computation / 4-17 Hop counts / 4-17 Contents v DDP routing algorithm / 4-18 Optional “best router” forwarding algorithm / 4-20 Sockets and use of name binding / 4-21 Network number equivalence / 4-21 5 Routing Table Maintenance Protocol / 5-1 Internet routers / 5-4 Local routers / 5-4 Half routers / 5-4 Backbone routers / 5-4 Router model / 5-6 Internet topologies / 5-7 Routing tables / 5-8 Routing table maintenance / 5-10 Reducing RTMP packet size / 5-11 Aging of routing table entries / 5-12 Validity and send-RTMP timers / 5-13 RTMP Data packet format / 5-13 Sender’s network number / 5-15 Sender’s node ID / 5-15 Version number indicator / 5-15 Routing tuples / 5-16 Assignment of network number ranges / 5-16 RTMP and nonrouter nodes / 5-17 Nodes on nonextended networks / 5-17 Nodes on extended networks / 5-19 RTMP Route Data Requests / 5-20 RTMP table initialization and maintenance algorithms / 5-21 Initialization / 5-21 Maintenance / 5-21 Tuple matching definitions / 5-25 RTMP routing algorithm / 5-25 6 AppleTalk Echo Protocol / 6-1 vi C O N T E N T S Part III Named Entities 7 Name Binding Protocol / 7-1 Network-visible entities / 7-4 Entity names / 7-4 Name binding / 7-5 Names directory and names tables / 7-6 Aliases and enumerators / 7-6 Names information socket / 7-7 Name binding services / 7-7 Name registration / 7-7 Name deletion / 7-8 Name lookup / 7-8 Name confirmation / 7-8 NBP on a single network / 7-9 NBP on an internet / 7-10 Zones / 7-10 Name lookup on an internet / 7-10 NBP interface / 7-11 Registering a name / 7-12 Removing a name / 7-12 Looking up a name / 7-13 Confirming a name / 7-13 NBP packet formats / 7-14 Function / 7-15 Tuple count / 7-15 NBP ID / 7-15 NBP tuple / 7-15 8 Zone Information Protocol / 8-1 ZIP services / 8-4 Network-to-zone-name mapping / 8-4 Zone information table / 8-4 Zone information socket: ZIP Queries and Replies / 8-5 ZIT maintenance / 8-5 Contents vii Zone name listing / 8-7 Zone name acquisition / 8-9 Verifying a saved zone name / 8-9 Choosing a new zone name / 8-10 Zone multicasting / 8-10 Aging the zone name / 8-10 Packet formats / 8-11 ZIP Query and Reply / 8-11 ZIP ATP Requests / 8-13 ZIP GetNetInfo Request and Reply / 8-16 Zone multicast address computation / 8-18 NBP routing in IRs / 8-18 Generating FwdReq packets / 8-19 Converting FwdReqs to LkUps / 8-19 Zones list assignment / 8-20 Zones list changing / 8-21 Changing zones lists in routers / 8-21 Changing zone names in nodes / 8-22 Timer values / 8-24 Part IV Reliable Data Delivery 9 AppleTalk Transaction Protocol / 9-1 Transactions / 9-3 At-least-once (ALO) transactions / 9-5 Exactly-once (XO) transactions / 9-6 Multipacket responses / 9-9 Transaction identifiers / 9-9 ATP bitmap/sequence number / 9-10 viii C O N T E N T S Responders with limited buffer space / 9-12 ATP packet format / 9-13 ATP interface / 9-16 Sending a request / 9-17 Opening a responding socket / 9-18 Closing a responding socket / 9-19 Receiving a request / 9-19 Sending a response / 9-20 ATP state model / 9-21 ATP requester / 9-22 ATP responder / 9-24 Optional ATP interface calls / 9-26 Releasing a RspCB / 9-26 Releasing a TCB / 9-26 Wraparound and generation of TIDs / 9-27 10 Printer Access Protocol / 10-1 PAP services / 10-4 The protocol / 10-5 Connection establishment phase / 10-7 Data transfer phase / 10-9 Duplicate filtration / 10-11 Connection termination phase / 10-11 Status gathering / 10-12 PAP packet formats / 10-12 PAP function and result values / 10-16 PAP client interface / 10-16 PAP specifications for the Apple LaserWriter printer / 10-21 Contents ix 11 AppleTalk Session Protocol / 11-1 What ASP does / 11-4 What ASP does not do / 11-4 ASP services and features / 11-5 Opening and closing sessions / 11-6 Session maintenance / 11-9 Commands on an open session / 11-10 Sequencing and duplicate filtration / 11-14 Getting service status information / 11-15 ASP client interface / 11-16 Server-end calls / 11-16 Workstation-end calls / 11-23 Packet formats and algorithms / 11-27 Opening a session / 11-27 Getting server status / 11-29 Sending a command request / 11-30 Sending a write request / 11-32 Maintaining the session / 11-35 Sending an attention request / 11-36 Closing a session / 11-36 Checking for reply size errors / 11-37 Timeouts and retry counts / 11-38 SPFunction values / 11-39 12 AppleTalk Data Stream Protocol / 12-1 ADSP services / 12-4 Connections / 12-4 Connection states / 12-5 Half-open connections and the connection timer / 12-5 Connection identifiers / 12-6 x C O N T E N T S Data flow / 12-6 Sequence numbers