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

Add gateway support #136

Closed
wants to merge 4 commits into from
Closed

Conversation

rowanG077
Copy link
Contributor

This is a simple method to add a static gateway + netmask.

TODO: Test in hardware if you can actually go over the internet with this.

I also added UDPRawCore in the generator.

@rowanG077 rowanG077 force-pushed the master branch 4 times, most recently from f7de4c0 to 923dc39 Compare July 6, 2023 15:28
Also added UDPRawCore
@rowanG077
Copy link
Contributor Author

I think the logic now is correct. I will test out whether it works in Hardware soon.


self.sync += masked_ip.eq(sink.ip_address & netmask)
self.sync += in_subnet.eq(masked_ip == netaddress)
self.sync += If(in_subnet,
Copy link
Contributor Author

@rowanG077 rowanG077 Jul 7, 2023

Choose a reason for hiding this comment

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

@enjoy-digital Now having slept on it, I'm not actually sure this will work correctly. Essentially the IP address now needs to be stable for 3 clock cycles before the SEND_MAC_ADDRESS_REQUEST is reached. I don't know enough about packetizers and entire stack whether this is true. We have a single cycle for sure so I could shrink the pipeline.

@enjoy-digital
Copy link
Owner

@rowanG077 Thanks for the PR, I'll look at it. It's however integrating 3 different changes. Would you mind creating a PR per specific changes? This will ease review and merging progressively the different features.

For the UDP Raw mode, it would probably be better to add a mode parameter to the defined UDP ports, where mode could be stream or raw and then implement the right logic in the generator. This would even be more flexible since some ports could use be in stream while others in raw mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants