1.2d1
The BSDLLCTest sample demonstrates how to read and write Ethernet Link Layer Control (LLC) packets directly to the Ethernet driver using BSD Raw Mode (PF_NDRV) API's. This update of the sample implements Quinn's MoreAuthSample v1.0b3 code so that the sample demonstrates the use of a tool to open a PF_NDRV socket with supervisory privileges as well as using the MoreAuthSample to return the privileged socket to the application.
This sample assumes an understanding of the use of the MoreAuthSample code. You can obtain the MoreAuthSample code from the DTS Sample Code Web Site.
The sample contains the following items.
The BSDLLCTest sample is used to send or to receive Ethernet LLC type packets. The sample does not have a User Interface to handle Ethernet Type I packets (e.g normal TCP/IP packets). Launch a copy of the sample application on one machine designated to receive packets and another copy on a sender system.
After launching the sample, ensure that the "Ethernet Port" popup button is set to the desired port to send/recieve packets. You can specify the Source Address or Destination address to be used for outgoing packets. By default, in send mode, the packet is set to be broadcast on the local network and the source address is set to that of the selected port. For receiving packets, the destination address is that of the selected port. You must delimit each hex word of the source and/or destination Ethernet address with a ':' or '-' character.
Specify the desired Service Access Protocol (SAP) address to use. If you enter a SAP addreess of "0xAA", you will also need to enter the desired Sub Network Access Protocol (SNAP) address to use.
Click the "Send/Receive" radio button to enable the desired test function. For the "Receive" test, the test runs until the Cancel Test button is clicked. For the "Send" test, the application will send "Num Packets" of 1500 bytes to the selected interface driver.
Every time that the application is used and the "Do Test" button is clicked, the system will present an Authentication dialog. You must enter the admininistrative User Name and Password in order to continue with the test.
You can build the sample using Project Builder from the Mac OS X 10.2 developer tools. Open the project file (BSDLLCTest.pbproj), make sure that the "BSDLLCTest" target is selected, and choose Build from the Build menu. This will automatically build the application and the helper tool.
The BSDLLCTest code requires the presence of Mac OS X 10.1.x or greater to run.
You can build the sample with Project Builder from the December 2002 Developer Tools.
The BSDLLCTest sample demonstrates what happens when an application floods an Ethernet driver with too many packets at once - the outgoing packets are dropped. The default setting for outbound packets is 10000. If the Receiver side is active, you will find that less than 20% of the outbound packets are received. This is not a problem with the receive portion of the test, but with the sender. You can verify this using an Ethernet sniffer to watch the Ethernet traffic between the sender and receiver.
Under Mac OS X 10.1.x, you cannot send an Ethernet packet with the size field set to 1500 via a PF_NDRV socket. (This is an issue with PF_NDRV sockets only). The application will change the value of 1500 to 1499 for all outbound packets when running under 10.1.X.
If you have run a previous version of this sample and the program fails to use the tool to open a PFNDRV socket, you may be using an outdated version of the GetPFNDRSocketTool. Trash the "~user/Library/Application Support/BSDLLCTest" folder and launch the application again.
If you find any problems with this sample, mail <DTS@apple.com> and Ill try to fix them up.
1.2d1 (June 2003)
Apple Developer Technical Support
Networking, Communications, Hardware
1 Jun 2003