Skip to content

How to start network implementation #158

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

Open
Paul-Stern opened this issue Apr 8, 2025 · 3 comments
Open

How to start network implementation #158

Paul-Stern opened this issue Apr 8, 2025 · 3 comments

Comments

@Paul-Stern
Copy link

Paul-Stern commented Apr 8, 2025

Hello everyone! So, I just would like to ask some questions on the topic.

  1. Are there any ideas on how to start implementing networking features?
  2. What should be implemented first?
  3. What should the basic implementation consist of?
  4. What existing software might be used as a reference for the implementation?
  5. Any other considerations?

I appreciate any feedback provided, I would be glad to read your ideas.

@JalonSolov
Copy link
Contributor

Are you talking about writing an ethernet driver to add networking to vinix?

If so, you should try to find a "least common denominator" chipset... likely something from Intel, which a lot of other chips support as well. Most emulators (QEMU, etc.) also support the basic Intel chips.

Once you've decided on which chipset to write the driver for, a simple Google search will likely lead you to more documentation, sample drivers, etc. than you really want to try to figure out. :-)

Last, you'll need to decide if you're doing a kernel driver, or a user space driver. Some differences in architecture, so they are different sets of code.

@mintsuki
Copy link
Collaborator

mintsuki commented Apr 8, 2025

Hi @Paul-Stern

So, generally speaking, here goes:

  1. There are of course ideas on how to do things, but it would be better to have the person implementing certain things to ultimately make certain design decisions. And of course familiarity with the rest of the Vinix codebase is somewhat required.
  2. I don't think there needs to be a set order in terms of implementing things.
  3. I guess a basic implementation would consist of some NIC driver to send and receive raw packets (e1000e is a very common one, and the one that I recommend you implement), ARP address resolution and caching of resolved addresses, IPv4, routing tables and routing sockets, and TCP and UDP sockets.
  4. Other OS kernel code can help, sure.
  5. Not that I can come up with right now.

Good luck!

@Paul-Stern
Copy link
Author

Thank you for your valuable answers. One more thing that came to me. What are some basic testing scenarios both for the networking stack as a whole and its individual parts? I guess curl might be used for some of them. What about ip programme (used as ip route, ip address, etc.)? Might it be useful for testing too if it was possible to run in vinix? As usual, any feedback is welcome.

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

No branches or pull requests

3 participants