#include <iostream>
#include <fstream>
#include <string>
#include <cassert>
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/internet-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/applications-module.h"
#include "ns3/ipv4-static-routing-helper.h"
#include "ns3/ipv4-list-routing-helper.h"
Go to the source code of this file.
Functions | |
void | BindSock (Ptr< Socket > sock, Ptr< NetDevice > netdev) |
void | dstSocketRecv (Ptr< Socket > socket) |
int | main (int argc, char *argv[]) |
NS_LOG_COMPONENT_DEFINE ("SocketBoundTcpRoutingExample") | |
void | SendStuff (Ptr< Socket > sock, Ipv4Address dstaddr, uint16_t port) |
void | srcSocketRecv (Ptr< Socket > socket) |
void | StartFlow (Ptr< Socket >, Ipv4Address, uint16_t) |
void | WriteUntilBufferFull (Ptr< Socket >, uint32_t) |
Variables | |
static uint32_t | currentTxBytes = 0 |
uint8_t | data [writeSize] |
static const uint32_t | totalTxBytes = 20000 |
static const uint32_t | writeSize = 1040 |
Definition at line 192 of file socket-bound-tcp-static-routing.cc.
References ns3::Socket::BindToNetDevice().
Referenced by main().
Definition at line 208 of file socket-bound-static-routing.cc.
References first::address, ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), ns3::Packet::GetSize(), NS_LOG_INFO, ns3::Socket::RecvFrom(), ns3::Packet::RemoveAllByteTags(), ns3::Packet::RemoveAllPacketTags(), and SendStuff().
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 65 of file socket-bound-tcp-static-routing.cc.
References ns3::Ipv4StaticRouting::AddHostRouteTo(), ns3::Ipv4AddressHelper::Assign(), BindSock(), ns3::AsciiTraceHelper::CreateFileStream(), ns3::Socket::CreateSocket(), ns3::Simulator::Destroy(), ns3::AsciiTraceHelperForDevice::EnableAsciiAll(), ns3::PcapHelperForDevice::EnablePcapAll(), ns3::NetDeviceContainer::Get(), ns3::Ipv4Address::GetAny(), ns3::Object::GetObject(), ns3::PacketSinkHelper::Install(), ns3::PointToPointHelper::Install(), ns3::InternetStackHelper::Install(), ns3::LOG_LEVEL_INFO, ns3::LOG_PREFIX_TIME, ns3::LogComponentEnable(), ns3::LogComponentEnableAll(), ns3::TypeId::LookupByName(), ns3::CommandLine::Parse(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Ipv4AddressHelper::SetBase(), ns3::PointToPointHelper::SetChannelAttribute(), ns3::PointToPointHelper::SetDeviceAttribute(), ns3::ApplicationContainer::Start(), StartFlow(), and ns3::ApplicationContainer::Stop().
NS_LOG_COMPONENT_DEFINE | ( | "SocketBoundTcpRoutingExample" | ) |
void SendStuff | ( | Ptr< Socket > | sock, |
Ipv4Address | dstaddr, | ||
uint16_t | port | ||
) |
Definition at line 175 of file socket-bound-static-routing.cc.
References ns3::Packet::AddPaddingAtEnd(), and ns3::Socket::SendTo().
Referenced by dstSocketRecv(), and main().
Definition at line 190 of file socket-bound-static-routing.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::Socket::GetBoundNetDevice(), ns3::InetSocketAddress::GetIpv4(), ns3::Packet::GetSize(), NS_LOG_INFO, ns3::Socket::RecvFrom(), ns3::Packet::RemoveAllByteTags(), and ns3::Packet::RemoveAllPacketTags().
Referenced by main().
void StartFlow | ( | Ptr< Socket > | localSocket, |
Ipv4Address | servAddress, | ||
uint16_t | servPort | ||
) |
Definition at line 198 of file socket-bound-tcp-static-routing.cc.
References ns3::Socket::Bind(), ns3::Socket::Connect(), currentTxBytes, ns3::Socket::GetTxAvailable(), ns3::MakeCallback(), ns3::Simulator::Now(), NS_LOG_INFO, ns3::Socket::SetSendCallback(), and WriteUntilBufferFull().
Referenced by main().
Definition at line 213 of file socket-bound-tcp-static-routing.cc.
References ns3::Socket::Close(), currentTxBytes, data, ns3::Socket::GetTxAvailable(), ns3::Socket::Send(), totalTxBytes, and writeSize.
Referenced by StartFlow().
|
static |
Definition at line 51 of file socket-bound-tcp-static-routing.cc.
Referenced by StartFlow(), and WriteUntilBufferFull().
uint8_t data[writeSize] |
Definition at line 53 of file socket-bound-tcp-static-routing.cc.
Referenced by ns3::ByteTagList::Allocate(), ns3::PacketMetadata::Allocate(), ns3::Buffer::Allocate(), ns3::dsr::DsrRouting::CheckSendBuffer(), ns3::Ipv4FlowClassifier::Classify(), ns3::PacketMetadata::Create(), ns3::Buffer::Deallocate(), ns3::Ipv6ExtensionHeader::Deserialize(), ns3::dsr::DsrFsHeader::Deserialize(), ns3::Icmpv6DestinationUnreachable::Deserialize(), ns3::Icmpv6TooBig::Deserialize(), ns3::Icmpv6TimeExceeded::Deserialize(), ns3::Icmpv6ParameterError::Deserialize(), ns3::Asn1Header::DeserializeBitstring(), TestEmptyOptionField::DoRun(), ns3::LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), ns3::LenaPssFfMacSchedulerTestCase1::DoRun(), ns3::LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), ns3::dsr::DsrFsHeaderTest::DoRun(), TestOptionWithoutAlignment::DoRun(), TestOptionWithAlignment::DoRun(), TestFulfilledAlignment::DoRun(), ReadFileTestCase::DoRun(), ns3::UanMacRcGw::EndCycle(), Histogramm(), main(), ns3::Hash::Function::Murmur3Implementation::MurmurHash3_x64_128(), ns3::Hash::Function::Murmur3Implementation::MurmurHash3_x86_128_incr(), ns3::Hash::Function::Murmur3Implementation::MurmurHash3_x86_32_incr(), ns3::Packet::PeekData(), ns3::WifiRemoteStationManager::PrepareForQueue(), ns3::dsr::DsrOptionSR::Process(), ns3::dsr::DsrOptionRerr::Process(), ns3::Ipv6Extension::ProcessOptions(), ns3::dsr::DsrRouting::PromiscReceive(), ns3::Buffer::Iterator::ReadLsbtohU16(), ns3::Buffer::Iterator::ReadLsbtohU32(), ns3::Buffer::Iterator::ReadLsbtohU64(), ns3::TagBuffer::ReadU16(), ns3::Buffer::Iterator::ReadU16(), ns3::TagBuffer::ReadU32(), ns3::Buffer::Iterator::ReadU32(), ns3::TagBuffer::ReadU64(), ns3::Buffer::Iterator::ReadU64(), ns3::Buffer::Iterator::ReadU8(), ns3::NscTcpL4Protocol::Receive(), ns3::dsr::DsrRouting::Receive(), ns3::V4Ping::Send(), ns3::Ping6::Send(), ns3::NscTcpL4Protocol::send_callback(), ns3::dsr::DsrRouting::SendPacketFromBuffer(), ns3::Asn1Header::SerializeBitstring(), MyHeader::SetData(), ns3::AnimationInterface::WriteN(), ns3::Buffer::Iterator::WriteU8(), and WriteUntilBufferFull().
|
static |
Definition at line 50 of file socket-bound-tcp-static-routing.cc.
Referenced by WriteUntilBufferFull().
|
static |
Definition at line 52 of file socket-bound-tcp-static-routing.cc.
Referenced by WriteUntilBufferFull().