Thursday, April 12, 2012

Putting everything on one network on DE4

Our next task is to put all the ports on one network. We had initially tried this before but decided to test out how the packets were routed first but we ran into problems. We are encountering the same problems but now understand what is happening a bit deeper now.

The first problem has to deal with ARP forwarding. There is really just one big problem here and it is that ARP forwarding doesn't seem like a reality for this project. That's not to say I'm giving up, but the basic ARP forwarding does not seem possible because the interface does not recognize a packet that is not destined for it. To test this, I forwarded the ARP request that would be sent from one client to another. To do this, a few values had to be changed (most importantly the interface to send out of had to be changed). When the other client replied with an ARP reply, it would try to send it to the destination of the original client. Because of this, the packet is never received by the DE4 board (which I find to be strange). To test this out, I made the code print out something every time the SGDMA receive callback function is called. It would never print out that it acquired any sort of ARP reply. Another test I did was to change the original ARP request packet to have the source destination MAC address as other things and no packet would be seen by the DE4 board unless it was destined for the right MAC address (or it was broadcast). I tried to compare using my own D-Link router but the router is able to see packets not destined for the right MAC address. So instead of ARP forwarding, I am going to try to go with setting up something like an ARP proxy. So instead of forwarding ARP requests, I will just use the ARP table for the DE4 board. If an ARP request comes in for an IP that is already in the ARP table, the DE4 board will reply with it's own MAC address and handle the packets as they come in. Otherwise, the DE4 board will broadcast a request and try to build an updated ARP table.

The second problem has to deal with the behavior of rt_lookup() (route lookup) when used with interfaces that are all on the same network. As David has pointed out before, most packets that come in will cause the board to call rt_lookup() before it routes the packet through. Unfortunately, when all the interfaces are all on the same network, rt_lookup() will just return the first interface it is looking at. An example would be that if a client is pinging the board's eth2, all the ping replies will still be sent out eth0. At the moment, David is looking into this while I work on the ARP proxy.

1 comment:

  1. Be sure to enable promiscuous mode in the Altera Ethernet MAC - it's an absolute necessity in your type of an application.

    ReplyDelete