|
|
| 18 |
* Author: Raj Bhattacharjea <raj.b@gatech.edu> |
18 |
* Author: Raj Bhattacharjea <raj.b@gatech.edu> |
| 19 |
*/ |
19 |
*/ |
| 20 |
|
20 |
|
|
|
21 |
#define __STDC_LIMIT_MACROS |
| 22 |
#include <stdint.h> |
| 21 |
#include "ns3/assert.h" |
23 |
#include "ns3/assert.h" |
| 22 |
#include "ns3/log.h" |
24 |
#include "ns3/log.h" |
| 23 |
#include "ns3/nstime.h" |
25 |
#include "ns3/nstime.h" |
|
|
| 29 |
#include "ns3/simulator.h" |
31 |
#include "ns3/simulator.h" |
| 30 |
#include "ns3/ipv4-route.h" |
32 |
#include "ns3/ipv4-route.h" |
| 31 |
#include "ns3/ipv6-route.h" |
33 |
#include "ns3/ipv6-route.h" |
|
|
34 |
#include "ns3/random-variable-stream.h" |
| 32 |
|
35 |
|
| 33 |
#include "tcp-l4-protocol.h" |
36 |
#include "tcp-l4-protocol.h" |
| 34 |
#include "tcp-header.h" |
37 |
#include "tcp-header.h" |
|
|
| 92 |
{ |
95 |
{ |
| 93 |
NS_LOG_FUNCTION_NOARGS (); |
96 |
NS_LOG_FUNCTION_NOARGS (); |
| 94 |
NS_LOG_LOGIC ("Made a TcpL4Protocol " << this); |
97 |
NS_LOG_LOGIC ("Made a TcpL4Protocol " << this); |
|
|
98 |
m_isnGenerator = CreateObject<UniformRandomVariable> (); |
| 95 |
} |
99 |
} |
| 96 |
|
100 |
|
| 97 |
TcpL4Protocol::~TcpL4Protocol () |
101 |
TcpL4Protocol::~TcpL4Protocol () |
|
|
| 99 |
NS_LOG_FUNCTION (this); |
103 |
NS_LOG_FUNCTION (this); |
| 100 |
} |
104 |
} |
| 101 |
|
105 |
|
|
|
106 |
int64_t |
| 107 |
TcpL4Protocol::AssignStreams (int64_t stream) |
| 108 |
{ |
| 109 |
NS_LOG_FUNCTION (this << stream); |
| 110 |
m_isnGenerator->SetStream (stream); |
| 111 |
return 1; |
| 112 |
} |
| 113 |
|
| 102 |
void |
114 |
void |
| 103 |
TcpL4Protocol::SetNode (Ptr<Node> node) |
115 |
TcpL4Protocol::SetNode (Ptr<Node> node) |
| 104 |
{ |
116 |
{ |
|
|
| 190 |
socket->SetTcp (this); |
202 |
socket->SetTcp (this); |
| 191 |
socket->SetRtt (rtt); |
203 |
socket->SetRtt (rtt); |
| 192 |
socket->SetCongestionControlAlgorithm (algo); |
204 |
socket->SetCongestionControlAlgorithm (algo); |
|
|
205 |
socket->SetInitialSequence (m_isnGenerator->GetInteger (0, UINT32_MAX)); |
| 193 |
|
206 |
|
| 194 |
m_sockets.push_back (socket); |
207 |
m_sockets.push_back (socket); |
| 195 |
return socket; |
208 |
return socket; |
|
|
| 697 |
++it; |
710 |
++it; |
| 698 |
} |
711 |
} |
| 699 |
|
712 |
|
|
|
713 |
socket->SetInitialSequence (m_isnGenerator->GetInteger (0, UINT32_MAX)); |
| 700 |
m_sockets.push_back (socket); |
714 |
m_sockets.push_back (socket); |
| 701 |
} |
715 |
} |
| 702 |
|
716 |
|