Data-TDMA

 view release on metacpan or  search on metacpan

lib/Data/TDMA.pm  view on Meta::CPAN

		}
		# Sorry, we looked, and didn't find it.
		return undef
			if $slot_high > $time;
	}
	
	
	# We've done all this work here calculating which slot number to
	# ask the frame for, rather than put the math in the Frame module
	# so we just ask the frame for that slot, rather than hand it a 
	# date, and say, find out which slot that is (which would be an
	# intense grep on a large array full of objects...)
	
	# And, returning the slot gets the payloa of that slot, not just
	# the time.
	return $frame->get_slot( $slot_num );
}

1;


=head1 NAME

Data::TDMA

=head1 ABSTRACT

A module to communicate TDMA with perl.

=head1 USAGE

See the sub-modules, 

	L<Data::TDMA::Constants>
	L<Data::TMDA::Day>
	L<Data::TDMA::Day::Epoch>
	L<Data::TDMA::Day::Epoch::Frame>
	L<Data::TDMA::Day::Epoch::Frame::Slot>

It may also be useful to view the various cryptograhic modules
which can be useful with this set of modules, as well as L<Time::HiRes>

=head1 TDMA in a Nutshell

The key to managing data sharing is the Time Division Multiple Access (TDMA)
process, a frequency-hopped, time-sequenced transmission scheme. As many as 
32 subscribers in each net are assigned time slots within a cycle (or "epoch") 
that is 12.8 minutes long. Each epoch is subdivided into 64 frames, each of 
which consists of 1,536 frames of 7.8125 milliseconds each. One of the 
participants maintains the "clock" to ensure fidelity. Up to 128 sub-nets 
can be formed simultaneously. 
	
 JTIDS-Link 16, US Navy Warfighter's Encyclopedia
 (see references)

=head1 TDMA in (a whole lot of) Detail

TDMA is the division of a day into multiple epochs, which are further
subdivided into frames, which are then subdivided again, into slots.

The basic formula is thus:

	1 TDMA Day   = 112.5 Epochs
	1 TDMA Epoch = 64 frames
	1 TDMA Frame = 1536 Slots
	1 TDMA Slot  = 0.0078125 seconds (1/128 second)

	# Thus, walking back up the hierarchy, we see that:
	
	1 TDMA Frame = 12 seconds
	1 TDMA Epoch = 12.8 minutes (768 seconds)
	1 TDMA Day   = 1440 minutes
	
	# It may also be helpful to know that
	
	1 TDMA Epoch = 98,304 slots

The basic unit of communication in the TDMA network is the slot. 
The amount of data that can be communicated in a slot (1/128 second)
of course varies from network to network. If we assume a transmit rate 
in the HF spectrum, we might be transmitting in the range of 9600bps 
(which is pretty typical, but for example's sake, we'll use an easier
number). If instead we transmit at 16,000 bits per second, that boils
down to:
	
	125 bits per slot
	192,000 bits per frame
	294,912,000 bits per epoch
	33,177,600,000 bits per day
	
	# Now, let's do the important math for digital communication
	
	~15 bytes per slot
	2,400 bytes per frame
	36,864,000 bytes per epoch
	4,147,200,000 bytes per day

So while on the surface, it seems that a relatively sedate rate of
communication (16kbit), over relatively mundane technology (HF radio),
it is still possible to transmit a large amount of data to a large
amount of people (since there is no limit to the number of receivers).

TDMA has a number of qualities that make it very useful. First, as long
as everyone in the "loop" has the correct time, everyone knows what data
they should be looking at. They can also correlate this with cryptology
and hop frequencies during transmission (or, tcp ports if you like, for 
a wire-based TDMA), making the protocol very difficult to listen in on,
and also very difficult to jam. 

Additional measures can be taken to make TDMA further robust or more
secure, but they are beyond the scope of this document. You may find
more at L<Data::TDMA::Constants>

TDMA however is generally not applied to on-wire technology, and is
instead broadcast over radio networks. Many assumptions could be made
about its application to on-wire technology, such as encryption and
evasion. Substantially more data can be communicated over e.g., 
gigabit ethernet. At this point, the processor and memory (and network
transit time) become the serious bottlenecks.

=head1 USAGE



( run in 0.735 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )