Saturday, April 14, 2012

Modifying the Lookup Method of the Routing Table and More!

Recently, Matthew and I found out (with the help of Professor Pak) that Altera's built-in programmable promiscuous mode had to be enabled in order for our ARP forwarding to work for interfaces that are linked to the same sub-network.  In networking, promiscuous mode basically means that any packets that go through a certain interface/port will be read through and will not be omitted. In other words, this will help us because once this is enabled, our Altera board will not be able to omit and drop packets with MAC destination addresses that are not destined for the same interface/port.  To enable this mode, I basically looked up where promiscuous mode is set in the C library headers and found that there is a option ('ENABLE_PHY_LOOPBACK') defined to enable two masks ('ALTERA_TSEMAC_CMD_PROMIS_EN_MSK' and 'ALTERA_TSEMAC_CMD_LOOPBACK_MSK'), which overall enables the programmable promiscuous mode.  I haven't been able to test out to see if this mode works since Matthew still needs to revise his application code for ARP forwarding, but conceptually it seems like it should fix most of our problems we're facing at the moment.

Unfortunately, we encountered another problem pertaining to performance of the router board.  When using the evaluation version of PassMark, a benchmark testing software that allows us to test the speed of our router, we were getting very low numbers (average was around 1000kbps, which is far below our expectations for our project.)  Matthew and I figured that the problem might have to do with the initialization of the MAC and the drivers before Simple Socket Server ran.  In particular, I noticed that the initialization routine (tse_mac_init) for the Triple-Speed Ethernet MACs contained a variable 'speed', which may determine how fast the interfaces can be.  For now, I set the variable to be fixed as 1000Mbps for all the interfaces (this routine is called once for each interface), but I have not tested it yet.  This way, I would think that all the interfaces will be able to handle speeds of up to 1000 Mbps.

At this moment, I am currently looking up rt_lookup and finding a way to modify the subnet masking algorithm inside it (which tries to match routing table entries with the packet it's trying to forward/route) such that it can work not only on different sub-networks as we tested before, but all through one same sub-network for all the interfaces.  As Matthew explained on his previous post, the forwarding of packets from one interface to another does not work when all the interfaces are on the same subnet.  Right now, it should only use the interface with the best matching IP address based on the masking, which would be the very first interface. I will give further updates about the lookup method over the weekend.

No comments:

Post a Comment