diff options
author | sotech117 <michael_foiani@brown.edu> | 2023-10-23 22:31:26 +0000 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2023-10-23 22:31:26 +0000 |
commit | 1f926271bc80bcd6ff5ed52bb76a9ade347367b8 (patch) | |
tree | 30729c78765f6e1f9edba5fc6c1ef9cb94f25a6d /README.md | |
parent | 93416359403895d1dd1584c316d9e3dbfcc7a673 (diff) |
refactor and comment code. add more descriptive error message.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 35 |
1 files changed, 9 insertions, 26 deletions
@@ -5,17 +5,23 @@ This project is an implementation of IP pipelines in Go. The project is split in ## Vrouter and Vhost Design Vrouter and Vhost follow similar designs, with a check to ensure than an lnxconfig file is passed into, to initialize the node with the parsed information from the lnxfiles. For both nodes we register the test protocol handler, and the rip protocol handler specifically for routers. We then listen for command line interfaces, while threads were initialized in the initialization. We follow the specifications of the handout having the following functions and functionality: +``` li: List interfaces lr: List routes ln: List available neighbors up: Enable an interface down: Disable an interface send: Send test packet +q/exit: Quit program +``` + Because the vhost and vrouter are so similar, we maintain most of the logic within the IPStack in which the vrouter and vhost call when necessary. -## IPStack Design -We build our abstractions for the IP layer and interfaces with the following structs: +## Abstractions + + +Using these two struct below, we abstract for the IP layer and interfaces with the following structs: type Interface struct { @@ -37,30 +43,7 @@ type Neighbor struct { } -type RIPHeader struct { - - command uint16 - numEntries uint16 - -} - -type RIPEntry struct { - - prefix netip.Prefix - cost uint32 - -} - -type Hop struct { - - Cost uint32 - Type string - Interface *Interface - VIP netip.Addr - -} - -With these structs, we are able to maintain the information necessary for the IPStack to function and for the vhost and vrouter to interact with its interfaces, neighbors, and routes when applicable. +With these structs, # Initialization/Main Thread |