H O M E
O V E R V I E W
B A C K G R O U N D
O S I   M O D E L
P H A S E   I
P H A S E   I I
P H A S E   I I I
P H A S E   I V
P I C T U R E S
A L G O M A  U

The Serial and Audio Cable

In order to simulate a Bongo Link, a cross-over 9-pin serial cable was constructed to connect the two linux boxes together. This was used for testing, as there was a concern for buffer overruns and packet dumping with such slow speeds between the two Linux boxes. A network card was ripped out of each Linux box, and the serial cable was placed inbetween instead of the crossover cable.

Even easier to harness the network card, are the serial ports. Under Linux we’re taught that files are devices, and devices are files.  To read and write to the serial ports we first make our file descriptor and make it point to the device /dev/ttyS0 (which refers to the serial port). Then you’re just a read() and write() away from sending and receiving data.  This is shown below:

int serial_fd;
serial_fd=open(“/dev/ttyS0”, O_RDWR, 0);

read(serial_fd, &buf, size);
write(serial_fd, &buf, size);

Now we just have to read packets from eth0 and write them to our serial ports on both machines. Some difficulties arose while testing, but it was found that the machines were able to keep up with the demand even at extremely slow speeds.

Since the Bongo Link would eventually be “sound driven”, more testing was done, but instead of the serial ports, soundcards were placed in each box and an audio cable (male-male stereo headphone) was placed beween as shown below:

To access the soundcard under Linux, we open the /dev/dsp file and do simple read() and write() commands to the file descriptor pointing to the device.

int sound_fd=open(“/dev/dsp”, O_RDONLY, 0);

read(sound_fd0, &buf, size);
write(sound_fd0, &buf, size);

By setting the bitrates with the ioctl function, we could increase and decrease the “bandwidth”.  Testing with the audio cable turned out better than with the serial link. We now have the tools to replace the audio cable with some speakers and microphones which was Phase III.

HomeOverviewBackgroundOSI Model |
Phase IPhase IIPhase IIIPhase IVPictures |
|
Algoma University |