@Override
	public void run() {
		int buffersize=size;
		double datasize=30*buffersize*1024;
		System.out.println(datasize+"");
		int num=(int)datasize/buffersize;
		byte toSend[] = new byte[buffersize];
		byte toReceive[] = new byte[buffersize];		
		for (int i=0; i<buffersize; i++){
			toSend[i] = (byte)2;
		}
		long start=System.currentTimeMillis();// TODO Auto-generated method stub
		try {
			DatagramSocket clientSocket=new DatagramSocket();
			InetAddress ipaddress=InetAddress.getByName("localhost");
			
			for(int i=0;i<num;i++){
				
				DatagramPacket sendPacket=new DatagramPacket(toSend, buffersize,ipaddress,8082);
				clientSocket.send(sendPacket);
				DatagramPacket receivePacket=new DatagramPacket(toReceive, buffersize);
				
				clientSocket.receive(receivePacket);
				//System.out.println(i);
			}
			
			clientSocket.close();
			
			
		} catch (SocketException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		long end=System.currentTimeMillis();
		long dur=end-start;
		float latency=(float) (0.5*(float)dur/(float)datasize);
		System.out.println("The Time is:"+dur);
		if(buffersize==1){
			System.out.println("The Latency is:"+latency+"ms");
		}
		double throuput=4000*(double)datasize/(double)(1024*1024);
		throuput=throuput/(dur);
		System.out.println("The Throughput is"+throuput+"M/s");
		
	}