Tunnel class - its goal is to create and manage the tunnels between endpoints. More...
Public Member Functions | |
Tunnel (Ptr< Node > n3, Ptr< Node > n0, Ptr< Node > n1, Ipv4Address n3Addr, Ipv4Address n0Addr, Ipv4Address n1Addr) | |
Constructor. More... | |
Private Member Functions | |
void | N0SocketRecv (Ptr< Socket > socket) |
Receive a packet on the N0 VirtualNetDevice. More... | |
bool | N0VirtualSend (Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber) |
Send a packet through the N0 VirtualNetDevice. More... | |
void | N1SocketRecv (Ptr< Socket > socket) |
Receive a packet on the N1 VirtualNetDevice. More... | |
bool | N1VirtualSend (Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber) |
Send a packet through the N1 VirtualNetDevice. More... | |
void | N3SocketRecv (Ptr< Socket > socket) |
Receive a packet on the N3 VirtualNetDevice. More... | |
bool | N3VirtualSend (Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber) |
Send a packet through the N3 VirtualNetDevice. More... | |
Private Attributes | |
Ipv4Address | m_n0Address |
Address of the N0 node. More... | |
Ptr< Socket > | m_n0Socket |
Socket on the N0 node. More... | |
Ptr< VirtualNetDevice > | m_n0Tap |
VirtualNetDevice on the N0 node. More... | |
Ipv4Address | m_n1Address |
Address of the N1 node. More... | |
Ptr< Socket > | m_n1Socket |
Socket on the N1 node. More... | |
Ptr< VirtualNetDevice > | m_n1Tap |
VirtualNetDevice on the N1 node. More... | |
Ipv4Address | m_n3Address |
Address of the N3 node. More... | |
Ptr< Socket > | m_n3Socket |
Socket on the N3 node. More... | |
Ptr< VirtualNetDevice > | m_n3Tap |
VirtualNetDevice on the N3 node. More... | |
Ptr< UniformRandomVariable > | m_rng |
Random number generator. More... | |
Tunnel class - its goal is to create and manage the tunnels between endpoints.
Definition at line 65 of file virtual-net-device-example.cc.
|
inline |
Constructor.
n3 | Pointer of Node 3 |
n0 | Pointer of Node 0 |
n1 | Pointer of Node 1 |
n3Addr | IPv4 address of Node 3 |
n0Addr | IPv4 address of Node 0 |
n1Addr | IPv4 address of Node 1 |
Definition at line 195 of file virtual-net-device-example.cc.
References ns3::Node::AddDevice(), ns3::Socket::Bind(), ns3::Socket::CreateSocket(), ns3::Ipv4Address::GetAny(), ns3::Object::GetObject(), nsclick-simple-lan::ipv4, ns3::TypeId::LookupByName(), ns3::MakeCallback(), N0SocketRecv(), N0VirtualSend(), N1SocketRecv(), N1VirtualSend(), N3SocketRecv(), N3VirtualSend(), ns3::VirtualNetDevice::SetAddress(), ns3::Socket::SetRecvCallback(), and ns3::VirtualNetDevice::SetSendCallback().
Receive a packet on the N0 VirtualNetDevice.
socket | Receiving socket |
Definition at line 159 of file virtual-net-device-example.cc.
References ns3::VirtualNetDevice::GetAddress(), NS_LOG_DEBUG, ns3::NetDevice::PACKET_HOST, ns3::VirtualNetDevice::Receive(), and ns3::Socket::Recv().
Referenced by Tunnel().
|
inlineprivate |
Send a packet through the N0 VirtualNetDevice.
packet | Packet to send |
source | Source IPv4 address |
dest | Destination IPv4 address |
protocolNumber | Protocol number |
Definition at line 86 of file virtual-net-device-example.cc.
References NS_LOG_DEBUG, and ns3::Socket::SendTo().
Referenced by Tunnel().
Receive a packet on the N1 VirtualNetDevice.
socket | Receiving socket |
Definition at line 174 of file virtual-net-device-example.cc.
References ns3::VirtualNetDevice::GetAddress(), NS_LOG_DEBUG, ns3::NetDevice::PACKET_HOST, ns3::VirtualNetDevice::Receive(), and ns3::Socket::Recv().
Referenced by Tunnel().
|
inlineprivate |
Send a packet through the N1 VirtualNetDevice.
packet | Packet to send |
source | Source IPv4 address |
dest | Destination IPv4 address |
protocolNumber | Protocol number |
Definition at line 104 of file virtual-net-device-example.cc.
References NS_LOG_DEBUG, and ns3::Socket::SendTo().
Referenced by Tunnel().
Receive a packet on the N3 VirtualNetDevice.
socket | Receiving socket |
Definition at line 144 of file virtual-net-device-example.cc.
References ns3::VirtualNetDevice::GetAddress(), NS_LOG_DEBUG, ns3::NetDevice::PACKET_HOST, ns3::VirtualNetDevice::Receive(), and ns3::Socket::Recv().
Referenced by Tunnel().
|
inlineprivate |
Send a packet through the N3 VirtualNetDevice.
packet | Packet to send |
source | Source IPv4 address |
dest | Destination IPv4 address |
protocolNumber | Protocol number |
Definition at line 122 of file virtual-net-device-example.cc.
References ns3::UniformRandomVariable::GetValue(), NS_LOG_DEBUG, and ns3::Socket::SendTo().
Referenced by Tunnel().
|
private |
Address of the N0 node.
Definition at line 71 of file virtual-net-device-example.cc.
Socket on the N0 node.
Definition at line 68 of file virtual-net-device-example.cc.
|
private |
VirtualNetDevice on the N0 node.
Definition at line 74 of file virtual-net-device-example.cc.
|
private |
Address of the N1 node.
Definition at line 72 of file virtual-net-device-example.cc.
Socket on the N1 node.
Definition at line 69 of file virtual-net-device-example.cc.
|
private |
VirtualNetDevice on the N1 node.
Definition at line 75 of file virtual-net-device-example.cc.
|
private |
Address of the N3 node.
Definition at line 70 of file virtual-net-device-example.cc.
Socket on the N3 node.
Definition at line 67 of file virtual-net-device-example.cc.
|
private |
VirtualNetDevice on the N3 node.
Definition at line 76 of file virtual-net-device-example.cc.
|
private |
Random number generator.
Definition at line 73 of file virtual-net-device-example.cc.