public static void process1(PeerFunc peerFunction){
		
		String filename = null;
		boolean exit = false;
		long startTime, endTime;
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner scan = new Scanner(System.in);
		
		while(!exit){
			
			System.out.println("\n1 Register a file\n2 Search a file\n3 Exit");
			switch(scan.nextInt()){
				case 1:{
					System.out.println("Enter the file name:");
					try {
						filename = br.readLine();
						
						//counting running time of registry
						startTime = System.currentTimeMillis();
						peerFunction.register(filename);
						endTime = System.currentTimeMillis();
						System.out.println("Running time of registry: " 
								+ (endTime - startTime) + "ms");
						
					} catch (IOException e) {
						e.printStackTrace();
					}
					break;
				}
				case 2:{
					System.out.println("Enter the file name:");
					try {
						filename = br.readLine();
						
						//counting running time of search
						int seqNumber = PeerInfo.local.seqNumber++;
						int hop = 0;
						MsgData msg = new MsgData(PeerInfo.local.ID, seqNumber, hop);
						startTime = System.currentTimeMillis();
						peerFunction.search(msg, PeerInfo.local.TTL, filename);
						endTime = System.currentTimeMillis();
						System.out.println("Running time of search: " 
								+ (endTime - startTime) + "ms");
						
						Thread.sleep(PeerInfo.local.TTL);
						boolean found = peerFunction.checkFound(filename);
						
						if(found){
							System.out.println("\n1 Download the file\n2 Cancel and back");
							switch(scan.nextInt()){
								case 1:
									//counting running time of download
									startTime = System.currentTimeMillis();
									peerFunction.download(filename);
									//count time in the network, 100ms per hop
									endTime = System.currentTimeMillis() + 100;
									System.out.println("Running time of download: " 
											+ (endTime - startTime) + "ms");
									break;
								case 2:
									break;
								default:
									break;
							}
						}
					} catch (IOException | InterruptedException e) {
						e.printStackTrace();
					}
					break;
				}
				case 3:
					exit = true;
					break;
				default:
					break;	
			}
		}
		
		scan.close();
	}