Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking /
Chapter 7 - Datagram Delivery Protocol (DDP) / Using DDP


Measuring Packet-Delivery Performance

You use the AppleTalk Echo Protocol (AEP) to measure the performance of an AppleTalk network. Knowing the approximate speed at which an AppleTalk internet delivers packets is helpful in tuning the behavior of an application that uses one of the higher-level AppleTalk protocols, such as ATP and ADSP. You can also use AEP to test whether a node is on the network.

To tune an application, you need to know the round-trip time of a packet between two nodes on an AppleTalk internet. This is dependent on such factors as the network configuration, the number of routers and bridges that a packet must traverse, and the amount of traffic on the network; as these change, so does the packet transmission time. Routines belonging to the interfaces of both ATP and ADSP let you specify retry count and interval numbers whose optimum values you can better assess if you know the average round-trip time of a packet on your application's network.

AEP is implemented in each node as a DDP client process referred to as the AEP Echoer. The AEP Echoer uses a statically assigned socket, socket number 4, known as the echoer socket. The AEP Echoer listens for packets received through this socket.

Whenever it receives a packet, the AEP Echoer examines the packet's protocol type field to determine if the packet is an AEP packet, indicated by a value of 4. If it is, the first byte of the data portion of the packet serves as a function field. AEP uses two function codes:

The AEP Echoer sets this field to a value of 2 to indicate that the packet is now a reply packet, then it calls DDP to send a copy of the packet back to the socket from which it originated. The AEP packet that you send is referred to as an Echo Request packet; the modified AEP packet that the AEP Echoer sends back to you is referred to as an Echo Reply packet.

Here are some general guidelines that you should follow in using the AEP Echoer:

Follow these steps to send a packet to a target node and have AEP echo that packet back to your socket listener:

  1. Write a socket listener to be used to receive an Echo Reply packet back from the target node to which you are sending the Echo Request packet.

    The AEP Echoer will send the Echo Reply packet to the socket from which you send the Echo Request packet. Follow the general instructions described earlier in this chapter that explain how to write a socket listener.

  2. Call the POpenSkt function to open a socket from which to send an Echo Request packet, and assign your socket listener to that socket.
  3. Determine the internet address of the target node to which you want to send an Echo Request packet.

    You can use the Name-Binding Protocol (NBP) to get the address of the destination application for which you want to measure round-trip packet delivery, and substitute the socket ID of the AEP Echoer; the socket number of the AEP Echoer is always 4
    on every node. NBP routines are described in the chapter "Name-Binding Protocol (NBP)" in this book.

  4. Prepare the datagram to be sent to the AEP Echoer on the target node by building
    a write-data structure with specific values for certain fields. You can use the BuildDDPwds procedure for this purpose.

    Set the destination socket number equal to 4 to indicate that it's the Echoer socket; set the DDP protocol type field also equal to 4 to indicate that the packet belongs to the AEP implementation on the target node; set the first byte of the data portion equal to 1 to indicate that this is an Echo Request packet. Fill in the destination network number and node ID for the target system; these are the numbers that NBP returned to you (see the preceding step).

  5. Call the PWriteDDP function to send the Echo Request to the target node. As the value of the wdsPointer parameter, specify the pointer to the write data structure that you created.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996