.. index:: pair: group; Sending and receiving data .. _doxid-group__basic-send__receive: Sending and receiving data ========================== .. toctree:: :hidden: Check that packets can be sent and received over the tested interface. Scenarios: X3-SYS01, X3-SYS02. #. Establish connection between a pair of sockets of type **sock_type** on IUT and Tester. #. If **tx** is ``TRUE``, sender is IUT and receiver is Tester, otherwise - the other way around. #. If ``TCP`` is checked, enable ``TCP_NODELAY`` on sender socket to ensure that a packet is sent as soon as possible, even when it is small. #. In a loop, send **pkts_num** packets with sizes chosen according to **pkt_size**. Receive and check them on peer. #. Check that interface statistics were updated expectedly, there were no errors or discarded packets. Dmitry Izbitsky `Dmitry.Izbitsky@oktetlabs.ru `__ .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - env - Testing environment: * :ref:`env.peer2peer ` * :ref:`env.peer2peer_ipv6 ` * - sock_type - Socket type: * ``SOCK_STREAM`` * ``SOCK_DGRAM`` * - tx - If ``TRUE``, check sending from IUT, otherwise check receiving on IUT. * - pkt_size - Packet size: * ``1000`` * ``-1`` (random) * - pkts_num - Number of packets to send or receive: * ``100``