{"id":16332883,"url":"https://github.com/davidyslu/USTC-TK2016","last_synced_at":"2025-10-14T20:30:34.161Z","repository":{"id":54528039,"uuid":"185111033","full_name":"davidyslu/USTC-TK2016","owner":"davidyslu","description":"Toolkit for processing PCAP file and transform into image of MNIST dataset","archived":false,"fork":false,"pushed_at":"2024-01-04T13:18:42.000Z","size":219,"stargazers_count":238,"open_issues_count":11,"forks_count":65,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-20T08:07:53.371Z","etag":null,"topics":["traffic-classification","ustc-tk2016"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidyslu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-06T02:36:55.000Z","updated_at":"2025-05-13T03:34:17.000Z","dependencies_parsed_at":"2024-10-27T10:55:52.652Z","dependency_job_id":"152d7510-ba1c-48e2-b4dd-d2ba451deffa","html_url":"https://github.com/davidyslu/USTC-TK2016","commit_stats":null,"previous_names":["davidyslu/ustc-tk2016","yungshenglu/ustc-tk2016"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davidyslu/USTC-TK2016","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidyslu%2FUSTC-TK2016","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidyslu%2FUSTC-TK2016/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidyslu%2FUSTC-TK2016/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidyslu%2FUSTC-TK2016/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidyslu","download_url":"https://codeload.github.com/davidyslu/USTC-TK2016/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidyslu%2FUSTC-TK2016/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020905,"owners_count":26086948,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["traffic-classification","ustc-tk2016"],"created_at":"2024-10-10T23:33:34.685Z","updated_at":"2025-10-14T20:30:33.888Z","avatar_url":"https://github.com/davidyslu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# USTC-TK2016\n\nThis repository is a toolkit called \"USTC-TK2016\", which is used to parse network traffic (`.pcap` file). Besides, the dataset is \"USTC-TFC2016\".\n\n* The [`master`](https://github.com/yungshenglu/USTC-TK2016/tree/master) branch can only run on Windows environment.\n* The [`ubuntu`](https://github.com/yungshenglu/USTC-TK2016/tree/ubuntu) branch can run on Ubuntu Linux 16.04 LTS environment.\n\n\u003e **NOTICE:** This repository credits to [echowei/DeepTraffic](https://github.com/echowei/DeepTraffic)\n\n---\n## Installation\n\n1. Clone this repository on your machine\n    ```bash\n    # Clone the repository on \"master\" branch\n    $ git clone -b master https://github.com/yungshenglu/USTC-TK2016\n    ```\n2. Install the required packages via the following command\n    ```bash\n    # Run the command at the root of the repository\n    $ pip3 install -r requirements.txt\n    ```\n    * The requried packages are listed as follow:\n        * [`numpy 1.16.4`](https://pypi.org/project/numpy/)\n        * [`PIL 1.1.6`](https://pypi.org/project/PIL/)\n\n---\n## Execution\n\n\u003e **NOTICE:** You are on the `master` branch now!\n\n1. Download the traffic dataset **USTC-TFC2016** and put it into the directory [`1_Pcap\\`](1_Pcap/)\n    * You can download the traffic dataset **USTC-TFC2016** from my another [repository](https://github.com/yungshenglu/USTC-TFC2016).\n2. Open the PowerShell and run `1_Pcap2Session.ps1` (take a few minutes)\n    * To split the PCAP file by each **session**, please make sure the line 10 and 14 in `1_Pcap2Session.ps1` is uncommented and make line 11 and 15 is in comment.\n    * To split the PCAp file by each **flow**, please make sure the line 11 and 15 in `1_Pcap2Session.ps1` is uncommented and make line 10 and 14 is in comment.\n    * Run [`1_Pcap2Session.ps1`](1_Pcap2Session.ps1)\n        ```bash\n        # Make sure your current directory is correct\n        PS\u003e .\\1_Pcap2Session.ps1\n        ```\n    * If succeed, you will see the following files (folders) in folder [`2_Session\\`](2_Session/)\n        * `AllLayers\\`\n        * `L7\\`\n3. Run [`2_ProcessSession.ps1`](2_ProcessSession.ps1) (take a few minutes)\n    ```bash\n    # Make sure your current directory is correct\n    PS\u003e .\\2_ProcessSession.ps1\n    ```\n    * If succeed, you will see the following files (folders) in folder [`3_ProcessedSession\\`](3_ProcessedSession/)\n        * `FilteredSession\\` - Get the top 60000 large PCAP files\n        * `TrimedSession\\` - Trim the filtered PCAP files into size 784 bytes (28 x 28) and append `0x00` if the PCAP file is shorter than 784 bytes\n        * The files in subdirectory `Test\\` and `Train\\` is random picked from dataset.\n4. Run [`3_Session2Png.py`](3_Session2Png.py) (take a few minutes)\n    ```bash\n    # Make sure your current directory is correct\n    PS\u003e python3 3_Session2png.py\n    ```\n    * If succeed, you will see the following files (folders) in folder [`4_Png\\`](4_Png/)\n        * `Test\\` - For testing\n        * `Train\\` - For training\n5. Run [`4_Png2Mnist.py`](4_Png2Mnist.py) (take a few minutes)\n    ```bash\n    # Make sure your current directory is correct\n    PS\u003e python3 4_Png2Mnist.py\n    ```\n    * If succeed, you will see the the training datasets in folder [`5_Mnist\\`](5_Mnist/)\n        * `train-images-idx1-ubyte`\n        * `train-images-idx3-ubyte`\n        * `train-images-idx1-ubyte.gz`\n        * `train-images-idx3-ubyte.gz`\n\n---\n## Contributor\n\n\u003e **NOTICE:** You can follow the contributing process [CONTRIBUTING.md](CONTRIBUTING.md) to join me. I am very welcome any issue!\n\n* Author\n    * [Wei Wang](https://github.com/echowei) - ww8137@mail.ustc.edu.cn\n* Contributor\n    * [David Lu](https://github.com/yungshenglu)\n\n---\n## License\n\n[Mozilla Public License Version 2.0](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidyslu%2FUSTC-TK2016","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidyslu%2FUSTC-TK2016","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidyslu%2FUSTC-TK2016/lists"}