includeos / IncludeOS

A minimal, resource efficient unikernel for cloud services

Home Page:https://www.includeos.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test for the example router project

ggbbr opened this issue · comments

commented

Readme for router project is empty. The router project creates a new router and arranges a routing table for it. But how should I test the function of the router? The running results are as bellow:
image
What should I do?

You need to configure a network with routes to and from your VM, which is a Qemu guest.
https://wiki.qemu.org/index.php/Documentation/Networking

I think you can do all the routing using regular linux commandline.

commented

Thanks so much for your replying. But i am little confused, do you mind being more specific? I still dont have a clue to test the router project.

commented

I boot the /test/net/integration/router project for testing router, but it also just creates and prepares a router. How can I test the router? The results for running router are as bellow
image

Well, routing is moving packets from one network device to another (or one vlan to another), essentially. So you need at least 2 network interfaces, and then you need to use a linux terminal to create routes for the interfaces. I honestly don't recommend using Qemu for routing anything. It uses tap devices which are crazy hard to work with for no particular reason. Just linux things. I would use something like VMware workstation which sets up interfaces for you, and you can configure the networks in a GUI.

The router object from the log you pasted is an abstraction for a routing table, so it contains routes. It says that packets destined to this address range goes to -> that interface (which has that gateway IP).

As for the router test, I didnt write it, so I dont really know what its supposed to do. But maybe it uses network namespaces to separate the networks properly, so that linux doesnt short-circuit the packets?

commented

Thank you for your help. I took your advice, I created a Unikernel Web Serveice to answer the request from Linux via my router, and it works. Thank you again.