public static void main(String[] args) {
		Client w = null;
		try {
			// Default values
			
			int port = 42123;
			int ttl = 60;
			int szenarioToTest = 1;
			int performanceToTest = 1;

			double lambda = 0.5; // default lambda for sending packets (like
									// hello or data packets)
			dest = (Inet4Address) InetAddress.getByName("192.168.1.255");
			String statsFileName = "t2_client_stats.txt";
			String topologyFile = "t2_client_topology.txt";

			// create Options object
			Options options = new Options();

			// add options
			options.addOption("l", "level", true, "Set log level");
			options.addOption("a", "lambda", true, "Set lambda");
			options.addOption("f", "file", true, "File to print out statistcs");
			options.addOption("t", "topology", true,
					"File to print topology information to collect by the exploring szenario. You may specify this file without exploration szenario to load the topology");
			options.addOption("s", "szenario", true, "Szenario to test: 1=Exploring, 2=Close-by-Route, 4=Distant-Route, 7=all");
			options.addOption("p", "performace", true, "Performance test: 1=Flooding, 2=Dynamic, 3=both");
			options.addOption("ttl", true,
					"Time to life of this client in seconds per szenario and per performance: After this time, the client will terminate the current szenario (s). Default: 60");
			options.addOption("?", "help", false, "Print this help message");

			CommandLineParser parser = new PosixParser();

			CommandLine cmd = parser.parse(options, args);

			// automatically generate the help statement
			if (cmd.hasOption("?")) {
				HelpFormatter formatter = new HelpFormatter();
				formatter.printHelp("Starter", options);
				System.exit(1);
			}

			// Set log level
			if (cmd.getOptionValue("l") != null) {
				l.setLogLevel(Integer.parseInt(cmd.getOptionValue("l")));
			}

			// Set statistics file
			if (cmd.getOptionValue("f") != null) {
				statsFileName = cmd.getOptionValue("f");
			}
			
			if (cmd.getOptionValue("t") != null) {
				topologyFile = cmd.getOptionValue("t");
			}
			
			if (cmd.getOptionValue("a") != null) {
				lambda = Double.parseDouble(cmd.getOptionValue("a"));
			}

			
			//
			if (cmd.getOptionValue("ttl") != null) {
				ttl = Integer.parseInt(cmd.getOptionValue("ttl"));
			}
			
			//
			if (cmd.getOptionValue("s") != null) {
				szenarioToTest = Integer.parseInt(cmd.getOptionValue("s"));
			}

			// change port
			if (cmd.getOptionValue("p") != null) {
				performanceToTest = Integer.parseInt(cmd.getOptionValue("p"));
			}

			// Create client
			l.println("Starter.main: Creating client", Logger.NOTICE);
			w = new Client(port, szenarioToTest, performanceToTest, ttl, new File(topologyFile), new File(statsFileName));
			w.setPoissonLambda(lambda);

			w.start();

			w.join();
			l.println("Starter.main: Client stopped", Logger.NOTICE);
		} catch (Exception e) {
			StringWriter errors = new StringWriter();
			e.printStackTrace(new PrintWriter(errors));
			Logger.getInstance().println(errors.toString());
			w.shutdown();
		}

	}