{"id":26166040,"url":"https://github.com/byteshiva/tcp-congestion-control","last_synced_at":"2026-05-20T14:14:36.410Z","repository":{"id":281828302,"uuid":"946555344","full_name":"byteshiva/tcp-congestion-control","owner":"byteshiva","description":"Advanced TCP Congestion Control in Go A Go implementation of TCP congestion control mechanisms, featuring a TCP server, client, and congestion control logic. Includes unit tests, integration tests, and GitHub Actions for CI/CD. Ideal for learning and building efficient network applications.","archived":false,"fork":false,"pushed_at":"2025-03-11T10:36:26.000Z","size":16,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T11:30:24.360Z","etag":null,"topics":["act","docker","gh","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/byteshiva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2025-03-11T10:22:06.000Z","updated_at":"2025-03-11T10:44:23.000Z","dependencies_parsed_at":"2025-03-11T11:41:39.019Z","dependency_job_id":null,"html_url":"https://github.com/byteshiva/tcp-congestion-control","commit_stats":null,"previous_names":["byteshiva/tcp-congestion-control"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/byteshiva/tcp-congestion-control","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteshiva%2Ftcp-congestion-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteshiva%2Ftcp-congestion-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteshiva%2Ftcp-congestion-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteshiva%2Ftcp-congestion-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byteshiva","download_url":"https://codeload.github.com/byteshiva/tcp-congestion-control/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteshiva%2Ftcp-congestion-control/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266785431,"owners_count":23983821,"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-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["act","docker","gh","golang"],"created_at":"2025-03-11T16:28:26.474Z","updated_at":"2026-05-20T14:14:36.356Z","avatar_url":"https://github.com/byteshiva.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TCP Congestion Control in Go\n\nThis project demonstrates the implementation of advanced TCP congestion control mechanisms using Go. It includes a basic TCP server and client, along with a congestion control algorithm to manage network congestion, prevent packet loss, and ensure fair bandwidth allocation.\n\n## Table of Contents\n1. [Introduction](#introduction)\n2. [Installation](#installation)\n3. [Usage](#usage)\n4. [Testing](#testing)\n5. [Troubleshooting](#troubleshooting)\n6. [Directory Structure](#directory-structure)\n7. [Conclusion](#conclusion)\n\n---\n\n## Introduction\n\nTCP congestion control is a critical aspect of network programming that ensures efficient and fair use of network resources. This project provides a comprehensive guide to implementing TCP congestion control in Go, including:\n\n- **Congestion Window (CWND)**: Controls the amount of data sent before receiving an acknowledgment.\n- **Slow Start Threshold (SSTHRESH)**: Determines the transition point between slow start and congestion avoidance phases.\n- **Acknowledgments (ACKs)**: Confirm receipt of data and adjust the congestion window.\n- **Retransmissions**: Handle lost or corrupted packets.\n\nThe project includes a basic TCP server and client, along with a congestion control mechanism implemented in the client.\n\n---\n\n## Installation\n\n### Prerequisites\n- Go (version 1.18 or higher)\n- Docker (for testing and troubleshooting)\n- GitHub CLI (`gh`)\n\n### Steps\n\n1. **Install Go and GitHub CLI using Nix**:\n   Run the following command to set up a development environment with Go and GitHub CLI:\n   ```bash\n   nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz -p golang gh -v\n   ```\n\n2. **Install `act` (GitHub Actions local runner)**:\n   After setting up the environment, install `act` using the GitHub CLI:\n   ```bash\n   gh extension install https://github.com/nektos/gh-act\n   ```\n\n3. **Clone the Repository**:\n   Clone this repository to your local machine:\n   ```bash\n   git clone https://github.com/byteshiva/tcp-congestion-control.git\n   cd tcp-congestion-control\n   ```\n\n4. **Install Dependencies**:\n   Run the following command to install Go dependencies:\n   ```bash\n   go mod tidy\n   ```\n\n5. **Build the Project**:\n   Build the project using the following command:\n   ```bash\n   go build -v ./...\n   ```\n\n---\n\n## Usage\n\n### Running the Server\nTo start the TCP server, run:\n```bash\ngo run main.go server\n```\n\n### Running the Client\nTo start the TCP client, run:\n```bash\ngo run main.go client\n```\n\n### Interacting with the Client\nOnce the client is running, you can type messages in the terminal. The server will echo the messages back to the client.\n\n---\n\n## Testing\n\n### Unit Tests\nRun unit tests for the congestion control logic:\n```bash\ngo test -v ./congestion\n```\n\n### Integration Tests\nRun integration tests to verify the interaction between the client and server:\n```bash\ngo test -v ./...\n```\n\n### Manual Testing\n1. Start the server:\n   ```bash\n   go run main.go server\n   ```\n2. Start the client:\n   ```bash\n   go run main.go client\n   ```\n3. Type messages in the client terminal and observe the server's responses.\n\n### Automated Testing with GitHub Actions\nThe project includes a GitHub Actions workflow to automate building and testing. The workflow file is located at `.github/workflows/go.yml`.\n\n---\n\n## Troubleshooting\n\n### Docker Permissions\nIf you encounter permission issues with Docker, add your user to the `docker` group:\n```bash\nsudo usermod -aG docker $USER\nnewgrp docker\n```\n\n### Go Build Issues\nIf you face issues while building the project:\n1. Ensure Go is installed correctly:\n   ```bash\n   go version\n   ```\n2. Verify the project structure and ensure all files are in place.\n3. Clean the build cache and rebuild:\n   ```bash\n   go clean -modcache\n   go build -v ./...\n   ```\n\n---\n\n## Directory Structure\n\n```\ntcp-congestion-control/\n├── main.go\n├── server/\n│   └── server.go\n├── client/\n│   └── client.go\n├── congestion/\n│   ├── congestion.go\n│   └── congestion_test.go\n├── go.mod\n├── go.sum\n├── integration_test.go\n└── .github/\n    └── workflows/\n        └── go.yml\n```\n\n---\n\n## Conclusion\n\nThis project provides a comprehensive guide to implementing advanced TCP congestion control in Go. By following the steps outlined in this README, you can set up, test, and troubleshoot the project effectively. Happy coding!\n\nFor further questions or contributions, feel free to open an issue or submit a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteshiva%2Ftcp-congestion-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyteshiva%2Ftcp-congestion-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteshiva%2Ftcp-congestion-control/lists"}