A Discrete-Event Network Simulator
API
tcp-general-test.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 Natale Patriciello <natale.patriciello@gmail.com>
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 */
18#ifndef TCPGENERALTEST_H
19#define TCPGENERALTEST_H
20
21#include "ns3/error-model.h"
22#include "ns3/simple-net-device.h"
23#include "ns3/tcp-congestion-ops.h"
24#include "ns3/tcp-rate-ops.h"
25#include "ns3/tcp-recovery-ops.h"
26#include "ns3/tcp-socket-base.h"
27#include "ns3/test.h"
28
29namespace ns3
30{
31
53{
54 public:
59 static TypeId GetTypeId();
60
63 {
64 }
65
71 : TcpSocketBase(other)
72 {
73 m_rcvAckCb = other.m_rcvAckCb;
77 m_forkCb = other.m_forkCb;
79 }
80
89
97
105
112
119
125
132
133 protected:
134 void ReceivedAck(Ptr<Packet> packet, const TcpHeader& tcpHeader) override;
135 void ReTxTimeout() override;
136 Ptr<TcpSocketBase> Fork() override;
138 const TcpHeader& tcpHeader,
139 const Address& fromAddress,
140 const Address& toAddress) override;
141 void UpdateRttHistory(const SequenceNumber32& seq, uint32_t sz, bool isRetransmission) override;
142
143 private:
150};
151
170{
171 public:
176 static TypeId GetTypeId();
177
180 m_bytesToAck(125),
183 {
184 }
185
191 : TcpSocketMsgBase(other),
195 {
196 }
197
203 {
204 m_bytesToAck = bytes;
205 }
206
207 protected:
208 void SendEmptyPacket(uint8_t flags) override;
209 Ptr<TcpSocketBase> Fork() override;
210
214};
215
258{
259 public:
268 TcpGeneralTest(const std::string& desc);
269 ~TcpGeneralTest() override;
270
276 {
278 RECEIVER
279 };
280
281 protected:
288
295
302
309
316
326 TypeId socketType,
327 TypeId congControl);
328
339 TypeId socketType,
340 TypeId congControl,
341 TypeId recoveryAlgorithm);
342
348 {
349 return m_senderSocket;
350 }
351
357 {
358 return m_receiverSocket;
359 }
360
377 void DoRun() override;
378
382 virtual void ConfigureEnvironment();
383
387 virtual void ConfigureProperties();
388
392 void DoTeardown() override;
393
397 void DoConnect();
398
405 virtual void ReceivePacket(Ptr<Socket> socket);
406
415 void SendPacket(Ptr<Socket> socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval);
416
425
434
441
448
455
462
469
476
483 Time GetRto(SocketWho who);
484
492
500
508
516
524
532
540
548
556
564
572
579 void SetRcvBufSize(SocketWho who, uint32_t size);
580
588
595 void SetInitialCwnd(SocketWho who, uint32_t initialCwnd);
596
603 void SetDelAckMaxCount(SocketWho who, uint32_t count);
604
612
619 void SetPacingStatus(SocketWho who, bool pacing);
620
627 void SetPaceInitialWindow(SocketWho who, bool paceWindow);
628
635 void SetInitialSsThresh(SocketWho who, uint32_t initialSsThresh);
636
645 {
647 }
648
657 {
658 m_pktCount = pktCount;
659 }
660
666 void SetAppPktInterval(Time pktInterval)
667 {
668 m_interPacketInterval = pktInterval;
669 }
670
676 void SetPropagationDelay(Time propDelay)
677 {
678 m_propagationDelay = propDelay;
679 }
680
686 void SetTransmitStart(Time startTime)
687 {
688 m_startTime = startTime;
689 }
690
696 void SetCongestionControl(TypeId congControl)
697 {
698 m_congControlTypeId = congControl;
699 }
700
707 {
708 m_recoveryTypeId = recovery;
709 }
710
716 void SetMTU(uint32_t mtu)
717 {
718 m_mtu = mtu;
719 }
720
726 virtual void CongStateTrace(const TcpSocketState::TcpCongState_t oldValue [[maybe_unused]],
727 const TcpSocketState::TcpCongState_t newValue [[maybe_unused]])
728 {
729 }
730
737 virtual void CWndTrace(uint32_t oldValue [[maybe_unused]], uint32_t newValue [[maybe_unused]])
738 {
739 }
740
747 virtual void CWndInflTrace(uint32_t oldValue [[maybe_unused]],
748 uint32_t newValue [[maybe_unused]])
749 {
750 }
751
760 virtual void RttTrace(Time oldTime [[maybe_unused]], Time newTime [[maybe_unused]])
761 {
762 }
763
772 virtual void SsThreshTrace(uint32_t oldValue [[maybe_unused]],
773 uint32_t newValue [[maybe_unused]])
774 {
775 }
776
785 virtual void BytesInFlightTrace(uint32_t oldValue [[maybe_unused]],
786 uint32_t newValue [[maybe_unused]])
787 {
788 }
789
798 virtual void RtoTrace(Time oldValue [[maybe_unused]], Time newValue [[maybe_unused]])
799 {
800 }
801
810 virtual void NextTxSeqTrace(SequenceNumber32 oldValue [[maybe_unused]],
811 SequenceNumber32 newValue [[maybe_unused]])
812 {
813 }
814
823 virtual void HighestTxSeqTrace(SequenceNumber32 oldValue [[maybe_unused]],
824 SequenceNumber32 newValue [[maybe_unused]])
825 {
826 }
827
832 virtual void RateUpdatedTrace(const TcpRateLinux::TcpRateConnection& rate [[maybe_unused]])
833 {
834 }
835
840 virtual void RateSampleUpdatedTrace(const TcpRateLinux::TcpRateSample& sample [[maybe_unused]])
841 {
842 }
843
848 virtual void NormalClose(SocketWho who [[maybe_unused]])
849 {
850 }
851
857 virtual void ErrorClose(SocketWho who [[maybe_unused]])
858 {
860 }
861
866 virtual void QueueDrop(SocketWho who [[maybe_unused]])
867 {
868 }
869
874 virtual void PhyDrop(SocketWho who [[maybe_unused]])
875 {
876 }
877
887 virtual void RcvAck(const Ptr<const TcpSocketState> tcb [[maybe_unused]],
888 const TcpHeader& h [[maybe_unused]],
889 SocketWho who [[maybe_unused]])
890 {
891 }
892
902 virtual void ProcessedAck(const Ptr<const TcpSocketState> tcb [[maybe_unused]],
903 const TcpHeader& h [[maybe_unused]],
904 SocketWho who [[maybe_unused]])
905 {
906 }
907
915 virtual void Tx(const Ptr<const Packet> p, const TcpHeader& h, SocketWho who);
916
924 virtual void Rx(const Ptr<const Packet> p, const TcpHeader& h, SocketWho who);
925
932 virtual void AfterRTOExpired(const Ptr<const TcpSocketState> tcb [[maybe_unused]],
933 SocketWho who [[maybe_unused]])
934 {
935 }
936
943 virtual void BeforeRTOExpired(const Ptr<const TcpSocketState> tcb [[maybe_unused]],
944 SocketWho who [[maybe_unused]])
945 {
946 }
947
955 virtual void UpdatedRttHistory(const SequenceNumber32& seq [[maybe_unused]],
956 uint32_t sz [[maybe_unused]],
957 bool isRetransmission [[maybe_unused]],
958 SocketWho who [[maybe_unused]])
959 {
960 }
961
968 virtual void DataSent(uint32_t size [[maybe_unused]], SocketWho who [[maybe_unused]])
969 {
970 }
971
975 virtual void FinalChecks()
976 {
977 }
978
984 {
985 return m_propagationDelay;
986 }
987
993 {
994 return m_startTime;
995 }
996
1002 {
1003 return m_mtu;
1004 }
1005
1011 {
1012 return m_pktSize;
1013 }
1014
1020 {
1021 return m_pktCount;
1022 }
1023
1030 {
1031 return m_interPacketInterval;
1032 }
1033
1036
1037 private:
1038 // Member variables, accessible through getters
1039 // giving write access to subclass can be dangerous
1041
1044
1048
1051
1052 private:
1053 // De-multiplexing callbacks.
1054
1059 void NormalCloseCb(Ptr<Socket> socket);
1064 void ErrorCloseCb(Ptr<Socket> socket);
1070 void QueueDropCb(std::string context, Ptr<const Packet> p);
1076 void PhyDropCb(std::string context, Ptr<const Packet> p);
1097 void TxPacketCb(const Ptr<const Packet> p,
1098 const TcpHeader& h,
1099 const Ptr<const TcpSocketBase> tcp);
1106 void RxPacketCb(const Ptr<const Packet> p,
1107 const TcpHeader& h,
1108 const Ptr<const TcpSocketBase> tcp);
1123 const SequenceNumber32& seq,
1124 uint32_t sz,
1125 bool isRetransmission);
1126
1133
1140 const Ptr<const TcpSocketBase> tcp);
1141
1147 void DataSentCb(Ptr<Socket> socket, uint32_t size);
1152 void ForkCb(Ptr<TcpSocketMsgBase> tcp);
1158 void HandleAccept(Ptr<Socket> socket, const Address& from);
1159
1161};
1162
1174{
1175 return tcb->m_congState.Get();
1176}
1177
1178} // namespace ns3
1179
1180#endif // TCPGENERALTEST_H
a polymophic address class
Definition: address.h:92
Callback template class.
Definition: callback.h:443
An identifier for simulation events.
Definition: event-id.h:55
an Inet address class
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
General infrastructure for TCP testing.
Ptr< RttEstimator > GetRttEstimator(SocketWho who)
Get the Rtt estimator of the socket.
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
uint32_t GetPktCount() const
Get the number of application packets.
virtual void HighestTxSeqTrace(SequenceNumber32 oldValue, SequenceNumber32 newValue)
Highest tx seq changes.
void ErrorCloseCb(Ptr< Socket > socket)
Error Close Callback.
TypeId m_recoveryTypeId
Recovery.
uint32_t GetDelAckCount(SocketWho who)
Get the number of delayed ack (if present)
void SetPropagationDelay(Time propDelay)
Propagation delay of the bottleneck link.
virtual void DataSent(uint32_t size, SocketWho who)
Notifying application for sent data.
virtual Ptr< ErrorModel > CreateReceiverErrorModel()
Create and return the error model to install in the receiver node.
void SetAppPktCount(uint32_t pktCount)
Set app packet count.
void SetDelAckMaxCount(SocketWho who, uint32_t count)
Forcefully set the delayed acknowledgement count.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
@ RECEIVER
Receiver node.
void BeforeRetransmitCb(const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp)
Invoked before a retransmit event.
Ptr< TcpTxBuffer > GetTxBuffer(SocketWho who)
Get the Tx buffer from selected socket.
virtual void CWndTrace(uint32_t oldValue, uint32_t newValue)
Tracks the congestion window changes.
void TxPacketCb(const Ptr< const Packet > p, const TcpHeader &h, const Ptr< const TcpSocketBase > tcp)
Tx packet Callback.
void SetAppPktSize(uint32_t pktSize)
Set app packet size.
void SetCongestionControl(TypeId congControl)
Congestion control of the sender socket.
virtual void RateUpdatedTrace(const TcpRateLinux::TcpRateConnection &rate)
Track the rate value of TcpRateLinux.
virtual void NormalClose(SocketWho who)
Socket closed normally.
uint32_t m_mtu
MTU of the environment.
virtual void RcvAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
Received ack.
virtual void NextTxSeqTrace(SequenceNumber32 oldValue, SequenceNumber32 newValue)
Next tx seq changes.
Time GetMinRto(SocketWho who)
Get the minimum RTO attribute.
Ptr< TcpSocketState > GetTcb(SocketWho who)
Get the TCB from selected socket.
void SetRcvBufSize(SocketWho who, uint32_t size)
Forcefully set a defined size for rx buffer.
Time m_interPacketInterval
Time between sending application packet down to tcp socket.
virtual void SsThreshTrace(uint32_t oldValue, uint32_t newValue)
Slow start threshold changes.
uint32_t m_pktSize
Size of the application packet.
EventId GetPersistentEvent(SocketWho who)
Get the persistent event of the selected socket.
uint32_t m_pktCount
Count of the application packet.
void HandleAccept(Ptr< Socket > socket, const Address &from)
Handle an accept connection.
virtual void BeforeRTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Rto has expired.
void QueueDropCb(std::string context, Ptr< const Packet > p)
Queue Drop Callback.
virtual void BytesInFlightTrace(uint32_t oldValue, uint32_t newValue)
Bytes in flight changes.
void ForkCb(Ptr< TcpSocketMsgBase > tcp)
Fork Callback.
uint32_t GetReTxThreshold(SocketWho who)
Get the retransmission threshold.
void SetInitialCwnd(SocketWho who, uint32_t initialCwnd)
Forcefully set the initial cwnd.
void RxPacketCb(const Ptr< const Packet > p, const TcpHeader &h, const Ptr< const TcpSocketBase > tcp)
Rx packet Callback.
virtual Ptr< TcpSocketMsgBase > CreateReceiverSocket(Ptr< Node > node)
Create and install the socket to install on the receiver.
uint32_t GetDupAckCount(SocketWho who)
Get the number of dupack received.
virtual void CWndInflTrace(uint32_t oldValue, uint32_t newValue)
Tracks the inflated congestion window changes.
Time GetPktInterval() const
Get the interval to wait for each packet sent down from application to TCP.
void SetPaceInitialWindow(SocketWho who, bool paceWindow)
Enable or disable pacing of the initial window.
uint32_t GetInitialSsThresh(SocketWho who)
Get the initial slow start threshold.
virtual Ptr< TcpSocketMsgBase > CreateSocket(Ptr< Node > node, TypeId socketType, TypeId congControl)
Create a socket.
virtual void ErrorClose(SocketWho who)
Socket closed with an error.
virtual void ConfigureProperties()
Change the configuration of the socket properties.
virtual void UpdatedRttHistory(const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission, SocketWho who)
Updated the Rtt history.
virtual void QueueDrop(SocketWho who)
Drop on the queue.
virtual Ptr< SimpleChannel > CreateChannel()
Create and return the channel installed between the two socket.
void DoRun() override
Execute the tcp test.
Time GetDelAckTimeout(SocketWho who)
Get the timeout of delayed ack (if present)
void SetMTU(uint32_t mtu)
MTU of the bottleneck link.
Time GetPropagationDelay() const
Get the channel Propagation Delay.
Time GetClockGranularity(SocketWho who)
Get the clock granularity attribute.
void SetUseEcn(SocketWho who, TcpSocketState::UseEcn_t useEcn)
Forcefully set the ECN mode of use.
Time m_startTime
Data transmission time.
Ptr< TcpSocketMsgBase > m_senderSocket
Pointer to sender socket.
void DoConnect()
Scheduled at 0.0, SENDER starts the connection to RECEIVER.
Time GetRto(SocketWho who)
Get the retransmission time.
Ptr< TcpRxBuffer > GetRxBuffer(SocketWho who)
Get the Rx buffer from selected socket.
Time GetConnTimeout(SocketWho who)
Get the retransmission time for the SYN segments.
void AfterRetransmitCb(const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp)
Invoked after a retransmit event.
void SetAppPktInterval(Time pktInterval)
Interval between app-generated packet.
uint32_t GetRWnd(SocketWho who)
Get the rWnd of the selected socket.
void PhyDropCb(std::string context, Ptr< const Packet > p)
Drop at Phy layer Callback.
uint32_t GetSegSize(SocketWho who)
Get the segment size of the node specified.
TypeId m_congControlTypeId
Congestion control.
virtual void ReceivePacket(Ptr< Socket > socket)
Packet received.
virtual void RateSampleUpdatedTrace(const TcpRateLinux::TcpRateSample &sample)
Track the rate sample value of TcpRateLinux.
virtual void ProcessedAck(const Ptr< const TcpSocketState > tcb, const TcpHeader &h, SocketWho who)
Processed ack.
void DataSentCb(Ptr< Socket > socket, uint32_t size)
Data sent Callback.
Time GetStartTime() const
Get the data start time.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet received from IP layer.
void SendPacket(Ptr< Socket > socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval)
Send packets to other endpoint.
virtual void CongStateTrace(const TcpSocketState::TcpCongState_t oldValue, const TcpSocketState::TcpCongState_t newValue)
State on Ack state machine changes.
uint32_t GetMtu() const
Get the MTU of the environment.
void NormalCloseCb(Ptr< Socket > socket)
Normal Close Callback.
Time m_propagationDelay
Propagation delay of the channel.
void RcvAckCb(Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp)
Receive ACK Callback.
virtual void AfterRTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Rto has expired.
TcpSocket::TcpStates_t GetTcpState(SocketWho who)
Get the state of the TCP state machine.
virtual void PhyDrop(SocketWho who)
Link drop.
void RtoExpiredCb(const Ptr< const TcpSocketState > tcb, const Ptr< const TcpSocketBase > tcp)
RTO expired Callback.
void SetInitialSsThresh(SocketWho who, uint32_t initialSsThresh)
Forcefully set the initial ssthresh.
SequenceNumber32 GetHighestTxMark(SocketWho who)
Get the highest tx mark of the node specified.
virtual void FinalChecks()
Performs the (eventual) final checks through test asserts.
Time GetPersistentTimeout(SocketWho who)
Get the persistent timeout of the selected socket.
void SetRecoveryAlgorithm(TypeId recovery)
recovery algorithm of the sender socket
virtual void RtoTrace(Time oldValue, Time newValue)
RTO changes.
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
void SetPacingStatus(SocketWho who, bool pacing)
Enable or disable pacing in the TCP socket.
Ptr< TcpSocketMsgBase > m_receiverSocket
Pointer to receiver socket.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
virtual Ptr< ErrorModel > CreateSenderErrorModel()
Create and return the error model to install in the sender node.
uint32_t GetInitialCwnd(SocketWho who)
Get the initial congestion window.
TcpGeneralTest(const std::string &desc)
TcpGeneralTest constructor.
void UpdateRttHistoryCb(Ptr< const TcpSocketBase > tcp, const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission)
Update RTT with new data.
Ptr< TcpSocketMsgBase > GetSenderSocket()
Get the pointer to a previously created sender socket.
Ptr< TcpSocketMsgBase > GetReceiverSocket()
Get the pointer to a previously created receiver socket.
uint32_t GetPktSize() const
Get the application packet size.
virtual void RttTrace(Time oldTime, Time newTime)
Rtt changes.
void ProcessedAckCb(Ptr< const Packet > p, const TcpHeader &h, Ptr< const TcpSocketBase > tcp)
ACK processed Callback.
void DoTeardown() override
Teardown the TCP test.
void SetTransmitStart(Time startTime)
Set the initial time at which the application sends the first data packet.
InetSocketAddress m_remoteAddr
Remote peer address.
void SetSegmentSize(SocketWho who, uint32_t segmentSize)
Forcefully set the segment size.
Header for the Transmission Control Protocol.
Definition: tcp-header.h:46
A base class for implementation of a stream socket using TCP.
Class for inserting callbacks special points of the flow of TCP sockets.
UpdateRttCallback m_updateRttCb
Update RTT callback.
AckManagementCb m_processedAckCb
Processed ACK callback.
void SetAfterRetransmitCb(RetrCb cb)
Set the callback invoked after the processing of a retransmit timeout.
Callback< void, Ptr< const Packet >, const TcpHeader &, Ptr< const TcpSocketBase > > AckManagementCb
Callback for the ACK management.
void SetForkCb(Callback< void, Ptr< TcpSocketMsgBase > > cb)
Set the callback invoked after the forking.
Callback< void, Ptr< const TcpSocketState >, Ptr< const TcpSocketBase > > RetrCb
Callback for the packet retransmission management.
TcpSocketMsgBase(const TcpSocketMsgBase &other)
Constructor.
void UpdateRttHistory(const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission) override
Update the RTT history, when we send TCP segments.
void SetRcvAckCb(AckManagementCb cb)
Set the callback invoked when an ACK is received (at the beginning of the processing)
AckManagementCb m_rcvAckCb
Receive ACK callback.
void SetProcessedAckCb(AckManagementCb cb)
Set the callback invoked when an ACK is received and processed (at the end of the processing)
void SetBeforeRetransmitCb(RetrCb cb)
Set the callback invoked before the processing of a retransmit timeout.
void CompleteFork(Ptr< Packet > p, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress) override
Complete a connection by forking the socket.
Ptr< TcpSocketBase > Fork() override
Call CopyObject<> to clone me.
static TypeId GetTypeId()
Get the type ID.
Callback< void, Ptr< const TcpSocketBase >, const SequenceNumber32 &, uint32_t, bool > UpdateRttCallback
Callback for the RTT update management.
RetrCb m_beforeRetrCallback
Before retransmission callback.
Callback< void, Ptr< TcpSocketMsgBase > > m_forkCb
Fork callback.
void ReceivedAck(Ptr< Packet > packet, const TcpHeader &tcpHeader) override
Received an ACK packet.
RetrCb m_afterRetrCallback
After retransmission callback.
void ReTxTimeout() override
An RTO event happened.
void SetUpdateRttHistoryCb(UpdateRttCallback cb)
Set the callback invoked when we update rtt history.
A TCP socket which sends ACKs smaller than the segment received.
static TypeId GetTypeId()
Get the type ID.
SequenceNumber32 m_lastAckedSeq
Last sequence number ACKed.
uint32_t m_bytesToAck
Number of bytes to be ACKed.
void SendEmptyPacket(uint8_t flags) override
Send a empty packet that carries a flag, e.g., ACK.
TcpSocketSmallAcks(const TcpSocketSmallAcks &other)
Constructor.
uint32_t m_bytesLeftToBeAcked
Number of bytes to be ACKed left.
void SetBytesToAck(uint32_t bytes)
Set the bytes to be ACKed.
Ptr< TcpSocketBase > Fork() override
Call CopyObject<> to clone me.
UseEcn_t
Parameter value related to ECN enable/disable functionality similar to sysctl for tcp_ecn.
TcpCongState_t
Definition of the Congestion state machine.
encapsulates test code
Definition: test.h:1060
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:60
uint32_t segmentSize
TcpStates_t
Names of the 11 TCP states.
Definition: tcp-socket.h:66
static TcpSocketState::TcpCongState_t GetCongStateFrom(Ptr< const TcpSocketState > tcb)
Convenience function to retrieve the ACK state from a TCB.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Information about the connection rate.
Definition: tcp-rate-ops.h:173
Rate Sample structure.
Definition: tcp-rate-ops.h:139
uint32_t pktSize
packet size used for the simulation (in bytes)