Packet Programs

From setiquest wiki

Revision as of 20:33, 30 December 2011 by SigBlips (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Packet Programs are SonATA utilities that facilitate development, testing, and debugging the flow of data between various SonATA components. These are console programs that are run as needed from the Linux prompt or scripts. They also provide the capability to capture data for replay through the SonATA system or for other analysis. Packetgen creates data packets and sends them over the network or writes them to a disk file. Packetread reads a data stream, counts the packets, and checks for missing packets and optionally writes the data to disk. Packetrelay is used to capture a high speed data stream. The data may be written to a disk file or rebroadcast to a different multicast address. Packetsend reads a disk file that was created by packetgen or packetrelay and broadcasts the data packets over the network. Note: both packetrelay and packetsend must execute as super user to allow fixed priority POSIX real-time thread scheduling.

Contents

packetgen

generates single or dual polarization ATA Data Packets. (see: ~/SonATA/sig-pkg/ATApackets/include/ATADataPacket.h) The data are gaussian noise with optional continuous wave and/or pulsed signals drifting in frequency. The packets may be broadcast as multicast packets over the network or written to a disk file.

There are two modes. The default mode is channel data, simulating the output from the channelizer. The other mode is beam data, simulating data from the beamformer.

For channel mode, the default IP address is 239.1.1.1 and the port is 10000. For beam mode, the default IP address is 226.0.0.1 and the port is 9999. The default polarization is X and Y Linear. The gaussian noise is generated using different seeds for each polarization. The default number of packets is 10000. The default wake up interval is 0, so that the packets are sent as fast as possible. If the wakeup interval is non-zero, one set of packets is created at each wakeup interval, one for each polarization. The default noise power is 1.0. The default bandwidth is 104.8576 MHz which is appropriate for beam mode. There is no default signal description ( snr, drift, frequency). There can be multiple signals. The frequency parameter defines a new signal with whichever snr and drift was last specified.

All of the parameters are entered on the command line. There are defaults for each parameter.

Syntax

packetgen [-# seedX] [-% seedY] [-I] [-a ipAddr] [-p port] [-x] [-y] [-f packetFilename] 
			[-c channel] [-s source] [-C ] [-b] [-l] 
 			[-n numberOfPackets] [-i wakeupInterval] 
 			[-P noise power] [-B bandwidth] 
 			[-U usable fraction of bandwidth] 
 			[-X signal in X pol only] 
			[-Y signal in Y pol only] 
			[-Z signal in both pols] 
			[-O pulse time ON] 
			[-o pulse time OFF] 
			[-R Center Frequency] 
			{[-S snr] [-D drift] [-F freq]} 

   -#	seed	seed for the random number generator that creates the
		gaussian noise for the X polarization. (default: 1)

   -%	seed	seed for the random number generator that creates the
		gaussian noise for the Y polarization. (default: 7)

   -I		Swap the real and imaginary values of the complex data pairs (default: false)

   -a	ipAddr	IP Multicast Address for the broadcast packets 
		default: 227.1.1.1 for channel packets, 226.1.50.1 for beam packets,
		defaults to channel packets)

   -p	port	Port for multicast packets (default: 51000 for channel packets, 
		50000 for beam packets, defaults to channel packets)

   -x		Set polarization to XLINEAR and switch to single pol mode 
		(default: both X and Y polarizations)

   -y		Set polarization to YLINEAR and switch to single pol mode
		(default: both X and Y polarizations)

   -f	packetFilename	Filename for disk output. No network packets will be sent.
			(default: NULL, if filename empty data not written to disk.
			If filename specified,  no network packets are sent.)

   -c channel	Channel number (default: 0, if in channel mode)

   -s source	Type of packet format ( Channel=1 or Beam=0 ) 

   -C		Set polarization to Left and right circular 

   -b		Generate beam packets (default: channel packets)

   -l		Use lazy mode for marshalling data (default: false)

   -n	numberOfPackets	Number of packets to generate (default: 10000)

   -i 	wakeupInterval	Wait time between packets in microseconds (default: 0)

   -U	usable bandwidth	Usable fraction of the bandwidth (default: .75 for channel mode
				.6875 for beam mode)

   -X			Following signal description in X polarization only

   -Y			Following signal description in Y polarization only

   -Z			Following signal description in both X and Y polarizations

   -O	pulseOnTime	Time that a pulsed signal is ON (default: 1.0)

   -o	pulseOffTime	Time that a pulsed signal in OFF (default: 0.0)

   -R	cFreq		Center Frequency of the data (default: 1420 MHz)

   -P	noisePower	Mean power if gaussian noise. (default 1.0)

   -B	Bandwidth	Bandwidth of data stream (default: 0.54613333, reflects oversampling
			for a 0.4096 MHz channel)

   -S	snr		Signal to noise ratio of a signal

   -D   drift		Drift rate hz/sec of a signal

   -F 	freq		Frequency of a signal at baseband. -bw/2 <= 0.0 <= bw/2 

Examples

Example for channelizer:

./packetgen -x -b -B 3.276800 -R 1670.00 -a 226.0.0.1 -p 9999 -n 4000000 -l -i 500 -P 200 -S 20 -D -0.10 -F 1.000010

packetgen will create a single data stream of beam packets for the X linear polarization centered at 1670 MHz with a bandwidth of 3.276800 MHz. The multicast output address is 226.0.0.1 and the port number is 9999. 4,000,000 packets will be generated, one every 500 microseconds. Data marshalling is set to lazy mode, i.e. the packets will not be converted to network endian. The mean power of the noise is 200. There is one Continuous Wave (CW) signals with an SNR of 20, a drift of -0.10 and a frequency of 1.000010 offset from the center frequency of 1670.0 MHz, i.e. 1671.000010 MHz.

Example for the dx:

./packetgen -x -B 0.546333333 -a 239.1.1.1 -p 10000 -n 1000000 -P 100 -l -i 100 -S 10 -D -0.20 -F 0.000060

packetgen will create a single data stream of channel packets for the X linear polarization centered at 1420 MHz with a bandwidth of .546333333 MHz from which the DX will use the central .4096 MHz. The multicast output address is 239.1.1.1 and the port number is 10000. 1,000,000 packets will be generated, one every 100 microseconds. Data marshalling is set to lazy mode, i.e. the packets will not be converted to network endian. The mean power of the noise is 100. There is one Continuous Wave (CW) signals with an SNR of 10, a drift of -0.20 and a frequency of 0.000060 offset from the center frequency of 1420.0 MHz, i.e. 1420.000060 MHz.

packetread

reads a UDP multicast data stream from the network and creates a report that includes the number of packets received for each polarization, number of missing packets, and the data rates. This is useful for debugging network connections. packetread optionally writes the data to disk.

Syntax

packetread	[-a IP Address x.x.x.x (226.1.50.1)] 
			[-P Port Number (50000)] 
			[-s secondsToWait (32)] 
			[-w XYoutfile (false)] 
			[-d Write Data Only, no Headers (false)  ] 
 			[-X XonlyOutfile (false)] 
			[-Y YonlyOutfile (false)] 
			[-p Print first Header] 

	-a	IPaddress	Multicast INput address. Default: 226.1.50.1
	-P	port		Multicast Port Number. Default: 50000
	-s	seconds		Number of seconds to listen on the channel
	-w	XYoutfile	Both X and Y polarizations are written to file. Default: False
	-d			Only data is written to the file, no headers. Default: False
	-X	Xoutfile	Only the X polarization will be written to file. Default: False
	-Y	Youtfile	Only the Y polarization will be written to file. Default: False
	-p			Print the first Header from the data stream. Default: False 

Example

packetread -a 227.1.1.1 -P 51001 -s 20

packetread will listen on port 51001 with address 227.1.1.1 for 20 seconds and print a summary of the data received.

packetread is single threaded and cannot write to disk fast enough for high speed data streams. In those cases, packetrelay should be used.

packetrelay

is used to capture a high speed data stream. The data may be written to a disk file or rebroadcast to a different multicast address. This is the program that was used to collect all the setiQuest Data and the Voyager Demo data. packetrelay must run as super user to allow fixed priority POSIX real-time thread scheduling, hence the sudo.

Syntax

packetrelay [-?] [-c] [-f file] [-I inputHost] [-i inputPort] [-O outputHost] [-o outputPort] [-p[nnn] 

	-?: 		print usage and exit 
	-c: 		clone input into two data streams . Default: False
			The second output stream is sent to the output port plus 1.
	-f file: 	write to output file instead of socket . Default: False, null filename
			If no filename is specified, the data is broadcast on the output
			address and port.
	-I addr: 	input address : Default: 226.2.50.1
	-i port: 	input port . Default: 50000
	-n packets: 	# of packets to relay . Default: None
			This must be specified.
	-O addr: 	output address . Default: 226.1.51.1
	-o port: 	output port : Default: 50000
	-pNNN: 	        print every NNNth header. Default: False 

	-s pktsize: 	raw packets of size pktsize . Default: false, 0
			This option is for a data stream with non-standard or no Headers
	-V:             print version and exit 

Example

sudo packetrelay -f data-capture-beam1.pktdata -I 229.1.1.1 -i 51100 -n 5000000

packetsend

Reads a disk file that was created by packetgen or packetrelay and broadcasts the data packets over the network.Reads data from disk and sends to the network using multicast UDP. This is useful for replaying previously recorded data back into the system for further analysis or development / debugging. The packetsend utility is also used for feeding in the Voyager data for demo purposes. Note that packetsend will output UDP packets as fast as it can (flooding) unless the -i usec flag is used. Also note that packetsend must run as superuser to allow fixed priority POSIX real-time thread scheduling, hence the sudo.

Syntax

sudo packetsend [-?] [-b burst] [-c][-f file] [-i delay] [-J host] [-j port] [-P polarization] [-r loopcnt] [-S src] [-n nchan] 
	-?:              print usage and exit 
	-c:              channel packets, not beam packets . Default: False
	-f file:         read input data from file . Default: "BeamData"
	-i delay:        delay between bursts (usec) . Default: 0
	-J addr:         use output address addr . Default: 226.1.50.1
	-j port:         use output port port . Default: 50000
	-n nchan:        Number of channels to send . Default: 1
	-P polarization: polarization (X or Y) . Default: X Linear
	-r loopcnt:      number of times to loop through last buffers . Default: 0
	-s:              reset the header sequence numbers . Default: False
	-S src:          beam source (int32). Default: BEAM_104 MHZ
	-V:              print version and exit 

Examples

For the DX:

sudo packetsend -c -f ~/data/vger-xpol-2010-07-14-406.pktdata -J 229.1.1.1 -j 51100 -n 1 -i 1050 -b 1

packetsend reads the data file "~/data/vger-xpol-2010-07-14-406.pktdata" and creates channel packets that are sent on port 51100 with multicast address 229.1.1.1. The file contains one channel that was captured with packetrelay from the channelizer output. The channel is oversampled, so the bandwidth is .5463333 MHz with DX using the central .4096 MHz. Every 1050 microseconds the program will send 1 packet.

For the Channelizer:

sudo packetsend -P X -f ~/data/data-replay-beam2-2011-03-31-20:49.1513.5168.pktdata -J 226.1.50.55 -j 50200 -n 1 -i 300 -b 1

packetsend reads the file ~/data/data-replay-beam2-2011-03-31-20:49.1513.5168.pktdata and creates beam packets that are sent on port 51100 with multicast address 226.1.50.55. The bandwidth of the data is 8.73813333 MHz. It was captured from a Channelizer that was configured to create 16 output channels from the 104 MHz input stream. The data was converted from channel format to beam format so that it could be sent to the Channelizer again to produce 12 channels, 8 of which can be fed to DXs. Every 300 microseconds the program will send 1 packet.

Example of packetsend broadcasting the vger data file and packetread receiving it.

sudo packetsend -c -f ~/sonata_install/data/vger-xpol-2010-07-14-406.pktdata -J 229.1.1.1 -j 51100 -n 1 -i 1050 -b 1
b = 0x939990, packets = 0
b = 0x9399b0, packets = 0
75002 packets sent in 81.964 sec
Total = 3.12008e+08 bytes, rate = 30.4532 Mbps

In another window:

packetread -a 229.1.1.1 -P 51100 -s 90
Waiting 90 seconds
MCAddress 229.1.1.1 MCPort 51100
Got 75002 packets; 2 gap(s) in sequence; 2 Total Missed Packets
Total Elapsed Time for Transmission = 80.7387
Packets length = 4160 bytes
Samples/Packet = 1024
Gbit/s = 0.0309154
kPackets/s = 0.928947
kSamples/s = 951.242
Packets received for channel 0 X pol 75002 Y Pol 0

External links

← System Operation Index Utilities →
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox