{"id":22248300,"url":"https://github.com/xiaowhang/distance-vector","last_synced_at":"2025-03-25T11:43:18.732Z","repository":{"id":263823059,"uuid":"891405608","full_name":"xiaowhang/Distance-vector","owner":"xiaowhang","description":"使用 C++ 实现一个基于进程间通信的路由器网络模拟系统","archived":false,"fork":false,"pushed_at":"2025-01-02T08:50:51.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T10:43:08.800Z","etag":null,"topics":["cpp","cpp17"],"latest_commit_sha":null,"homepage":"","language":"C++","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/xiaowhang.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":"2024-11-20T09:24:36.000Z","updated_at":"2025-01-02T08:50:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"db76c764-227d-438b-a419-f263723419ba","html_url":"https://github.com/xiaowhang/Distance-vector","commit_stats":null,"previous_names":["xiaowhang/distance-vector"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaowhang%2FDistance-vector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaowhang%2FDistance-vector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaowhang%2FDistance-vector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaowhang%2FDistance-vector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiaowhang","download_url":"https://codeload.github.com/xiaowhang/Distance-vector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245458122,"owners_count":20618693,"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","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":["cpp","cpp17"],"created_at":"2024-12-03T06:14:58.150Z","updated_at":"2025-03-25T11:43:18.683Z","avatar_url":"https://github.com/xiaowhang.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 距离矢量路由协议仿真程序\n\n本项目实现了一个基于进程间通信的路由器模拟系统，使用 C++ 编写。\n\n主程序读入网络拓扑描述文件，然后生成几个子进程。\n\n每个子进程仿真一个路由器，通过使用 System V 消息队列，多个路由器进程之间能够交换路由信息并维护各自的路由表。\n\n\n\n## 编译运行环境：\n\n- 内核：Linux 6.11.9-arch1-1\n- 体系结构：x86-64\n- 处理器：CPU: 12th Gen Intel(R) Core(TM) i7-12700H (20) @ 4.70 GHz\n- 编译器：g++ (GCC) 14.2.1 20240910\n- 构建工具：GNU Make 4.4.1\n\n\n\n## 运行\n\n命令行执行：\n```shell\nmake\n```\n\n然后运行：\n\n```shell\n./main test6.txt\n```\n\n\n\n## 运行结果\n\n```shell\n$ cat routing_table/0.txt\n\n路由器 0 的当前路由表：\n\n目的ID:   \t0\t总花费: \t0\t下一跳: \t0\n目的ID:   \t1\t总花费: \t1\t下一跳: \t1\n目的ID:   \t2\t总花费: \t2\t下一跳: \t1\n目的ID:   \t3\t总花费: \t3\t下一跳: \t1\n目的ID:   \t4\t总花费: \t3\t下一跳: \t1\n目的ID:   \t5\t总花费: \t4\t下一跳: \t1\n\n```\n\n```shell\n$ cat routing_table/2.txt\n\n路由器 2 的当前路由表：\n\n目的ID:   \t0\t总花费: \t2\t下一跳: \t1\n目的ID:   \t1\t总花费: \t1\t下一跳: \t1\n目的ID:   \t2\t总花费: \t0\t下一跳: \t2\n目的ID:   \t3\t总花费: \t1\t下一跳: \t3\n目的ID:   \t4\t总花费: \t1\t下一跳: \t4\n目的ID:   \t5\t总花费: \t2\t下一跳: \t4\n\n```\n\n\n\n## 自定义测试数据\n\n网络连接描述文件的格式为：\n\n- 每一行描述一个网络中的点对点链路，由三个空格分开的整数组成： $X$ 、 $Y$ 和 $C$ 。 $X$ 和 $Y$ 是 $int$ 范围内的节点编号， $C$ 是一个代表 $X$ 和 $Y$ 之间链路开销的正整数\n\n\n\n## Todo\n\n- [x] 实现“毒性逆转” (Poison Reverse)\n- [x] 实现“触发更新” (Triggered Updates)\n- [ ] 实现扩展的贝尔曼-福特算法（“源跟踪”功能）","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaowhang%2Fdistance-vector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaowhang%2Fdistance-vector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaowhang%2Fdistance-vector/lists"}