-
Notifications
You must be signed in to change notification settings - Fork 0
Simple bridge
License
natdempk/3700bridge
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
3700bridge CS3700 - Project 2 Nathaniel Dempkowski and Sean Andrews, Team project2 High-level Approach =================== Initially, connections are setup for each LAN the bridge is connected to, deduplicating LANs that are connected multiple times. Different goroutines manage different parts of the program. Goroutines are basically lightweight threads. * One goroutine simple broadcasts our bpdu every 500ms. * Each LAN which is connected to the bridge has a goroutine that listens for messages and either handles the message or adds the BPDU to the BPDU channel. * Another routine which reads from the BPDU channel. That channel adds the BPDU onto a table containg BPDU's and when we recieved them. Then, entries older than the timeout window are removed, then the BPDU message that the bridge will broadcast is re calculated. This means we have a full list of active BPDUs each time we send out our BPDU, making the calculations for enabled connection, root port, and designated ports simpler than constant mutation. These routines work together nicely so that we can separate concerns within our program and decompose it into functions that are easily understood. Challenges Faced ================ The largest challenge in this project was making the BPDU decision algorithm straightforward to reason about it and confirming it was correct for all the various cases. For the milestone, our code did a comparison between BPDUs as we received them, only ever comparing one BPDU to another. This sounded good, as it matched what was presented in the slides in class, but we found it hard to reason about the actions that should be taken as a result of a BPDU. Trying to maintain all of the state around the LANs with this approach was too difficult to understand, and introduced a lot of issues around when certain actions should be performed. Instead, the code now to maintains a table, as described in our high-level approach. This simplified our BPDU decision logic, LAN port enabling logic, and moved all of it logic into a straightforward testable method. Besides the BPDU logic challenges, the main other challenge was learning to use more features of Go. We had to learn to organize the code to make it more understandable and utilizing more complex features of the language like goroutines and channels. Testing ======= Testing mostly utilized the test scripts and manual debugging of problems to verify that the code was behaving as expected. We mapped out a bunch of the network layouts on paper and compared their BPDU spanning tress to what our bridges were computing. Most of the debugging was done using simple print statements, as none of our code or problem cases were so complex that we had no idea what to look at. We also wrote a couple of basic tests to verify problem functionality we identified in the BPDU decision logic so that we could fix it and test our fixes more easily.
About
Simple bridge
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published