https://github.com/code-help-tutor/cmsc417-assignment-2-dv
CMSC417 辅导, code help, CS tutor, WeChat: cstutorcs Email: tutorcs@163.com
https://github.com/code-help-tutor/cmsc417-assignment-2-dv
cmsc417
Last synced: 7 months ago
JSON representation
CMSC417 辅导, code help, CS tutor, WeChat: cstutorcs Email: tutorcs@163.com
- Host: GitHub
- URL: https://github.com/code-help-tutor/cmsc417-assignment-2-dv
- Owner: code-help-tutor
- Created: 2024-03-22T14:18:09.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-22T14:18:17.000Z (almost 2 years ago)
- Last Synced: 2025-06-07T04:03:20.969Z (7 months ago)
- Topics: cmsc417
- Language: C
- Size: 229 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Assignment 2
## Distance Vector Routing on Virtual Network
See the assignment specification.
We **highly** recommend you read both the spec and README.md (this file) in full before you start!
We also **highly** recommend you to review the DV algorithm from the early lectures. It may help to hand-trace the algorithm on a small network.
You may reuse any code from assignments 0 and 1 as well.
## Piazza
Please tag any questions pertaining to this assignment with `as-2`.
---
## Project Structure
### A TA's attempt at explaining this 30-year old code
We have partially restructured the sample code so you can spend less time deciphering existing code.
All the parts you need to modify are marked with `TODO:`, with some hints.
`dv.c` is the file where you will implement your DV algorithm. You will have to modify most (if not all) of this file.
For the `ls.c`, you will only have to implement `create_link_sock()` function.
---
Below is some explanation for other files. You don't have to touch these:
The entrypoint is on `dr.c` - the `main()` function parses arguments, parses `config` file, initializes global routing table variables, and start executing events using the `walk_event_set_list()` function.
The `walk_event_set_list()` (in `dv.c`) does things on the "list of [event sets]". (i.e. this "list" is 2-d)
`rt.h` and `ls.h` contains definitions and helper functions for `routing table` data structure and `link` data structure, respectively.
You may have a compiler warning for `lex.ru.c`. It is safe to ignore this.
---
### FILES
```
dv.* :: your code goes here
ru.* :: parser and scanner
es.* :: event set
ls.* :: link set
rt.* :: routing table
n2h.* :: node-to-hostname
dr.c :: a testing driver, including main(), calls walk_event_set_list()
common.h :: common definitions
queue.h :: queue operation definition and macros
makefile :: type 'make' to generate executable "rt"
config :: a sample scenario file
```
# CMSC417 Assignment 2 DV
# WeChat: cstutorcs
# QQ: 749389476
# Email: tutorcs@163.com
# Computer Science Tutor
# Programming Code Help