A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
bulk-send-application.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2010 Georgia Institute of Technology
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: George F. Riley <riley@ece.gatech.edu>
19
*/
20
21
#ifndef BULK_SEND_APPLICATION_H
22
#define BULK_SEND_APPLICATION_H
23
24
#include "ns3/address.h"
25
#include "ns3/application.h"
26
#include "ns3/event-id.h"
27
#include "ns3/ptr.h"
28
#include "ns3/traced-callback.h"
29
#include "ns3/seq-ts-size-header.h"
30
31
namespace
ns3
{
32
33
class
Address;
34
class
Socket;
35
75
class
BulkSendApplication
:
public
Application
76
{
77
public
:
82
static
TypeId
GetTypeId
(
void
);
83
84
BulkSendApplication
();
85
86
virtual
~BulkSendApplication
();
87
101
void
SetMaxBytes
(uint64_t maxBytes);
102
107
Ptr<Socket>
GetSocket
(
void
)
const
;
108
109
protected
:
110
virtual
void
DoDispose
(
void
);
111
private
:
112
// inherited from Application base class.
113
virtual
void
StartApplication
(
void
);
// Called at time specified by Start
114
virtual
void
StopApplication
(
void
);
// Called at time specified by Stop
115
121
void
SendData
(
const
Address
&from,
const
Address
&to);
122
123
Ptr<Socket>
m_socket
;
124
Address
m_peer
;
125
Address
m_local
;
126
bool
m_connected
;
127
uint32_t
m_sendSize
;
128
uint64_t
m_maxBytes
;
129
uint64_t
m_totBytes
;
130
TypeId
m_tid
;
131
uint32_t
m_seq
{0};
132
Ptr<Packet>
m_unsentPacket
;
133
bool
m_enableSeqTsSizeHeader
{
false
};
134
136
TracedCallback<Ptr<const Packet>
>
m_txTrace
;
137
139
TracedCallback<Ptr<const Packet>
,
const
Address
&,
const
Address
&,
const
SeqTsSizeHeader
&>
m_txTraceWithSeqTsSize
;
140
141
private
:
146
void
ConnectionSucceeded
(
Ptr<Socket>
socket);
151
void
ConnectionFailed
(
Ptr<Socket>
socket);
160
void
DataSend
(
Ptr<Socket>
socket, uint32_t unused);
161
};
162
163
}
// namespace ns3
164
165
#endif
/* BULK_SEND_APPLICATION_H */
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::SeqTsSizeHeader
Header with a sequence, a timestamp, and a "size" attribute.
Definition:
seq-ts-size-header.h:38
ns3::BulkSendApplication::ConnectionFailed
void ConnectionFailed(Ptr< Socket > socket)
Connection Failed (called by Socket through a callback)
Definition:
bulk-send-application.cc:300
ns3::BulkSendApplication::StopApplication
virtual void StopApplication(void)
Application specific shutdown code.
Definition:
bulk-send-application.cc:188
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::BulkSendApplication::m_peer
Address m_peer
Peer address.
Definition:
bulk-send-application.h:124
ns3::BulkSendApplication::ConnectionSucceeded
void ConnectionSucceeded(Ptr< Socket > socket)
Connection Succeeded (called by Socket through a callback)
Definition:
bulk-send-application.cc:289
ns3::Ptr< Socket >
ns3::BulkSendApplication::m_enableSeqTsSizeHeader
bool m_enableSeqTsSizeHeader
Enable or disable the SeqTsSizeHeader.
Definition:
bulk-send-application.h:133
ns3::BulkSendApplication::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
bulk-send-application.cc:42
ns3::BulkSendApplication::DataSend
void DataSend(Ptr< Socket > socket, uint32_t unused)
Send more data as soon as some has been transmitted.
Definition:
bulk-send-application.cc:306
ns3::BulkSendApplication::m_totBytes
uint64_t m_totBytes
Total bytes sent so far.
Definition:
bulk-send-application.h:129
ns3::Address
a polymophic address class
Definition:
address.h:91
ns3::BulkSendApplication::SetMaxBytes
void SetMaxBytes(uint64_t maxBytes)
Set the upper bound for the total number of bytes to send.
Definition:
bulk-send-application.cc:104
ns3::BulkSendApplication::m_maxBytes
uint64_t m_maxBytes
Limit total number of bytes sent.
Definition:
bulk-send-application.h:128
ns3::BulkSendApplication
Send as much traffic as possible, trying to fill the bandwidth.
Definition:
bulk-send-application.h:76
ns3::BulkSendApplication::m_sendSize
uint32_t m_sendSize
Size of data to send each time.
Definition:
bulk-send-application.h:127
ns3::BulkSendApplication::~BulkSendApplication
virtual ~BulkSendApplication()
Definition:
bulk-send-application.cc:98
ns3::BulkSendApplication::m_unsentPacket
Ptr< Packet > m_unsentPacket
Variable to cache unsent packet.
Definition:
bulk-send-application.h:132
ns3::BulkSendApplication::m_tid
TypeId m_tid
The type of protocol to use.
Definition:
bulk-send-application.h:130
ns3::BulkSendApplication::m_txTrace
TracedCallback< Ptr< const Packet > > m_txTrace
Traced Callback: sent packets.
Definition:
bulk-send-application.h:136
ns3::BulkSendApplication::m_connected
bool m_connected
True if connected.
Definition:
bulk-send-application.h:126
ns3::BulkSendApplication::m_socket
Ptr< Socket > m_socket
Associated socket.
Definition:
bulk-send-application.h:123
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition:
traced-callback.h:53
ns3::BulkSendApplication::GetSocket
Ptr< Socket > GetSocket(void) const
Get the socket this application is attached to.
Definition:
bulk-send-application.cc:111
ns3::BulkSendApplication::m_local
Address m_local
Local address to bind to.
Definition:
bulk-send-application.h:125
ns3::Application
The base class for all ns3 applications.
Definition:
application.h:61
ns3::BulkSendApplication::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition:
bulk-send-application.cc:118
ns3::BulkSendApplication::m_seq
uint32_t m_seq
Sequence.
Definition:
bulk-send-application.h:131
ns3::BulkSendApplication::BulkSendApplication
BulkSendApplication()
Definition:
bulk-send-application.cc:89
ns3::BulkSendApplication::StartApplication
virtual void StartApplication(void)
Application specific startup code.
Definition:
bulk-send-application.cc:129
ns3::BulkSendApplication::SendData
void SendData(const Address &from, const Address &to)
Send data until the L4 transmission buffer is full.
Definition:
bulk-send-application.cc:206
ns3::BulkSendApplication::m_txTraceWithSeqTsSize
TracedCallback< Ptr< const Packet >, const Address &, const Address &, const SeqTsSizeHeader & > m_txTraceWithSeqTsSize
Callback for tracing the packet Tx events, includes source, destination, the packet sent,...
Definition:
bulk-send-application.h:139
src
applications
model
bulk-send-application.h
Generated on Fri Oct 1 2021 17:02:54 for ns-3 by
1.8.20