{"id":13799932,"url":"https://github.com/wmnsk/go-gtp","last_synced_at":"2026-01-14T13:58:27.160Z","repository":{"id":35001797,"uuid":"168963725","full_name":"wmnsk/go-gtp","owner":"wmnsk","description":"GTP (GPRS Tunneling Protocol) implemented in pure Golang.","archived":false,"fork":false,"pushed_at":"2025-12-25T04:48:12.000Z","size":9189,"stargazers_count":232,"open_issues_count":0,"forks_count":81,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-12-26T18:41:35.612Z","etag":null,"topics":["3g","4g","5g","5gc","epc","gprs","gtp","lte","mobile","pgw","protocol","sgw","telecom","upf"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wmnsk.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-02-03T16:06:43.000Z","updated_at":"2025-12-25T04:48:08.000Z","dependencies_parsed_at":"2022-08-08T03:16:10.489Z","dependency_job_id":"908ebe8c-22c7-4c9d-9298-bd6482723aad","html_url":"https://github.com/wmnsk/go-gtp","commit_stats":null,"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"purl":"pkg:github/wmnsk/go-gtp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmnsk%2Fgo-gtp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmnsk%2Fgo-gtp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmnsk%2Fgo-gtp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmnsk%2Fgo-gtp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wmnsk","download_url":"https://codeload.github.com/wmnsk/go-gtp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmnsk%2Fgo-gtp/sbom","scorecard":{"id":1237631,"data":{"date":"2025-07-07","repo":{"name":"github.com/wmnsk/go-gtp","commit":"911372d217b604ac8e0f65931235178644488b7b"},"scorecard":{"version":"v5.2.1-18-gbb9c347d","commit":"bb9c347dff6349d986baab6578a46d68a5524c62"},"score":4.5,"checks":[{"name":"Maintained","score":3,"reason":"4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","Warn: no topLevel permission defined: .github/workflows/golangci-lint.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":2,"reason":"Found 2/7 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/wmnsk/go-gtp/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/wmnsk/go-gtp/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/wmnsk/go-gtp/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/wmnsk/go-gtp/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/wmnsk/go-gtp/golangci-lint.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/wmnsk/go-gtp/golangci-lint.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/wmnsk/go-gtp/golangci-lint.yml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":10,"reason":"project is fuzzed","details":["Info: GoBuiltInFuzzer integration found: gtp_fuzz_test.go:13","Info: GoBuiltInFuzzer integration found: gtpv0/ie/ie_fuzz_test.go:9","Info: GoBuiltInFuzzer integration found: gtpv0/message/message_fuzz_test.go:9","Info: GoBuiltInFuzzer integration found: gtpv0/message/message_fuzz_test.go:17","Info: GoBuiltInFuzzer integration found: gtpv1/gtpv1_fuzz_test.go:9","Info: GoBuiltInFuzzer integration found: gtpv1/ie/ie_fuzz_test.go:9","Info: GoBuiltInFuzzer integration found: gtpv1/message/message_fuzz_test.go:9","Info: GoBuiltInFuzzer integration found: gtpv1/message/message_fuzz_test.go:17","Info: GoBuiltInFuzzer integration found: gtpv2/ie/ie_fuzz_test.go:13","Info: GoBuiltInFuzzer integration found: gtpv2/message/message_fuzz_test.go:11","Info: GoBuiltInFuzzer integration found: gtpv2/message/message_fuzz_test.go:27"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-09-14T09:25:05.260Z","repository_id":35001797,"created_at":"2025-09-14T09:25:05.260Z","updated_at":"2025-09-14T09:25:05.260Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28422388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["3g","4g","5g","5gc","epc","gprs","gtp","lte","mobile","pgw","protocol","sgw","telecom","upf"],"created_at":"2024-08-04T00:01:07.352Z","updated_at":"2026-01-14T13:58:27.154Z","avatar_url":"https://github.com/wmnsk.png","language":"Go","funding_links":[],"categories":["Protocols"],"sub_categories":["GTP","GTP/PFCP"],"readme":"# go-gtp: GTP in Go\n\nPackage gtp provides simple and painless handling of GTP (GPRS Tunneling Protocol) in the Go programming language.\n\n![CI status](https://github.com/wmnsk/go-gtp/actions/workflows/go.yml/badge.svg)\n[![golangci-lint](https://github.com/wmnsk/go-gtp/actions/workflows/golangci-lint.yml/badge.svg)](https://github.com/wmnsk/go-gtp/actions/workflows/golangci-lint.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/wmnsk/go-gtp.svg)](https://pkg.go.dev/github.com/wmnsk/go-gtp)\n[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/wmnsk/go-gtp/blob/main/LICENSE)\n\n## Project Status\n\nThis project is still EXPERIMENTAL.  \nAny part of the implementations (including exported APIs) may be changed before released as v1.0.0.\n\n## Features\n\n* Flexible enough to control everything in the GTP protocol, making it suitable for developing mobile core network nodes or testing tools for them.\n* Provides many helpers that are kind to developers, such as session, bearer, and TEID management.\n* Makes it easy to handle multiple connections with fixed IP and Port with UDP (or other `net.PacketConn`).\n* Currently works only on Linux and macOS since netlink support is introduced. However, the plan is to make it work on Windows in the future.\n\n## Getting Started\n\n### Prerequisites\n\ngo-gtp supports Go Modules. Run `go mod tidy` in your project's directory to collect the required packages automatically.\n\n```\ngo mod tidy\n```\n\n_This project follows [the Release Policy of Go](https://golang.org/doc/devel/release.html#policy)._\n\n### Running examples\n\n#### End-to-end\n\nWe have a set of tools called GW Tester at [`examples/gw-tester`](./examples/gw-tester). See the [document](./examples/gw-tester/README.md) for how it works and how to run it. It is also used for the integration test of this project. [Workflow setting](./.github/workflows/go.yml) may help you understand it as well.\n\n#### Individual node\n\n[The examples](examples/) work as it is by `go build` and executing commands in the following way.\n\n*Note for macOS users*: before running any go service, make sure to execute `./mac_local_host_enabler.sh` you will find at [examples/utils](examples/utils).\n\n1. Open four terminals on a machine and start capturing on the loopback interface.\n\n2. Start P-GW on terminal #1 and #2\n```shell-session\n// on terminal #1\n./pgw\n\n// on terminal #2\n./pgw -s5c 127.0.0.53 -s5u 127.0.0.5\n```\n\n3. Start S-GW on terminal #3\n\n```shell-session\n// on terminal #3\n./sgw\n```\n\n4. Start MME on terminal #4\n\n```shell-session\n// on terminal #4\n./mme\n```\n\n5. You will see the nodes exchanging Create Session and Modify Bearer on C-Plane, and ICMP Echo on U-Plane afterwards.\n\n_The \"mme\" is not an MME per se. In addition to S11 interface, it also mocks UEs and an eNB to establish sessions and send packets on U-Plane._\n\n## Developing with go-gtp\n\nThis section briefly describes how to develop your own GTP node with go-gtp.\nFor the detailed usage of a specific version, see README.md under each version's directory.\n\n| Version | Details                      |\n| ------- | ---------------------------- |\n| GTPv0   | [README.md](gtpv0/README.md) |\n| GTPv1   | [README.md](gtpv1/README.md) |\n| GTPv2   | [README.md](gtpv2/README.md) |\n\n### Establishing a connection between nodes\n\nEach version has `net.PacketConn`-like APIs and GTP-specific ones, which are often version-specific.\nThe basic idea behind the current implementation is;\n\n* `Dial` or `ListenAndServe` to create a connection (`Conn`) between nodes.\n* Register handlers to the `Conn` for specific messages with `AddHandler`, allowing users to handle the messages coming from the remote endpoint as flexible as possible, with less pain.\n* `CreateXXX` to create session or PDP context with arbitrary IEs given. Session/PDP context is structured, and they also have some helpers like `AddTEID` to handle known TEID properly.\n\n### Handling messages and IEs\n\n#### Messages\n\nAll the messages implement the same interface: `message.Message`, and have their own structs named `\u003cMessageName\u003e`, which can be created by `New\u003cMessageName\u003e` with given `ie.IE`s. `message.Message` can be sent on top of `Conn` with `SendMessageTo`, or can be serialized into `[]byte` with `Marshal`.\n\nTo parse the message from `[]byte`, use `message.Parse`. The parsed message will be one of the structs that implement `message.Message`, and you can type-assert it to the corresponding struct to access the fields which are a set of `ie.IE`s.\n\n#### IEs\n\nAll the IEs are of the same type: `ie.IE` (not an interface). An IE can be created either with `New\u003cIEName\u003e`, with `ie.New`, or with `ie.New\u003cTypeIE\u003e`. The latter two are useful when you want to create an IE with an unsupported type or our constructor does not work well for you.\n\nTo parse the IE from `[]byte`, use `ie.Parse` (note that `message.Parse` parses all the IEs on a message - you don't need to call `ie.Parse` when you're handling IEs on a message). The value of the parsed `ie.IE` can be retrieved with `\u003cIEName\u003e`, `ValueAs\u003cIEType\u003e`. Some of the complicated IEs have their own struct named `\u003cIEName\u003eFields` to get the values by accessing the fields.\n\nFor grouped IEs, accesing the `ChildIEs` field and iterating over the list of IEs contained is the most efficient way in most cases. Though there are the methods to get the specific IE value from the list (e.g., `BearerFlags` can be called upon `BearerContext` IE), they are not recommended since they always parse the whole list of IEs again.\n\n## Supported Features\n\nNote that \"supported\" means that the package provides helpers that make it easier to handle.\nIn other words, even if a message/IE is not marked as \"Yes\", you can make it work with some additional effort.\n\nYour contribution is welcome to implement helpers for all the types, of course!\n\n| Version           | Messages | IEs  | Networking (state machine)                  | Details                                                  |\n| ----------------- | -------- | ---- | ------------------------------------------- | -------------------------------------------------------- |\n| GTPv0             | ~35%     | ~80% | not implemented yet                         | [gtpv0/README](gtpv0/README.md#supported-features) |\n| GTPv1             | ~25%     | ~30% | v1-U: functional \u003cbr\u003e v1-C: not implemented | [gtpv1/README](gtpv1/README.md#supported-features) |\n| GTPv2             | ~40.0%   | ~45% | functional                                  | [gtpv2/README](gtpv2/README.md#supported-features) |\n| GTP' \u003cbr\u003e (Prime) | N/A      | N/A  | N/A                                         | _not planned_                                            |\n\n_You may also be interested in the sibling project [go-pfcp](https://github.com/wmnsk/go-pfcp) which is a PFCP implementation in Go._\n\n## Contributing\n\nWith the design goal of being flexible and easy to use, go-gtp is still in the early stage of development. Any contribution is welcome! Please feel free to open an issue or a pull request.\n\nPlease don't forget to run tests once you are done with your changes. Additionally, running the fuzz test is recommended to make sure that the implementation is robust enough.\n\n```shell-session\ngo test ./...\ngo test -fuzz .\n```\n\n*Note for macOS users*: the first time you run any test, make sure to execute `./mac_local_host_enabler.sh` you will find at [examples/utils](examples/utils). You will have to run the script again after each reboot.\n\n## Authors\n\n[Yoshiyuki Kurauchi](https://wmnsk.com/) and [contributors](https://github.com/wmnsk/go-gtp/graphs/contributors).\n\n## LICENSE\n\n[MIT](https://github.com/wmnsk/go-gtp/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwmnsk%2Fgo-gtp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwmnsk%2Fgo-gtp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwmnsk%2Fgo-gtp/lists"}