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
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
18
*/
19
20
#ifndef UDP_CLIENT_SERVER_HELPER_H
21
#define UDP_CLIENT_SERVER_HELPER_H
22
23
#include <ns3/application-helper.h>
24
#include <ns3/udp-client.h>
25
#include <ns3/udp-server.h>
26
#include <ns3/udp-trace-client.h>
27
28
#include <stdint.h>
29
30
namespace
ns3
31
{
32
/**
33
* \ingroup udpclientserver
34
* \brief Create a server application which waits for input UDP packets
35
* and uses the information carried into their payload to compute
36
* delay and to determine if some packets are lost.
37
*/
38
class
UdpServerHelper
:
public
ApplicationHelper
39
{
40
public
:
41
/**
42
* Create UdpServerHelper which will make life easier for people trying
43
* to set up simulations with udp-client-server application.
44
*
45
*/
46
UdpServerHelper
();
47
48
/**
49
* Create UdpServerHelper which will make life easier for people trying
50
* to set up simulations with udp-client-server application.
51
*
52
* \param port The port the server will wait on for incoming packets
53
*/
54
UdpServerHelper
(uint16_t
port
);
55
};
56
57
/**
58
* \ingroup udpclientserver
59
* \brief Create a client application which sends UDP packets carrying
60
* a 32bit sequence number and a 64 bit time stamp.
61
*
62
*/
63
class
UdpClientHelper
:
public
ApplicationHelper
64
{
65
public
:
66
/**
67
* Create UdpClientHelper which will make life easier for people trying
68
* to set up simulations with udp-client-server.
69
*
70
*/
71
UdpClientHelper
();
72
73
/**
74
* Create UdpClientHelper which will make life easier for people trying
75
* to set up simulations with udp-client-server. Use this variant with
76
* addresses that do not include a port value (e.g., Ipv4Address and
77
* Ipv6Address).
78
*
79
* \param ip The IP address of the remote UDP server
80
* \param port The port number of the remote UDP server
81
*/
82
83
UdpClientHelper
(
const
Address
& ip, uint16_t
port
);
84
/**
85
* Create UdpClientHelper which will make life easier for people trying
86
* to set up simulations with udp-client-server. Use this variant with
87
* addresses that do include a port value (e.g., InetSocketAddress and
88
* Inet6SocketAddress).
89
*
90
* \param addr The address of the remote UDP server
91
*/
92
93
UdpClientHelper
(
const
Address
& addr);
94
};
95
96
/**
97
* \ingroup udpclientserver
98
* Create UdpTraceClient application which sends UDP packets based on a trace
99
* file of an MPEG4 stream. Trace files could be downloaded form :
100
* https://web.archive.org/web/20190907061916/http://www2.tkn.tu-berlin.de/research/trace/ltvt.html
101
* (the 2 first lines of the file should be removed)
102
* A valid trace file is a file with 4 columns:
103
* \li -1- the first one represents the frame index
104
* \li -2- the second one indicates the type of the frame: I, P or B
105
* \li -3- the third one indicates the time on which the frame was generated by the encoder
106
* \li -4- the fourth one indicates the frame size in byte
107
*/
108
class
UdpTraceClientHelper
:
public
ApplicationHelper
109
{
110
public
:
111
/**
112
* Create UdpTraceClientHelper which will make life easier for people trying
113
* to set up simulations with udp-client-server.
114
*
115
*/
116
UdpTraceClientHelper
();
117
118
/**
119
* Create UdpTraceClientHelper which will make life easier for people trying
120
* to set up simulations with udp-client-server. Use this variant with
121
* addresses that do not include a port value (e.g., Ipv4Address and
122
* Ipv6Address).
123
*
124
* \param ip The IP address of the remote UDP server
125
* \param port The port number of the remote UDP server
126
* \param filename the file from which packet traces will be loaded
127
*/
128
UdpTraceClientHelper
(
const
Address
& ip, uint16_t
port
,
const
std::string& filename =
""
);
129
130
/**
131
* Create UdpTraceClientHelper which will make life easier for people trying
132
* to set up simulations with udp-client-server. Use this variant with
133
* addresses that do include a port value (e.g., InetSocketAddress and
134
* Inet6SocketAddress).
135
*
136
* \param addr The address of the remote UDP server
137
* \param filename the file from which packet traces will be loaded
138
*/
139
UdpTraceClientHelper
(
const
Address
& addr,
const
std::string& filename =
""
);
140
};
141
142
}
// namespace ns3
143
144
#endif
/* UDP_CLIENT_SERVER_H */
ns3::Address
a polymophic address class
Definition:
address.h:101
ns3::ApplicationHelper
A helper to make it easier to instantiate an application on a set of nodes.
Definition:
application-helper.h:39
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:64
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:39
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:39
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:28
ns3::UdpTraceClientHelper
Create UdpTraceClient application which sends UDP packets based on a trace file of an MPEG4 stream.
Definition:
udp-client-server-helper.h:109
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:56
port
uint16_t port
Definition:
dsdv-manet.cc:44
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
applications
helper
udp-client-server-helper.h
Generated on Tue May 28 2024 23:34:07 for ns-3 by
1.9.6