private static int onOff(int source) {

		assert((source >= 0) && (source < Simulator.numNodes()));

		if(m_nodeStates == null) {
			m_nodeStates = new int [Simulator.numNodes()];
		    for(int n = 0; n < m_nodeStates.length; n++)
		    	m_nodeStates[n] = 0;
		}

		// advance state: off -> on OR on -> off
		if(m_nodeStates[source] == 0) {
			if(Simulator.randDouble() < Config.burstAlpha()) {
				m_nodeStates[source] = 1;
			}
		} else if (Simulator.randDouble() < Config.burstBeta()) {
			m_nodeStates[source] = 0;
		}

		// generate packet
		if(m_nodeStates[source] == 1) {
			double r1 = (Config.injectionRate() * (1.0 + Config.burstBeta() / Config.burstAlpha())) 
					/ (double)Config.packetSize();
			if (Simulator.randDouble() < r1)
				return Config.packetSize();
		}

		return 0;
	}