* @param numberOfTraces	the number of traces to be created
	 * @param hops				the number of hops for each trace
	 */
	public void createTimeTraces(int numberOfTraces, int hops, int timeInterval){
		packets = new ArrayList<MACPacket>();
		nodes = new ArrayList<Node>();
		
		int numberOfNodes = 21;
		
		for(int i = 0; i < numberOfNodes;i++){
			byte[] tmpNodeId = new byte[2];
			for(int j = 0; j < tmpNodeId.length;j++){
				double randomDouble = Math.random()*256.0;
				tmpNodeId[j]= (byte)(int)randomDouble;
			}
			//check for doubled address
			boolean existing = false;
			for(Node n : nodes){
				if(Arrays.equals(n.getNodeId(),tmpNodeId)){
					existing = true;
					i--;
				}
			}
			//add new node to nodelist
			if(!existing){
				Node tmpNode = new Node(tmpNodeId);
				nodes.add(tmpNode);
			}
		}
		
		
		
		//more complex part: create traces
		for(int i = 0; i < numberOfTraces;i++){
			//set up hops
			//a list of nodes left to use in the trace
			ArrayList<Node> nodesLeft = new ArrayList<Node>();
			nodesLeft.addAll(nodes);
			Node actualPosition = nodesLeft.remove((int)(Math.random()*nodesLeft.size()));
			Node firstPosition = new Node(actualPosition.getNodeId());
			Node lastPosition = nodesLeft.remove((int)(Math.random()*nodesLeft.size()));
			int timeCounter = (int)(Math.random()*timeInterval); 
			//generate a flowLabel
			//first the id from the nodeid/address between 0 and 1024
			int flowLabelId = (Calculator.byteArrayToInt(actualPosition.getNodeId())) % 1024;
			//now a counter-number for the label
			int flowLabelCounter = (int)(Math.random()*1024);
			int flowLabel = (flowLabelId << 10) + flowLabelCounter;
			byte[] flowLabelArray = ByteBuffer.allocate(4).putInt(flowLabel).array(); //array with one field to much ... ignore it
			
			//example data with flow label, originator and final destination
			byte[] payload = new byte[]{107,59,0,0,1,58,2,(byte) 133,0,122,46,0,0,0,0,1,1,0,0,0,0,0,0};
			//now use flowLabel to change the payload at position 2,3 and 4
			payload[2] = flowLabelArray[1];
			payload[3] = flowLabelArray[2];
			payload[4] = flowLabelArray[3];
			
			for(int j = 0; j < hops; j++){
				//get next hop, 
				Node nextPosition;
				//last hop ? jump to destination
				if(j == hops -1){
					nextPosition = lastPosition;
				} 
				//... or it's a new one
				else {
					nextPosition = nodesLeft.remove((int)(Math.random()*nodesLeft.size()));
				}

				//create info for the two packets
				MACPacket p = new MACPacket(true);
				p.setSourceNode(actualPosition);
				p.setDestinationNode(nextPosition);
				p.setPayload(payload);
				
				p.setIPHC(true);
				p.setOriginator(firstPosition.getNodeId());
				p.setFinalDestination(lastPosition.getNodeId());
				
				byte[] seconds = ByteBuffer.allocate(4).putInt(timeCounter).array();
				p.setSeconds(seconds);
				p.setMicroSeconds(new byte[]{0,0,0,0});
				p.setMilliSeconds(new byte[]{0,0,0,0});
				p.setLoggedAt(actualPosition);
				
				//adding packet one (sent packet)
				actualPosition.addSentPackets(p);
				packets.add(p);
				
				//changing time for packet two
				timeCounter += 1; //1 seconds transmission time
				p = new MACPacket(true);
				p.setSourceNode(actualPosition);
				p.setDestinationNode(nextPosition);
				p.setPayload(payload);
				
				p.setIPHC(true);
				p.setOriginator(firstPosition.getNodeId());
				p.setFinalDestination(lastPosition.getNodeId());
				
				seconds = ByteBuffer.allocate(4).putInt(timeCounter).array();
				p.setSeconds(seconds);
				p.setMicroSeconds(new byte[]{0,0,0,0});
				p.setMilliSeconds(new byte[]{0,0,0,0});
				p.setLoggedAt(nextPosition);
				
				//... and adding it (received packet)
				nextPosition.addReceivedPackets(p);
				packets.add(p);
				
				//settings for the next 2 packets of the trace
				actualPosition = nextPosition;
			}
		}
	}