NS3中的PacketSink类
在官方文档中,给出了这样的定义:
/**
* \ingroup packetsink
*
* \brief Receive and consume traffic generated to an IP address and port
*
* This application was written to complement OnOffApplication, but it
* is more general so a PacketSink name was selected. Functionally it is
* important to use in multicast situations, so that reception of the layer-2
* multicast frames of interest are enabled, but it is also useful for
* unicast as an example of how you can write something simple to receive
* packets at the application layer. Also, if an IP stack generates
* ICMP Port Unreachable errors, receiving applications will be needed.
*
* The constructor specifies the Address (IP address and port) and the
* transport protocol to use. A virtual Receive () method is installed
* as a callback on the receiving socket. By default, when logging is
* enabled, it prints out the size of packets and their address.
* A tracing source to Receive() is also available.
*/
简单来说即为:
这个类继承于
Application
类,是一个应用层协议。它的作用是接收和消耗被一个IP
地址和一个端口号产生的包。