Pc As Router Project for Beginners in Java is a simple project which is developed to manage routing works using a software that is installed in PC.
Configure PC As Router Project Modules Explanation:
This module contains User Interface so that administrator can easily interact with the system. Administrator has a central control over the network, he will be able to Login, monitor, access, analysis, can add new PC Router, see Routing table.
This module consists of receiving of packets that are continuously being received at the network interface. This module captures the packet that are coming from 3 different network interface links, And packets get stored in respective input buffer, as each link has its own buffer. This module also warns the administrator if the buffer is full or empty. As there are 3 network interface links, threading is used to receive packets from all three link simultaneously.
Receive pointer (rptr) is used as a counter to determine the count of packet received.
- The packet is received using the getPacket() function.
- The packet is then checked for a null packet.
- If the packet is not null, the packet is copied in the input buffer(array of packets).
- The rptr(pointer for receive packets) is incremented.
This module takes out the packet from receiver buffer and decapsulate it to determine the type of packet whether it is IPV4 packet or IPV6. It also determines the source address and destination address of packet, along with this it also comes to know about length of packet, lifetime of packet, no of hop packet has crossed. The network address, subnet mask and port no of all the links are stored in XML file. After knowing all this information, process packet module takes the destination address of packet and logically AND it with the subnet mask of all the link one by one. The result of ANDing is compared with the net address of the all the 3 link. If it matches with any of the link, then port number of that link is known and that packet is copied to the respective output buffer. Process pointer (pptr) is used as counter to determine the count of processed packet. Threading is used to simultaneously process packets from all the 3 links to increase the speed of routing of packets.
- The packet is taken from the input buffer and the pptr(pointer for processed packets) is incremented.
- The type of packet is found out.
- If it is an ARP packet, it is broadcasted and copied in the output buffers of all the links.
- If not, the destination address of the packet is taken.
- AND operation is performed on the destination address and the subnet mask of each entry in the routing table.
- The result is then compared with the HostID in the routing table.
- If found, the packet is copied to the output buffer of that link.
In this module, we access the output buffer in which processed packets are stored.
With the help of sent pointer (sptr) we send packets directly on respective link and packets gets routed to its destination machine. In this module we have also used threading to increase the performance and efficiency of routing of packets, so that packet sending is done simultaneously for all the links.
- The packets are taken from the output buffers and sent on the respective links.
- The sptr(pointer for packets sent) is incremented.