Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: netsim #66

Merged
merged 4 commits into from
Sep 18, 2024
Merged

refactor: netsim #66

merged 4 commits into from
Sep 18, 2024

Conversation

Arqu
Copy link
Collaborator

@Arqu Arqu commented Sep 13, 2024

More or less a complete redo of netsim.

  • Maintains all backwards compatibility so far
  • Cleaned up repo
  • Cleaned up the code so it's manageable and other people can actually work on it too
  • Added multicast support
  • Added support for parallel execution on jobs where we don't strictly measure perf. Job time drops 2-4x in my experience so far.
  • Fixed up old / disabled code (visualizations & sniffing)
  • Much more extensible now

@Arqu Arqu self-assigned this Sep 13, 2024
@Arqu Arqu requested a review from flub September 13, 2024 12:25
@Arqu
Copy link
Collaborator Author

Arqu commented Sep 13, 2024

@flub tagged you in for a quick look around if you like, given you're our resident python expert and shown some interest in this bit.
Also suggestions welcome.

This part 1 of 3.

Copy link

@flub flub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only given this a rather superficial review, not tried to understand the design and how things interact. Let me know if you'd like a more thorough review around the architecture - but that's a bunch more work :)

.gitignore Outdated Show resolved Hide resolved
netsim/README.md Outdated Show resolved Hide resolved
netsim/scripts/python_deps.sh Outdated Show resolved Hide resolved
netsim/scripts/ubuntu_deps.sh Outdated Show resolved Hide resolved
netsim/main.py Outdated Show resolved Hide resolved
"A Node with multicast stuff."
class EdgeNode( Node ):
def config( self, **params ):
super( EdgeNode, self).config( **params )
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still need this super syntax? I think this is python 2.7's super syntax. For 3.x you should use super().config(**params) IIRC.

(also, what's with all the spacing around the bracket in this file? not very consistent)

self.cmd( 'smcroutectl -I smcroute-' + self.name +
' join ' + intfName + ' 239.0.0.1' )

def terminate( self ):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider making this class a context manager

netsim/parsing/netsim.py Outdated Show resolved Hide resolved
netsim/sniffer/process.py Show resolved Hide resolved
netsim/sniffer/process.py Outdated Show resolved Hide resolved
flub
flub previously approved these changes Sep 16, 2024
Copy link

@flub flub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I don't mean to hold anything up so consider this approved whenever you want to :)

@Arqu
Copy link
Collaborator Author

Arqu commented Sep 16, 2024

Also, I don't mean to hold anything up so consider this approved whenever you want to :)

Thank you. I mostly tagged you in to have someone else from the team be aware of it's existence (but I also knew you would give some input :) ) It's more/better than expected.

A lot of the code base was cobbled together from different pieces and copy paste didn't do me a great service to keep things aligned. Starting with a formatter is a great 1st step.

@Arqu Arqu merged commit 4961c40 into main Sep 18, 2024
1 check passed
@Arqu Arqu deleted the arqu/netsim_revamp branch September 18, 2024 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants