How can I interface my own custom-built application with the UDP model?

Categories: Riverbed Modeler
Solution Number: S20821


How can I interface my own custom-built application with the UDP model?


In order to add a custom application layer over UDP, you need to meet certain requirements for interfacing with UDP. You can look at the rip_v3 process model to see how a higher layer is supposed to interface with UDP. Given below are the steps involved.- The application needs to know the packet streams to and from UDP. If the application module is connected only to UDP then both these will be zero. Even otherwise, you can manually configure the stream indices in the node model and hard-code the values inside the process model.- In order to be able to receive packets over UDP, the application must create a UDP port over which it will receive packets or listen for requests. This is done by sending a forced interrupt to UDP with the appropriate command in the ICI. The rip_v3 process does this in the function rip_create_udp_rcv_port(). You can use this as a reference. The port number used must not clash with port numbers used by other applications running over UDP. The ICI created for this interrupt can be stored in a state variable and used for subsequent communication with UDP.- In order to send a packet to UDP, the local and remote address and port numbers must be filled in the ICI. The local address can be set to an invalid address. IP will then use the address of the outgoing interface. Other ICI fields are optional. The packet must be sent using a forced interrupt. If you do not know the receiver's IP address, you need to do a lookup based on the node objid of the receiving node (ip_support_address_from_node_id_get() ). The node objid can be obtained from the name of the node (ip_support_node_id_from_name_get() ). Both these functions are declared in ip_support.h. You can look at code in the function rip_send() in the rip_v3 process model to see how packets are sent to UDP.- Receiving packets from UDP is very straightforward. See the function rip_receive() in the rip_v3 process model for an example.- If you want to use InetT_Address instead of IpT_Address (in order to support IPv6 now or in the future), then you need to use a different ICI. Use the process model rip_ng as a reference. You can send any packet using UDP. The packets can have a specific format or they can be unformatted.


DES Kernel->Process Modeling/Coding

NOTICE: Riverbed® product names have changed. Please refer to the Product List for a complete list of product names.
Last Modified: 2013-08-20
Can't find an answer? Create a case