Adding SRIP into QualNet ======================== Note: All directories referred in these instructions are relative to $QUALNET_HOME. 1. Copy srip.h and srip.c into network/ directory cp srip.c srip.h $QUALNET_HOME/network 2. Modify the file include/network.h to let QualNet know about the new network layer protocol by adding: ROUTING_PROTOCOL_SRIP, before the line that says '//InsertPatch ROUTING_PROTOCOL_TYPE' located inside NetworkRoutingProtocolType enum. 3. Modify the file network/ip.h to let IP layer know about the new IP protocol by adding: #define IPPROTO_SRIP 234 before the line '//InsertPatch ROUTING_IPPROTO' 4. Hook all the SRIP functions into QualNet at the IP layer by modifying the file network/ip.c as follows: - Before the line '//InsertPatch HEADER_FILE,' add: #include "srip.h" - Before the line '//InsertPatch NETWORK_INIT_CODE' located inside the function NetworkIpInit(), add: else if (strcmp(protocolString, "SRIP") == 0) { NetworkIpAddUnicastRoutingProtocolType( node, ROUTING_PROTOCOL_SRIP, i); if (!NetworkIpGetRoutingProtocol(node, ROUTING_PROTOCOL_SRIP)) { SripInit( node, (SripData **) &ip->interfaceInfo[i]->routingProtocol, nodeInput, i); } else { NetworkIpUpdateUnicastRoutingProtocolAndRouterFunction( node, ROUTING_PROTOCOL_SRIP, i); } } - Before the line '//InsertPatch NETWORK_IP_LAYER' located inside the function NetworkIpLayer(), add: case ROUTING_PROTOCOL_SRIP: { SripHandleProtocolEvent(node, msg); break; } - Before the line '//InsertPatch FINALIZE_FUNCTION' located inside the function NetworkIpFinalize(), add: case ROUTING_PROTOCOL_SRIP: { SripFinalize(node); break; } - Before the line '//InsertPatch NETWORK_HANDLE_PACKET' located inside the function DeliverPacket(), add: case IPPROTO_SRIP: { SripHandleProtocolPacket( node, msg, sourceAddress); break; } 5. Tell QualNet to incorporate SRIP code into the simulation by editing main/Makefile-common - Before the line "#InsertPatch HEADER_FILES," add: ../network/srip.h \ also put a backslash (\) at the end of the line before the insertion point if it is not already there. - Before the line "#InsertPatch SOURCE_FILES," add: ../network/srip.c \ also put a backslash (\) at the end of the line before the insertion point if it is not already there. 6. Rebuild the .h dependencies by running 'make depend' from main/: cd $QUALNET_HOME/main make depend 7. Rebuild QualNet executable: make 8. Create a new main configuration file for SRIP by copying default.config into srip.config, and modify the following two parameters: EXPERIMENT-NAME srip ROUTING-PROTOCOL SRIP Also add one more parameter for SRIP itself SRIP-UPDATE-INTERVAL 5S 9. Test the protocol on the configuration file: cd ../bin ./qualnet srip.config