public void receiveARPPacket(ARP_packet inARPpacket) throws LowLinkException{

		// test if this packet is for a local Address.
                //mParentStack.isInternalIP(inARPpacket.getDestIPAddress())
            
		if(mParentStack.isInternalIP(inARPpacket.getDestIPAddress())){

			// test the type of ARP packet			

			if(inARPpacket.getMessageCode()==1){

				//If its an ARP Request add the entry to the arp table

				//		and send response

				try{			

					addToArpTable(inARPpacket.getSourceIPAddress(),inARPpacket.getSourceMAC(),"Dynamic");

					ARP_packet ArpResponse = new ARP_packet(inARPpacket.getSourceIPAddress());

					ArpResponse.setMessageCode(ARP_packet.ARP_REPLY);
					
					ArpResponse.setSourceIPAddress(inARPpacket.getDestIPAddress());

					String outInterface = mParentStack.getRouteInfo(inARPpacket.getSourceIPAddress());

					String srcMAC = mParentStack.getMACAddress(outInterface);			

					ArpResponse.setSourceMAC(srcMAC);

					//Create Layer info 

					LayerInfo arpInfo = new LayerInfo(getClass().getName());

					arpInfo.setObjectName(mParentStack.getParentNodeName());

					arpInfo.setDataType("ARP Response Packet");

					arpInfo.setLayer("DataLink");

					arpInfo.setDescription("Created ARP Response packet to "+inARPpacket.getSourceIPAddress() );

					Simulation.addLayerInfo(arpInfo);				

					//Send packet

					mParentStack.sendPacket(ArpResponse);					

				}catch(CommunicationException e){

					// no need to throw this. method will return null

				}catch(LowLinkException e){

					// no need to throw this. method will return null

                                        throw e;

				}			

			}else{

				//if its an ARP response Add the entry to the ARP table.

				addToArpTable(inARPpacket.getSourceIPAddress(),inARPpacket.getSourceMAC(),"Dynamic");	

			}

		}

	}