A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
udp-client-server-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008 INRIA
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
7
*/
8
9
#ifndef UDP_CLIENT_SERVER_HELPER_H
10
#define UDP_CLIENT_SERVER_HELPER_H
11
12
#include <ns3/application-helper.h>
13
#include <ns3/udp-client.h>
14
#include <ns3/udp-server.h>
15
#include <ns3/udp-trace-client.h>
16
17
#include <stdint.h>
18
19
namespace
ns3
20
{
21
/**
22
* @ingroup udpclientserver
23
* @brief Create a server application which waits for input UDP packets
24
* and uses the information carried into their payload to compute
25
* delay and to determine if some packets are lost.
26
*/
27
class
UdpServerHelper
:
public
ApplicationHelper
28
{
29
public
:
30
/**
31
* Create UdpServerHelper which will make life easier for people trying
32
* to set up simulations with udp-client-server application.
33
*
34
*/
35
UdpServerHelper
();
36
37
/**
38
* Create UdpServerHelper which will make life easier for people trying
39
* to set up simulations with udp-client-server application.
40
*
41
* @param port The port the server will wait on for incoming packets
42
*/
43
UdpServerHelper
(uint16_t
port
);
44
45
/**
46
* Create UdpServerHelper which will make life easier for people trying
47
* to set up simulations with udp-client-server application.
48
*
49
* @param address The address the server will bind to
50
*/
51
UdpServerHelper
(
const
Address
& address);
52
};
53
54
/**
55
* @ingroup udpclientserver
56
* @brief Create a client application which sends UDP packets carrying
57
* a 32bit sequence number and a 64 bit time stamp.
58
*
59
*/
60
class
UdpClientHelper
:
public
ApplicationHelper
61
{
62
public
:
63
/**
64
* Create UdpClientHelper which will make life easier for people trying
65
* to set up simulations with udp-client-server.
66
*
67
*/
68
UdpClientHelper
();
69
70
/**
71
* Create UdpClientHelper which will make life easier for people trying
72
* to set up simulations with udp-client-server. Use this variant with
73
* addresses that do not include a port value (e.g., Ipv4Address and
74
* Ipv6Address).
75
*
76
* @param ip The IP address of the remote UDP server
77
* @param port The port number of the remote UDP server
78
*/
79
80
UdpClientHelper
(
const
Address
& ip, uint16_t
port
);
81
/**
82
* Create UdpClientHelper which will make life easier for people trying
83
* to set up simulations with udp-client-server. Use this variant with
84
* addresses that do include a port value (e.g., InetSocketAddress and
85
* Inet6SocketAddress).
86
*
87
* @param addr The address of the remote UDP server
88
*/
89
90
UdpClientHelper
(
const
Address
& addr);
91
};
92
93
/**
94
* @ingroup udpclientserver
95
* Create UdpTraceClient application which sends UDP packets based on a trace
96
* file of an MPEG4 stream. Trace files could be downloaded form :
97
* https://web.archive.org/web/20190907061916/http://www2.tkn.tu-berlin.de/research/trace/ltvt.html
98
* (the 2 first lines of the file should be removed)
99
* A valid trace file is a file with 4 columns:
100
* \li -1- the first one represents the frame index
101
* \li -2- the second one indicates the type of the frame: I, P or B
102
* \li -3- the third one indicates the time on which the frame was generated by the encoder
103
* \li -4- the fourth one indicates the frame size in byte
104
*/
105
class
UdpTraceClientHelper
:
public
ApplicationHelper
106
{
107
public
:
108
/**
109
* Create UdpTraceClientHelper which will make life easier for people trying
110
* to set up simulations with udp-client-server.
111
*
112
*/
113
UdpTraceClientHelper
();
114
115
/**
116
* Create UdpTraceClientHelper which will make life easier for people trying
117
* to set up simulations with udp-client-server. Use this variant with
118
* addresses that do not include a port value (e.g., Ipv4Address and
119
* Ipv6Address).
120
*
121
* @param ip The IP address of the remote UDP server
122
* @param port The port number of the remote UDP server
123
* @param filename the file from which packet traces will be loaded
124
*/
125
UdpTraceClientHelper
(
const
Address
& ip, uint16_t
port
,
const
std::string& filename =
""
);
126
127
/**
128
* Create UdpTraceClientHelper which will make life easier for people trying
129
* to set up simulations with udp-client-server. Use this variant with
130
* addresses that do include a port value (e.g., InetSocketAddress and
131
* Inet6SocketAddress).
132
*
133
* @param addr The address of the remote UDP server
134
* @param filename the file from which packet traces will be loaded
135
*/
136
UdpTraceClientHelper
(
const
Address
& addr,
const
std::string& filename =
""
);
137
};
138
139
}
// namespace ns3
140
141
#endif
/* UDP_CLIENT_SERVER_H */
ns3::Address
a polymophic address class
Definition
address.h:90
ns3::ApplicationHelper
A helper to make it easier to instantiate an application on a set of nodes.
Definition
application-helper.h:28
ns3::UdpClientHelper
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
Definition
udp-client-server-helper.h:61
ns3::UdpClientHelper::UdpClientHelper
UdpClientHelper()
Create UdpClientHelper which will make life easier for people trying to set up simulations with udp-c...
Definition
udp-client-server-helper.cc:35
ns3::UdpServerHelper
Create a server application which waits for input UDP packets and uses the information carried into t...
Definition
udp-client-server-helper.h:28
ns3::UdpServerHelper::UdpServerHelper
UdpServerHelper()
Create UdpServerHelper which will make life easier for people trying to set up simulations with udp-c...
Definition
udp-client-server-helper.cc:18
ns3::UdpTraceClientHelper
Create UdpTraceClient application which sends UDP packets based on a trace file of an MPEG4 stream.
Definition
udp-client-server-helper.h:106
ns3::UdpTraceClientHelper::UdpTraceClientHelper
UdpTraceClientHelper()
Create UdpTraceClientHelper which will make life easier for people trying to set up simulations with ...
Definition
udp-client-server-helper.cc:51
port
uint16_t port
Definition
dsdv-manet.cc:33
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
applications
helper
udp-client-server-helper.h
Generated on Sun Dec 1 2024 18:20:35 for ns-3 by
1.11.0