Monday, April 30, 2012

One interior network, one exterior network

While David is working on trying to speed up the router, I have been working on getting two networks up successfully. We have both ran into a few problems but I will explain my part.
I have successfully gotten two networks to work while also changing my code a bit. The first thing I did was make iproute() return the right interface. Because of this, I got rid of setting the pkt->NET in send_via_arp() that I had done last week. Next I changed one interface's IP to a separate network. With this, the two networks could communicate with each other easily but I quickly ran into a problem when an ARP entry is not in the ARP table. If this happens, it will return the wrong interface and the packet will never be sent (and the route will be added wrongly). I haven't had a chance to try my fix out yet but at the moment it is just checking if there is a valid ARP entry. If not, it will broadcast an ARP request. Otherwise, if it is an IP address that is not in our interior network, it will automatically change the NET interface of the packet to the interface that is connected to the exterior network. I am still trying to make a more elegant fix. This problem only occurs when a Linux machine on the interior network is trying to be accessed through the network with no prior communication from the Linux client. It will not occur if two Windows machines are connected because when Windows sees a network connection, it immediately sends out ARP requests to it's gateway.
Once this is fixed (which it should by the end of tomorrow), I will work on two things: setting up the exterior network interface to act as a DHCP client and setting up some type of address translation for routing.

No comments:

Post a Comment