# P2P **Repository Path**: sysu_nww/P2P ## Basic Information - **Project Name**: P2P - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-03-28 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # P2P ## Host roles |role|host|IP|port| |:---:|:---:|:---:|:---:| |peer0|UbuntuServer|192.168.56.104|6666| |peer1|Ubuntuserver2|192.168.56.105|6666| |tracker|UbuntuClient|192.168.56.106|6666| |client|manjaro|192.168.56.1|6666| ## The format of transfer file information from peer to tracker(json) * Items contained: * request type(request_type):1(stand for register) * A list(file_list) containing of names and sizes of media files * Tracker response: * On success,return {'status_code':200} * Else, return {'status_code':'404'} ## The format of request and response between peers(json) * Request * Request type(request_type) * request type is 1: * File name(file_name) * Chunk start number(start_num) * Chunk end num(end_chunk) * request type is 2: * message(message) * Response * data(if request type is 1) ## The format between tracker and client(json) * Request * request type(request_type):0 * file name(file_name) * Response * status code * 200 The file exists on someone else's computer * 404 THe file doesn't exist * a IP list which contains IPs of computers who has the file(IP_list) * size of the file(file_size) # Chatting All client send message to server first,then the server forwarding message. ## The format for message from client to server * request type(request_type):2 * message(message) ## The format for message from server to each registered client * source(source) * message(message)