A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::Ipv4L3Protocol Class Reference

Implement the IPv4 layer. More...

#include "ipv4-l3-protocol.h"

+ Inheritance diagram for ns3::Ipv4L3Protocol:
+ Collaboration diagram for ns3::Ipv4L3Protocol:

Classes

class  Fragments
 A Set of Fragment belonging to the same packet (src, dst, identification and proto) More...
 

Public Types

enum  DropReason {
  DROP_TTL_EXPIRED = 1 , DROP_NO_ROUTE , DROP_BAD_CHECKSUM , DROP_INTERFACE_DOWN ,
  DROP_ROUTE_ERROR , DROP_FRAGMENT_TIMEOUT , DROP_DUPLICATE
}
 Reason why a packet has been dropped. More...
 
typedef void(* DropTracedCallback) (const Ipv4Header &header, Ptr< const Packet > packet, DropReason reason, Ptr< Ipv4 > ipv4, uint32_t interface)
 TracedCallback signature for packet drop events.
 
typedef void(* SentTracedCallback) (const Ipv4Header &header, Ptr< const Packet > packet, uint32_t interface)
 TracedCallback signature for packet send, forward, or local deliver events.
 
typedef void(* TxRxTracedCallback) (Ptr< const Packet > packet, Ptr< Ipv4 > ipv4, uint32_t interface)
 TracedCallback signature for packet transmission or reception events.
 

Public Member Functions

 Ipv4L3Protocol ()
 
 Ipv4L3Protocol (const Ipv4L3Protocol &)=delete
 
 ~Ipv4L3Protocol () override
 
bool AddAddress (uint32_t i, Ipv4InterfaceAddress address) override
 
uint32_t AddInterface (Ptr< NetDevice > device) override
 
Ptr< SocketCreateRawSocket () override
 Creates a raw socket.
 
void DeleteRawSocket (Ptr< Socket > socket) override
 Deletes a particular raw socket.
 
Ipv4InterfaceAddress GetAddress (uint32_t interfaceIndex, uint32_t addressIndex) const override
 Because addresses can be removed, the addressIndex is not guaranteed to be static across calls to this method.
 
Ptr< Ipv4InterfaceGetInterface (uint32_t i) const
 Get an interface.
 
int32_t GetInterfaceForAddress (Ipv4Address addr) const override
 Return the interface number of the interface that has been assigned the specified IP address.
 
int32_t GetInterfaceForDevice (Ptr< const NetDevice > device) const override
 
int32_t GetInterfaceForPrefix (Ipv4Address addr, Ipv4Mask mask) const override
 Return the interface number of first interface found that has an Ipv4 address within the prefix specified by the input address and mask parameters.
 
uint16_t GetMetric (uint32_t i) const override
 
uint16_t GetMtu (uint32_t i) const override
 
uint32_t GetNAddresses (uint32_t interface) const override
 
Ptr< NetDeviceGetNetDevice (uint32_t i) override
 
uint32_t GetNInterfaces () const override
 
Ptr< IpL4ProtocolGetProtocol (int protocolNumber) const override
 
Ptr< IpL4ProtocolGetProtocol (int protocolNumber, int32_t interfaceIndex) const override
 Get L4 protocol by protocol number for the specified interface.
 
Ptr< Ipv4RoutingProtocolGetRoutingProtocol () const override
 Get the routing protocol to be used by this Ipv4 stack.
 
void Insert (Ptr< IpL4Protocol > protocol) override
 
void Insert (Ptr< IpL4Protocol > protocol, uint32_t interfaceIndex) override
 Add a L4 protocol to a specific interface.
 
bool IsDestinationAddress (Ipv4Address address, uint32_t iif) const override
 Determine whether address and interface corresponding to received packet can be accepted for local delivery.
 
bool IsForwarding (uint32_t i) const override
 
bool IsUnicast (Ipv4Address ad) const
 Check if an IPv4 address is unicast according to the node.
 
bool IsUp (uint32_t i) const override
 
Ipv4L3Protocoloperator= (const Ipv4L3Protocol &)=delete
 
void Receive (Ptr< NetDevice > device, Ptr< const Packet > p, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType)
 Lower layer calls this method after calling L3Demux::Lookup The ARP subclass needs to know from which NetDevice this packet is coming to:
 
void Remove (Ptr< IpL4Protocol > protocol) override
 
void Remove (Ptr< IpL4Protocol > protocol, uint32_t interfaceIndex) override
 Remove a L4 protocol from a specific interface.
 
bool RemoveAddress (uint32_t interface, Ipv4Address address) override
 Remove the given address on named Ipv4 interface.
 
bool RemoveAddress (uint32_t interfaceIndex, uint32_t addressIndex) override
 Remove the address at addressIndex on named interface.
 
Ipv4Address SelectSourceAddress (Ptr< const NetDevice > device, Ipv4Address dst, Ipv4InterfaceAddress::InterfaceAddressScope_e scope) override
 Return the first primary source address with scope less than or equal to the requested scope, to use in sending a packet to destination dst out of the specified device.
 
void Send (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, uint8_t protocol, Ptr< Ipv4Route > route) override
 
void SendWithHeader (Ptr< Packet > packet, Ipv4Header ipHeader, Ptr< Ipv4Route > route) override
 
void SetDefaultTtl (uint8_t ttl)
 
void SetDown (uint32_t i) override
 
void SetForwarding (uint32_t i, bool val) override
 
void SetMetric (uint32_t i, uint16_t metric) override
 
void SetNode (Ptr< Node > node)
 Set node associated with this stack.
 
void SetRoutingProtocol (Ptr< Ipv4RoutingProtocol > routingProtocol) override
 Register a new routing protocol to be used by this Ipv4 stack.
 
void SetUp (uint32_t i) override
 
Ipv4Address SourceAddressSelection (uint32_t interface, Ipv4Address dest) override
 Choose the source address to use with destination address.
 
- Public Member Functions inherited from ns3::Ipv4
 Ipv4 ()
 
 ~Ipv4 () override
 
virtual bool AddAddress (uint32_t interface, Ipv4InterfaceAddress address)=0
 
virtual uint32_t AddInterface (Ptr< NetDevice > device)=0
 
virtual Ptr< SocketCreateRawSocket ()=0
 Creates a raw socket.
 
virtual void DeleteRawSocket (Ptr< Socket > socket)=0
 Deletes a particular raw socket.
 
virtual Ipv4InterfaceAddress GetAddress (uint32_t interface, uint32_t addressIndex) const =0
 Because addresses can be removed, the addressIndex is not guaranteed to be static across calls to this method.
 
virtual int32_t GetInterfaceForAddress (Ipv4Address address) const =0
 Return the interface number of the interface that has been assigned the specified IP address.
 
virtual int32_t GetInterfaceForDevice (Ptr< const NetDevice > device) const =0
 
virtual int32_t GetInterfaceForPrefix (Ipv4Address address, Ipv4Mask mask) const =0
 Return the interface number of first interface found that has an Ipv4 address within the prefix specified by the input address and mask parameters.
 
virtual uint16_t GetMetric (uint32_t interface) const =0
 
virtual uint16_t GetMtu (uint32_t interface) const =0
 
virtual uint32_t GetNAddresses (uint32_t interface) const =0
 
virtual Ptr< NetDeviceGetNetDevice (uint32_t interface)=0
 
virtual uint32_t GetNInterfaces () const =0
 
virtual Ptr< IpL4ProtocolGetProtocol (int protocolNumber) const =0
 
virtual Ptr< IpL4ProtocolGetProtocol (int protocolNumber, int32_t interfaceIndex) const =0
 Get L4 protocol by protocol number for the specified interface.
 
virtual Ptr< Ipv4RoutingProtocolGetRoutingProtocol () const =0
 Get the routing protocol to be used by this Ipv4 stack.
 
virtual void Insert (Ptr< IpL4Protocol > protocol)=0
 
virtual void Insert (Ptr< IpL4Protocol > protocol, uint32_t interfaceIndex)=0
 Add a L4 protocol to a specific interface.
 
virtual bool IsDestinationAddress (Ipv4Address address, uint32_t iif) const =0
 Determine whether address and interface corresponding to received packet can be accepted for local delivery.
 
virtual bool IsForwarding (uint32_t interface) const =0
 
virtual bool IsUp (uint32_t interface) const =0
 
virtual void Remove (Ptr< IpL4Protocol > protocol)=0
 
virtual void Remove (Ptr< IpL4Protocol > protocol, uint32_t interfaceIndex)=0
 Remove a L4 protocol from a specific interface.
 
virtual bool RemoveAddress (uint32_t interface, Ipv4Address address)=0
 Remove the given address on named Ipv4 interface.
 
virtual bool RemoveAddress (uint32_t interface, uint32_t addressIndex)=0
 Remove the address at addressIndex on named interface.
 
virtual Ipv4Address SelectSourceAddress (Ptr< const NetDevice > device, Ipv4Address dst, Ipv4InterfaceAddress::InterfaceAddressScope_e scope)=0
 Return the first primary source address with scope less than or equal to the requested scope, to use in sending a packet to destination dst out of the specified device.
 
virtual void Send (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, uint8_t protocol, Ptr< Ipv4Route > route)=0
 
virtual void SendWithHeader (Ptr< Packet > packet, Ipv4Header ipHeader, Ptr< Ipv4Route > route)=0
 
virtual void SetDown (uint32_t interface)=0
 
virtual void SetForwarding (uint32_t interface, bool val)=0
 
virtual void SetMetric (uint32_t interface, uint16_t metric)=0
 
virtual void SetRoutingProtocol (Ptr< Ipv4RoutingProtocol > routingProtocol)=0
 Register a new routing protocol to be used by this Ipv4 stack.
 
virtual void SetUp (uint32_t interface)=0
 
virtual Ipv4Address SourceAddressSelection (uint32_t interface, Ipv4Address dest)=0
 Choose the source address to use with destination address.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
virtual TypeId GetInstanceTypeId () const =0
 Get the most derived TypeId for this Object.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Ipv4
static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Static Public Attributes

static const uint16_t PROT_NUMBER = 0x0800
 Protocol number (0x0800)
 
- Static Public Attributes inherited from ns3::Ipv4
static const uint32_t IF_ANY = 0xffffffff
 interface wildcard, meaning any interface
 

Protected Member Functions

void DoDispose () override
 Destructor implementation.
 
void NotifyNewAggregate () override
 This function will notify other components connected to the node that a new stack member is now connected This will be used to notify Layer 3 protocol of layer 4 protocol stack to connect them together.
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Private Types

typedef std::map< DupTuple_t, TimeDupMap_t
 Maps packet duplicate tuple to expiration time.
 
typedef std::tuple< uint64_t, uint8_t, Ipv4Address, Ipv4AddressDupTuple_t
 IETF RFC 6621, Section 6.2 de-duplication w/o IPSec RFC 6621 recommended duplicate packet tuple: {IPV hash, IP protocol, IP source address, IP destination address}.
 
typedef std::pair< uint64_t, uint32_tFragmentKey_t
 Key identifying a fragmented packet.
 
typedef std::list< std::tuple< Time, FragmentKey_t, Ipv4Header, uint32_t > > FragmentsTimeoutsList_t
 Container for fragment timeouts.
 
typedef std::list< std::tuple< Time, FragmentKey_t, Ipv4Header, uint32_t > >::iterator FragmentsTimeoutsListI_t
 Container Iterator for fragment timeouts..
 
typedef std::vector< Ptr< Ipv4Interface > > Ipv4InterfaceList
 Container of the IPv4 Interfaces.
 
typedef std::map< Ptr< const NetDevice >, uint32_tIpv4InterfaceReverseContainer
 Container of NetDevices registered to IPv4 and their interface indexes.
 
typedef std::pair< Ptr< Packet >, Ipv4HeaderIpv4PayloadHeaderPair
 Pair of a packet and an Ipv4 header.
 
typedef std::map< L4ListKey_t, Ptr< IpL4Protocol > > L4List_t
 Container of the IPv4 L4 instances.
 
typedef std::pair< int, int32_tL4ListKey_t
 Container of the IPv4 L4 keys: protocol number, interface index.
 
typedef std::map< FragmentKey_t, Ptr< Fragments > > MapFragments_t
 Container of fragments, stored as pairs(src+dst addr, src+dst port) / fragment.
 
typedef std::list< Ptr< Ipv4RawSocketImpl > > SocketList
 Container of the IPv4 Raw Sockets.
 

Private Member Functions

uint32_t AddIpv4Interface (Ptr< Ipv4Interface > interface)
 Add an IPv4 interface to the stack.
 
Ipv4Header BuildHeader (Ipv4Address source, Ipv4Address destination, uint8_t protocol, uint16_t payloadSize, uint8_t ttl, uint8_t tos, bool mayFragment)
 Construct an IPv4 header.
 
void CallTxTrace (const Ipv4Header &ipHeader, Ptr< Packet > packet, Ptr< Ipv4 > ipv4, uint32_t interface)
 Make a copy of the packet, add the header and invoke the TX trace callback.
 
void DecreaseIdentification (Ipv4Address source, Ipv4Address destination, uint8_t protocol)
 Decrease the identification value for a dropped or recursed packet.
 
void DoFragmentation (Ptr< Packet > packet, const Ipv4Header &ipv4Header, uint32_t outIfaceMtu, std::list< Ipv4PayloadHeaderPair > &listFragments)
 Fragment a packet.
 
Ptr< Icmpv4L4ProtocolGetIcmp () const
 Get ICMPv4 protocol.
 
bool GetIpForward () const override
 Get the IP forwarding state.
 
bool GetWeakEsModel () const override
 Get the Weak Es Model status.
 
void HandleFragmentsTimeout (FragmentKey_t key, Ipv4Header &ipHeader, uint32_t iif)
 Process the timeout for packet fragments.
 
void HandleTimeout ()
 Handles a fragmented packet timeout.
 
void IpForward (Ptr< Ipv4Route > rtentry, Ptr< const Packet > p, const Ipv4Header &header)
 Forward a packet.
 
void IpMulticastForward (Ptr< Ipv4MulticastRoute > mrtentry, Ptr< const Packet > p, const Ipv4Header &header)
 Forward a multicast packet.
 
bool IsUnicast (Ipv4Address ad, Ipv4Mask interfaceMask) const
 Check if an IPv4 address is unicast.
 
void LocalDeliver (Ptr< const Packet > p, const Ipv4Header &ip, uint32_t iif)
 Deliver a packet.
 
bool ProcessFragment (Ptr< Packet > &packet, Ipv4Header &ipHeader, uint32_t iif)
 Process a packet fragment.
 
void RemoveDuplicates ()
 Remove expired duplicates packet entry.
 
void RouteInputError (Ptr< const Packet > p, const Ipv4Header &ipHeader, Socket::SocketErrno sockErrno)
 Fallback when no route is found.
 
void SendRealOut (Ptr< Ipv4Route > route, Ptr< Packet > packet, const Ipv4Header &ipHeader)
 Send packet with route.
 
void SetIpForward (bool forward) override
 Set or unset the IP forwarding state.
 
FragmentsTimeoutsListI_t SetTimeout (FragmentKey_t key, Ipv4Header ipHeader, uint32_t iif)
 Set a new timeout "event" for a fragmented packet.
 
void SetupLoopback ()
 Setup loopback interface.
 
void SetWeakEsModel (bool model) override
 Set or unset the Weak Es Model.
 
bool UpdateDuplicate (Ptr< const Packet > p, const Ipv4Header &header)
 Registers duplicate entry, return false if new.
 

Private Attributes

EventId m_cleanDpd
 event to cleanup expired duplicate entries
 
uint8_t m_defaultTtl
 Default TTL.
 
TracedCallback< const Ipv4Header &, Ptr< const Packet >, DropReason, Ptr< Ipv4 >, uint32_tm_dropTrace
 Trace of dropped packets.
 
DupMap_t m_dups
 map of packet duplicate tuples to expiry event
 
Ipv4RoutingProtocol::ErrorCallback m_ecb
 Error callback.
 
bool m_enableDpd
 Enable multicast duplicate packet detection.
 
Time m_expire
 duplicate entry expiration delay
 
Time m_fragmentExpirationTimeout
 Expiration timeout.
 
MapFragments_t m_fragments
 Fragmented packets.
 
std::map< std::pair< uint64_t, uint8_t >, uint16_t > m_identification
 Identification (for each {src, dst, proto} tuple)
 
Ipv4InterfaceList m_interfaces
 List of IPv4 interfaces.
 
bool m_ipForward
 Forwarding packets (i.e.
 
Ipv4RoutingProtocol::LocalDeliverCallback m_lcb
 Local delivery callback.
 
TracedCallback< const Ipv4Header &, Ptr< const Packet >, uint32_tm_localDeliverTrace
 Trace of locally delivered packets.
 
Ipv4RoutingProtocol::MulticastForwardCallback m_mcb
 Multicast forward callback.
 
TracedCallback< const Ipv4Header &, Ptr< const Packet >, uint32_tm_multicastForwardTrace
 Trace of multicast forwarded packets.
 
Ptr< Nodem_node
 Node attached to stack.
 
L4List_t m_protocols
 List of transport protocol.
 
Time m_purge
 time between purging expired duplicate entries
 
Ipv4InterfaceReverseContainer m_reverseInterfacesContainer
 Container of NetDevice / Interface index associations.
 
Ptr< Ipv4RoutingProtocolm_routingProtocol
 Routing protocol associated with the stack.
 
TracedCallback< Ptr< const Packet >, Ptr< Ipv4 >, uint32_tm_rxTrace
 Trace of received packets.
 
TracedCallback< const Ipv4Header &, Ptr< const Packet >, uint32_tm_sendOutgoingTrace
 Trace of sent packets.
 
SocketList m_sockets
 List of IPv4 raw sockets.
 
EventId m_timeoutEvent
 Event for the next scheduled timeout.
 
FragmentsTimeoutsList_t m_timeoutEventList
 Timeout "events" container.
 
TracedCallback< Ptr< const Packet >, Ptr< Ipv4 >, uint32_tm_txTrace
 Trace of transmitted packets.
 
Ipv4RoutingProtocol::UnicastForwardCallback m_ucb
 Unicast forward callback.
 
TracedCallback< const Ipv4Header &, Ptr< const Packet >, uint32_tm_unicastForwardTrace
 Trace of unicast forwarded packets.
 
bool m_weakEsModel
 Weak ES model state.
 

Friends

class ::Ipv4L3ProtocolTestCase
 Ipv4L3ProtocolTestCase test case.
 

Additional Inherited Members

Detailed Description

Implement the IPv4 layer.

This is the actual implementation of IP. It contains APIs to send and receive packets at the IP layer, as well as APIs for IP routing.

This class contains two distinct groups of trace sources. The trace sources 'Rx' and 'Tx' are called, respectively, immediately after receiving from the NetDevice and immediately before sending to a NetDevice for transmitting a packet. These are low level trace sources that include the Ipv4Header already serialized into the packet. In contrast, the Drop, SendOutgoing, UnicastForward, and LocalDeliver trace sources are slightly higher-level and pass around the Ipv4Header as an explicit parameter and not as part of the packet.

IP fragmentation and reassembly is handled at this level. At the moment the fragmentation does not handle IP option headers, and in particular the ones that shall not be fragmented. Moreover, the actual implementation does not mimic exactly the Linux kernel. Hence it is not possible, for instance, to test a fragmentation attack.

Config Paths

ns3::Ipv4L3Protocol is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/$ns3::Ipv4L3Protocol"

Attributes

  • DefaultTtl: The TTL value set by default on all outgoing packets generated on this node.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint8_t 0:255
    • Initial value: 64
    • Flags: constructwriteread
  • DuplicateExpire: Expiration delay for duplicate cache entries
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +1e+06ns
    • Flags: constructwriteread
  • EnableDuplicatePacketDetection: Enable multicast duplicate packet detection based on RFC 6621
    • Set with class: ns3::BooleanValue
    • Underlying type: bool
    • Initial value: false
    • Flags: constructwriteread
  • FragmentExpirationTimeout: When this timeout expires, the fragments will be cleared from the buffer.
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +3e+10ns
    • Flags: constructwriteread
  • InterfaceList: The set of Ipv4 interfaces associated to this Ipv4 stack.
  • PurgeExpiredPeriod: Time between purges of expired duplicate packet entries, 0 means never purge
    • Set with class: ns3::TimeValue
    • Underlying type: Time +0ns:+9.22337e+18ns
    • Initial value: +1e+09ns
    • Flags: constructwriteread

Attributes defined in parent class ns3::Ipv4

  • IpForward: Globally enable or disable IP forwarding for all current and future Ipv4 devices.
    • Set with class: ns3::BooleanValue
    • Underlying type: bool
    • Initial value: true
    • Flags: constructwriteread
  • WeakEsModel: RFC1122 term for whether host accepts datagram with a dest. address on another interface
    • Set with class: ns3::BooleanValue
    • Underlying type: bool
    • Initial value: true
    • Flags: constructwriteread

TraceSources

Size of this type is 576 bytes (on a 64-bit architecture).

Definition at line 81 of file ipv4-l3-protocol.h.

Member Typedef Documentation

◆ DropTracedCallback

typedef void(* ns3::Ipv4L3Protocol::DropTracedCallback) (const Ipv4Header &header, Ptr< const Packet > packet, DropReason reason, Ptr< Ipv4 > ipv4, uint32_t interface)

TracedCallback signature for packet drop events.

Parameters
[in]headerthe Ipv4Header.
[in]packetthe packet.
[in]reasonthe reason the packet was dropped.
[in]ipv4the Ipv4 protocol
[in]interfaceIP-level interface number
Deprecated:
The non-const Ptr<Ipv4> argument is deprecated and will be changed to Ptr<const Ipv4> in a future release.

Definition at line 272 of file ipv4-l3-protocol.h.

◆ DupMap_t

typedef std::map<DupTuple_t, Time> ns3::Ipv4L3Protocol::DupMap_t
private

Maps packet duplicate tuple to expiration time.

Definition at line 614 of file ipv4-l3-protocol.h.

◆ DupTuple_t

typedef std::tuple<uint64_t, uint8_t, Ipv4Address, Ipv4Address> ns3::Ipv4L3Protocol::DupTuple_t
private

IETF RFC 6621, Section 6.2 de-duplication w/o IPSec RFC 6621 recommended duplicate packet tuple: {IPV hash, IP protocol, IP source address, IP destination address}.

Definition at line 612 of file ipv4-l3-protocol.h.

◆ FragmentKey_t

typedef std::pair<uint64_t, uint32_t> ns3::Ipv4L3Protocol::FragmentKey_t
private

Key identifying a fragmented packet.

Definition at line 502 of file ipv4-l3-protocol.h.

◆ FragmentsTimeoutsList_t

Container for fragment timeouts.

Definition at line 506 of file ipv4-l3-protocol.h.

◆ FragmentsTimeoutsListI_t

typedef std::list<std::tuple<Time,FragmentKey_t,Ipv4Header,uint32_t>>::iterator ns3::Ipv4L3Protocol::FragmentsTimeoutsListI_t
private

Container Iterator for fragment timeouts..

Definition at line 509 of file ipv4-l3-protocol.h.

◆ Ipv4InterfaceList

Container of the IPv4 Interfaces.

Definition at line 441 of file ipv4-l3-protocol.h.

◆ Ipv4InterfaceReverseContainer

Container of NetDevices registered to IPv4 and their interface indexes.

Definition at line 445 of file ipv4-l3-protocol.h.

◆ Ipv4PayloadHeaderPair

Pair of a packet and an Ipv4 header.

Definition at line 400 of file ipv4-l3-protocol.h.

◆ L4List_t

Container of the IPv4 L4 instances.

Definition at line 459 of file ipv4-l3-protocol.h.

◆ L4ListKey_t

typedef std::pair<int, int32_t> ns3::Ipv4L3Protocol::L4ListKey_t
private

Container of the IPv4 L4 keys: protocol number, interface index.

Definition at line 454 of file ipv4-l3-protocol.h.

◆ MapFragments_t

Container of fragments, stored as pairs(src+dst addr, src+dst port) / fragment.

Definition at line 604 of file ipv4-l3-protocol.h.

◆ SentTracedCallback

typedef void(* ns3::Ipv4L3Protocol::SentTracedCallback) (const Ipv4Header &header, Ptr< const Packet > packet, uint32_t interface)

TracedCallback signature for packet send, forward, or local deliver events.

Parameters
[in]headerthe Ipv4Header
[in]packetthe packet
[in]interfaceIP-level interface number

Definition at line 244 of file ipv4-l3-protocol.h.

◆ SocketList

Container of the IPv4 Raw Sockets.

Definition at line 449 of file ipv4-l3-protocol.h.

◆ TxRxTracedCallback

typedef void(* ns3::Ipv4L3Protocol::TxRxTracedCallback) (Ptr< const Packet > packet, Ptr< Ipv4 > ipv4, uint32_t interface)

TracedCallback signature for packet transmission or reception events.

Parameters
[in]packetthe packet.
[in]ipv4the Ipv4 protocol
[in]interfaceIP-level interface number
Deprecated:
The non-const Ptr<Ipv4> argument is deprecated and will be changed to Ptr<const Ipv4> in a future release.

Definition at line 257 of file ipv4-l3-protocol.h.

Member Enumeration Documentation

◆ DropReason

Reason why a packet has been dropped.

Enumerator
DROP_TTL_EXPIRED 

Packet TTL has expired.

DROP_NO_ROUTE 

No route to host.

DROP_BAD_CHECKSUM 

Bad checksum.

DROP_INTERFACE_DOWN 

Interface is down so can not send packet.

DROP_ROUTE_ERROR 

Route error.

DROP_FRAGMENT_TIMEOUT 

Fragment timeout exceeded.

DROP_DUPLICATE 

Duplicate packet received.

Definition at line 102 of file ipv4-l3-protocol.h.

Constructor & Destructor Documentation

◆ Ipv4L3Protocol() [1/2]

ns3::Ipv4L3Protocol::Ipv4L3Protocol ( )

Definition at line 133 of file ipv4-l3-protocol.cc.

References IpForward(), IpMulticastForward(), LocalDeliver(), m_ecb, m_lcb, m_mcb, m_ucb, ns3::MakeCallback(), NS_LOG_FUNCTION, and RouteInputError().

+ Here is the call graph for this function:

◆ ~Ipv4L3Protocol()

ns3::Ipv4L3Protocol::~Ipv4L3Protocol ( )
override

Definition at line 142 of file ipv4-l3-protocol.cc.

References NS_LOG_FUNCTION.

◆ Ipv4L3Protocol() [2/2]

ns3::Ipv4L3Protocol::Ipv4L3Protocol ( const Ipv4L3Protocol )
delete

Member Function Documentation

◆ AddAddress()

bool ns3::Ipv4L3Protocol::AddAddress ( uint32_t  interface,
Ipv4InterfaceAddress  address 
)
overridevirtual
Parameters
interfaceInterface number of an Ipv4 interface
addressIpv4InterfaceAddress address to associate with the underlying Ipv4 interface
Returns
true if the operation succeeded

Implements ns3::Ipv4.

Definition at line 1179 of file ipv4-l3-protocol.cc.

References NS_LOG_FUNCTION.

◆ AddInterface()

uint32_t ns3::Ipv4L3Protocol::AddInterface ( Ptr< NetDevice device)
overridevirtual
Parameters
devicedevice to add to the list of Ipv4 interfaces which can be used as output interfaces during packet forwarding.
Returns
the index of the Ipv4 interface added.

Once a device has been added, it can never be removed: if you want to disable it, you can invoke Ipv4::SetDown which will make sure that it is never used during packet forwarding.

Implements ns3::Ipv4.

Definition at line 402 of file ipv4-l3-protocol.cc.

References AddIpv4Interface(), ns3::CreateObject(), ns3::Object::GetObject(), m_ipForward, m_node, ns3::MakeCallback(), NS_ASSERT, NS_LOG_FUNCTION, ns3::PeekPointer(), ns3::ArpL3Protocol::PROT_NUMBER, PROT_NUMBER, ns3::ArpL3Protocol::Receive(), Receive(), ns3::TrafficControlLayer::Receive(), ns3::Node::RegisterProtocolHandler(), and ns3::Ipv4Interface::SetNode().

+ Here is the call graph for this function:

◆ AddIpv4Interface()

uint32_t ns3::Ipv4L3Protocol::AddIpv4Interface ( Ptr< Ipv4Interface interface)
private

Add an IPv4 interface to the stack.

Parameters
interfaceinterface to add
Returns
index of newly added interface

Definition at line 435 of file ipv4-l3-protocol.cc.

References m_interfaces, m_reverseInterfacesContainer, and NS_LOG_FUNCTION.

Referenced by AddInterface(), and SetupLoopback().

+ Here is the caller graph for this function:

◆ BuildHeader()

Ipv4Header ns3::Ipv4L3Protocol::BuildHeader ( Ipv4Address  source,
Ipv4Address  destination,
uint8_t  protocol,
uint16_t  payloadSize,
uint8_t  ttl,
uint8_t  tos,
bool  mayFragment 
)
private

Construct an IPv4 header.

Parameters
sourcesource IPv4 address
destinationdestination IPv4 address
protocolL4 protocol
payloadSizepayload size
ttlTime to Live
tosType of Service
mayFragmenttrue if the packet can be fragmented
Returns
newly created IPv4 header

Definition at line 939 of file ipv4-l3-protocol.cc.

References ns3::Node::ChecksumEnabled(), ns3::Ipv4Header::EnableChecksum(), ns3::Ipv4Address::Get(), m_identification, NS_LOG_FUNCTION, ns3::Ipv4Header::SetDestination(), ns3::Ipv4Header::SetDontFragment(), ns3::Ipv4Header::SetIdentification(), ns3::Ipv4Header::SetMayFragment(), ns3::Ipv4Header::SetPayloadSize(), ns3::Ipv4Header::SetProtocol(), ns3::Ipv4Header::SetSource(), ns3::Ipv4Header::SetTos(), and ns3::Ipv4Header::SetTtl().

Referenced by Send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallTxTrace()

void ns3::Ipv4L3Protocol::CallTxTrace ( const Ipv4Header ipHeader,
Ptr< Packet packet,
Ptr< Ipv4 ipv4,
uint32_t  interface 
)
private

Make a copy of the packet, add the header and invoke the TX trace callback.

Parameters
ipHeaderthe IP header that will be added to the packet
packetthe packet
ipv4the Ipv4 protocol
interfacethe IP-level interface index

Note: If the TracedCallback API ever is extended, we could consider to check for connected functions before adding the header

Definition at line 750 of file ipv4-l3-protocol.cc.

References m_txTrace.

◆ CreateRawSocket()

Ptr< Socket > ns3::Ipv4L3Protocol::CreateRawSocket ( )
overridevirtual

Creates a raw socket.

Returns
a smart pointer to the instantiated raw socket

Implements ns3::Ipv4.

Definition at line 256 of file ipv4-l3-protocol.cc.

References m_node, m_sockets, and NS_LOG_FUNCTION.

◆ DecreaseIdentification()

void ns3::Ipv4L3Protocol::DecreaseIdentification ( Ipv4Address  source,
Ipv4Address  destination,
uint8_t  protocol 
)
private

Decrease the identification value for a dropped or recursed packet.

Parameters
sourcesource IPv4 address
destinationdestination IPv4 address
protocolL4 protocol

Definition at line 927 of file ipv4-l3-protocol.cc.

References ns3::Ipv4Address::Get(), and m_identification.

Referenced by Send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeleteRawSocket()

void ns3::Ipv4L3Protocol::DeleteRawSocket ( Ptr< Socket socket)
overridevirtual

Deletes a particular raw socket.

Parameters
socketSmart pointer to the raw socket to be deleted

Implements ns3::Ipv4.

Definition at line 266 of file ipv4-l3-protocol.cc.

References m_sockets, and NS_LOG_FUNCTION.

◆ DoDispose()

void ns3::Ipv4L3Protocol::DoDispose ( )
overrideprotectedvirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 316 of file ipv4-l3-protocol.cc.

References ns3::EventId::Cancel(), ns3::Object::DoDispose(), ns3::EventId::IsRunning(), m_cleanDpd, m_dups, m_fragments, m_interfaces, m_node, m_protocols, m_reverseInterfacesContainer, m_routingProtocol, m_sockets, m_timeoutEvent, m_timeoutEventList, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoFragmentation()

void ns3::Ipv4L3Protocol::DoFragmentation ( Ptr< Packet packet,
const Ipv4Header ipv4Header,
uint32_t  outIfaceMtu,
std::list< Ipv4PayloadHeaderPair > &  listFragments 
)
private

Fragment a packet.

Parameters
packetthe packet
ipv4Headerthe IPv4 header
outIfaceMtuthe MTU of the interface
listFragmentsthe list of fragments

Definition at line 1479 of file ipv4-l3-protocol.cc.

References ns3::Node::ChecksumEnabled(), ns3::Ipv4Header::EnableChecksum(), ns3::Ipv4Header::GetFragmentOffset(), ns3::Ipv4Header::GetSerializedSize(), ns3::Ipv4Header::IsLastFragment(), NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Ipv4Header::SetFragmentOffset(), ns3::Ipv4Header::SetLastFragment(), ns3::Ipv4Header::SetMoreFragments(), and ns3::Ipv4Header::SetPayloadSize().

+ Here is the call graph for this function:

◆ GetAddress()

Ipv4InterfaceAddress ns3::Ipv4L3Protocol::GetAddress ( uint32_t  interface,
uint32_t  addressIndex 
) const
overridevirtual

Because addresses can be removed, the addressIndex is not guaranteed to be static across calls to this method.

Parameters
interfaceInterface number of an Ipv4 interface
addressIndexindex of Ipv4InterfaceAddress
Returns
the Ipv4InterfaceAddress associated to the interface and addressIndex

Implements ns3::Ipv4.

Definition at line 1192 of file ipv4-l3-protocol.cc.

References NS_LOG_FUNCTION.

Referenced by IsDestinationAddress(), IsUnicast(), LocalDeliver(), SelectSourceAddress(), Send(), and SourceAddressSelection().

+ Here is the caller graph for this function:

◆ GetIcmp()

Ptr< Icmpv4L4Protocol > ns3::Ipv4L3Protocol::GetIcmp ( ) const
private

Get ICMPv4 protocol.

Returns
Icmpv4L4Protocol pointer

Definition at line 687 of file ipv4-l3-protocol.cc.

References GetProtocol(), ns3::Icmpv4L4Protocol::GetStaticProtocolNumber(), and NS_LOG_FUNCTION.

Referenced by HandleFragmentsTimeout(), IpForward(), and LocalDeliver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetInterface()

Ptr< Ipv4Interface > ns3::Ipv4L3Protocol::GetInterface ( uint32_t  i) const

Get an interface.

Parameters
iinterface index
Returns
IPv4 interface pointer

Definition at line 445 of file ipv4-l3-protocol.cc.

References m_interfaces, and NS_LOG_FUNCTION.

Referenced by GetNAddresses(), GetNetDevice(), and LocalDeliver().

+ Here is the caller graph for this function:

◆ GetInterfaceForAddress()

int32_t ns3::Ipv4L3Protocol::GetInterfaceForAddress ( Ipv4Address  address) const
overridevirtual

Return the interface number of the interface that has been assigned the specified IP address.

Parameters
addressThe IP address being searched for
Returns
The interface number of the Ipv4 interface with the given address or -1 if not found.

Each IP interface has one or more IP addresses associated with it. This method searches the list of interfaces for one that holds a particular address. This call takes an IP address as a parameter and returns the interface number of the first interface that has been assigned that address, or -1 if not found. There must be an exact match; this method will not match broadcast or multicast addresses.

Implements ns3::Ipv4.

Definition at line 463 of file ipv4-l3-protocol.cc.

References m_interfaces, and NS_LOG_FUNCTION.

◆ GetInterfaceForDevice()

int32_t ns3::Ipv4L3Protocol::GetInterfaceForDevice ( Ptr< const NetDevice device) const
overridevirtual
Parameters
deviceThe NetDevice for an Ipv4Interface
Returns
The interface number of an Ipv4 interface or -1 if not found.

Implements ns3::Ipv4.

Definition at line 503 of file ipv4-l3-protocol.cc.

References m_reverseInterfacesContainer, and NS_LOG_FUNCTION.

Referenced by IpForward(), SelectSourceAddress(), and Send().

+ Here is the caller graph for this function:

◆ GetInterfaceForPrefix()

int32_t ns3::Ipv4L3Protocol::GetInterfaceForPrefix ( Ipv4Address  address,
Ipv4Mask  mask 
) const
overridevirtual

Return the interface number of first interface found that has an Ipv4 address within the prefix specified by the input address and mask parameters.

Parameters
addressThe IP address assigned to the interface of interest.
maskThe IP prefix to use in the mask
Returns
The interface number of the Ipv4 interface with the given address or -1 if not found.

Each IP interface has one or more IP addresses associated with it. This method searches the list of interfaces for the first one found that holds an address that is included within the prefix formed by the input address and mask parameters. The value -1 is returned if no match is found.

Implements ns3::Ipv4.

Definition at line 483 of file ipv4-l3-protocol.cc.

References m_interfaces, and NS_LOG_FUNCTION.

◆ GetIpForward()

bool ns3::Ipv4L3Protocol::GetIpForward ( ) const
overrideprivatevirtual

Get the IP forwarding state.

Returns
true if IP is in forwarding state

Implements ns3::Ipv4.

Definition at line 1445 of file ipv4-l3-protocol.cc.

References m_ipForward, and NS_LOG_FUNCTION.

◆ GetMetric()

uint16_t ns3::Ipv4L3Protocol::GetMetric ( uint32_t  interface) const
overridevirtual
Parameters
interfaceThe interface number of an Ipv4 interface
Returns
routing metric (cost) associated to the underlying Ipv4 interface

Implements ns3::Ipv4.

Definition at line 1345 of file ipv4-l3-protocol.cc.

References NS_LOG_FUNCTION.

◆ GetMtu()

uint16_t ns3::Ipv4L3Protocol::GetMtu ( uint32_t  interface) const
overridevirtual
Parameters
interfaceInterface number of Ipv4 interface
Returns
the Maximum Transmission Unit (in bytes) associated to the underlying Ipv4 interface

Implements ns3::Ipv4.

Definition at line 1353 of file ipv4-l3-protocol.cc.

References NS_LOG_FUNCTION.

◆ GetNAddresses()

uint32_t ns3::Ipv4L3Protocol::GetNAddresses ( uint32_t  interface) const
overridevirtual
Parameters
interfaceInterface number of an Ipv4 interface
Returns
the number of Ipv4InterfaceAddress entries for the interface.

Implements ns3::Ipv4.

Definition at line 1200 of file ipv4-l3-protocol.cc.

References GetInterface(), and NS_LOG_FUNCTION.

Referenced by IsDestinationAddress(), IsUnicast(), LocalDeliver(), SelectSourceAddress(), Send(), and SourceAddressSelection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNetDevice()

Ptr< NetDevice > ns3::Ipv4L3Protocol::GetNetDevice ( uint32_t  interface)
overridevirtual
Parameters
interfaceThe interface number of an Ipv4 interface.
Returns
The NetDevice associated with the Ipv4 interface number.

Implements ns3::Ipv4.

Definition at line 1427 of file ipv4-l3-protocol.cc.

References ns3::Ipv4Interface::GetDevice(), GetInterface(), and NS_LOG_FUNCTION.

Referenced by IpMulticastForward().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNInterfaces()

uint32_t ns3::Ipv4L3Protocol::GetNInterfaces ( ) const
overridevirtual
Returns
the number of interfaces added by the user.

Implements ns3::Ipv4.

Definition at line 456 of file ipv4-l3-protocol.cc.

References m_interfaces, and NS_LOG_FUNCTION.

Referenced by IsDestinationAddress(), IsUnicast(), and SelectSourceAddress().

+ Here is the caller graph for this function:

◆ GetProtocol() [1/2]

Ptr< IpL4Protocol > ns3::Ipv4L3Protocol::GetProtocol ( int  protocolNumber) const
overridevirtual
Parameters
protocolNumbernumber of protocol to lookup in this L4 Demux
Returns
a matching L4 Protocol

This method is typically called by lower layers to forward packets up the stack to the right protocol.

Implements ns3::Ipv4.

Definition at line 211 of file ipv4-l3-protocol.cc.

References GetProtocol(), and NS_LOG_FUNCTION.

Referenced by GetIcmp(), GetProtocol(), and LocalDeliver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetProtocol() [2/2]

Ptr< IpL4Protocol > ns3::Ipv4L3Protocol::GetProtocol ( int  protocolNumber,
int32_t  interfaceIndex 
) const
overridevirtual

Get L4 protocol by protocol number for the specified interface.

Parameters
protocolNumberprotocol number
interfaceIndexinterface index, -1 means "any" interface.
Returns
corresponding IpL4Protocol or 0 if not found

Implements ns3::Ipv4.

Definition at line 219 of file ipv4-l3-protocol.cc.

References m_protocols, and NS_LOG_FUNCTION.

◆ GetRoutingProtocol()

Ptr< Ipv4RoutingProtocol > ns3::Ipv4L3Protocol::GetRoutingProtocol ( ) const
overridevirtual

Get the routing protocol to be used by this Ipv4 stack.

Returns
smart pointer to Ipv4RoutingProtocol object, or null pointer if none

Implements ns3::Ipv4.

Definition at line 309 of file ipv4-l3-protocol.cc.

References m_routingProtocol, and NS_LOG_FUNCTION.

◆ GetTypeId()

◆ GetWeakEsModel()

bool ns3::Ipv4L3Protocol::GetWeakEsModel ( ) const
overrideprivatevirtual

Get the Weak Es Model status.

RFC1122 term for whether host accepts datagram with a dest. address on another interface

Returns
true for Weak Es Model activated

Implements ns3::Ipv4.

Definition at line 1459 of file ipv4-l3-protocol.cc.

References m_weakEsModel, and NS_LOG_FUNCTION.

Referenced by IsDestinationAddress().

+ Here is the caller graph for this function:

◆ HandleFragmentsTimeout()

void ns3::Ipv4L3Protocol::HandleFragmentsTimeout ( FragmentKey_t  key,
Ipv4Header ipHeader,
uint32_t  iif 
)
private

Process the timeout for packet fragments.

Parameters
keyrepresenting the packet fragments
ipHeaderthe IP header of the original packet
iifInput Interface

Definition at line 1760 of file ipv4-l3-protocol.cc.

References DROP_FRAGMENT_TIMEOUT, GetIcmp(), m_dropTrace, m_fragments, and NS_LOG_FUNCTION.

Referenced by HandleTimeout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleTimeout()

void ns3::Ipv4L3Protocol::HandleTimeout ( )
private

Handles a fragmented packet timeout.

Definition at line 1903 of file ipv4-l3-protocol.cc.

References HandleFragmentsTimeout(), HandleTimeout(), m_timeoutEvent, m_timeoutEventList, ns3::Simulator::Now(), and ns3::Simulator::Schedule().

Referenced by HandleTimeout(), and SetTimeout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Insert() [1/2]

void ns3::Ipv4L3Protocol::Insert ( Ptr< IpL4Protocol protocol)
overridevirtual
Parameters
protocola template for the protocol to add to this L4 Demux.

Invoke Copy on the input template to get a copy of the input protocol which can be used on the Node on which this L4 Demux is running. The new L4Protocol is registered internally as a working L4 Protocol and returned from this method. The caller does not get ownership of the returned pointer.

Implements ns3::Ipv4.

Definition at line 148 of file ipv4-l3-protocol.cc.

References m_protocols, NS_LOG_FUNCTION, and NS_LOG_WARN.

◆ Insert() [2/2]

void ns3::Ipv4L3Protocol::Insert ( Ptr< IpL4Protocol protocol,
uint32_t  interfaceIndex 
)
overridevirtual

Add a L4 protocol to a specific interface.

This may be called multiple times for multiple interfaces for the same protocol. To insert for all interfaces, use the separate Insert (Ptr<IpL4Protocol> protocol) method.

Setting a protocol on a specific interface will overwrite the previously bound protocol.

Parameters
protocolL4 protocol.
interfaceIndexinterface index.

Implements ns3::Ipv4.

Definition at line 160 of file ipv4-l3-protocol.cc.

References m_protocols, NS_LOG_FUNCTION, and NS_LOG_WARN.

◆ IpForward()

void ns3::Ipv4L3Protocol::IpForward ( Ptr< Ipv4Route rtentry,
Ptr< const Packet p,
const Ipv4Header header 
)
private

◆ IpMulticastForward()

void ns3::Ipv4L3Protocol::IpMulticastForward ( Ptr< Ipv4MulticastRoute mrtentry,
Ptr< const Packet p,
const Ipv4Header header 
)
private

Forward a multicast packet.

Parameters
mrtentryroute
ppacket to forward
headerIPv4 header to add to the packet

Definition at line 1041 of file ipv4-l3-protocol.cc.

References DROP_TTL_EXPIRED, ns3::Ipv4Address::GetAny(), ns3::Ipv4Header::GetDestination(), ns3::Node::GetId(), GetNetDevice(), ns3::Ipv4Header::GetSource(), ns3::Ipv4Header::GetTtl(), m_dropTrace, m_multicastForwardTrace, m_node, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, SendRealOut(), and ns3::Ipv4Header::SetTtl().

Referenced by Ipv4L3Protocol().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsDestinationAddress()

bool ns3::Ipv4L3Protocol::IsDestinationAddress ( Ipv4Address  address,
uint32_t  iif 
) const
overridevirtual

Determine whether address and interface corresponding to received packet can be accepted for local delivery.

Parameters
addressThe IP address being considered
iifThe incoming Ipv4 interface index
Returns
true if the address is associated with the interface index

This method can be used to determine whether a received packet has an acceptable address for local delivery on the host. The address may be a unicast, multicast, or broadcast address. This method will return true if address is an exact match of a unicast address on one of the host's interfaces (see below), if address corresponds to a multicast group that the host has joined (and the incoming device is acceptable), or if address corresponds to a broadcast address.

If the Ipv4 attribute WeakEsModel is true, the unicast address may match any of the Ipv4 addresses on any interface. If the attribute is false, the address must match one assigned to the incoming device.

Implements ns3::Ipv4.

Definition at line 517 of file ipv4-l3-protocol.cc.

References GetAddress(), ns3::Ipv4InterfaceAddress::GetBroadcast(), ns3::Ipv4InterfaceAddress::GetLocal(), GetNAddresses(), GetNInterfaces(), GetWeakEsModel(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ IsForwarding()

bool ns3::Ipv4L3Protocol::IsForwarding ( uint32_t  interface) const
overridevirtual
Parameters
interfaceInterface number of Ipv4 interface
Returns
true if IP forwarding enabled for input datagrams on this device

Implements ns3::Ipv4.

Definition at line 1410 of file ipv4-l3-protocol.cc.

References NS_LOG_FUNCTION, and NS_LOG_LOGIC.

◆ IsUnicast() [1/2]

bool ns3::Ipv4L3Protocol::IsUnicast ( Ipv4Address  ad) const

Check if an IPv4 address is unicast according to the node.

This function checks all the node's interfaces and the respective subnet masks. An address is considered unicast if it's not broadcast, subnet-broadcast or multicast.

Parameters
adaddress
Returns
true if the address is unicast

Definition at line 702 of file ipv4-l3-protocol.cc.

References GetAddress(), ns3::Ipv4InterfaceAddress::GetBroadcast(), GetNAddresses(), GetNInterfaces(), ns3::Ipv4Address::IsBroadcast(), ns3::Ipv4Address::IsMulticast(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ IsUnicast() [2/2]

bool ns3::Ipv4L3Protocol::IsUnicast ( Ipv4Address  ad,
Ipv4Mask  interfaceMask 
) const
private

Check if an IPv4 address is unicast.

Parameters
adaddress
interfaceMaskthe network mask
Returns
true if the address is unicast

Definition at line 732 of file ipv4-l3-protocol.cc.

References ns3::Ipv4Address::IsMulticast(), ns3::Ipv4Address::IsSubnetDirectedBroadcast(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ IsUp()

bool ns3::Ipv4L3Protocol::IsUp ( uint32_t  interface) const
overridevirtual
Parameters
interfaceInterface number of Ipv4 interface
Returns
true if the underlying interface is in the "up" state, false otherwise.

Implements ns3::Ipv4.

Definition at line 1361 of file ipv4-l3-protocol.cc.

References NS_LOG_FUNCTION.

◆ LocalDeliver()

◆ NotifyNewAggregate()

void ns3::Ipv4L3Protocol::NotifyNewAggregate ( )
overrideprotectedvirtual

This function will notify other components connected to the node that a new stack member is now connected This will be used to notify Layer 3 protocol of layer 4 protocol stack to connect them together.

Reimplemented from ns3::Object.

Definition at line 284 of file ipv4-l3-protocol.cc.

References m_node, ns3::Object::NotifyNewAggregate(), NS_LOG_FUNCTION, and SetNode().

+ Here is the call graph for this function:

◆ operator=()

Ipv4L3Protocol & ns3::Ipv4L3Protocol::operator= ( const Ipv4L3Protocol )
delete

◆ ProcessFragment()

bool ns3::Ipv4L3Protocol::ProcessFragment ( Ptr< Packet > &  packet,
Ipv4Header ipHeader,
uint32_t  iif 
)
private

Process a packet fragment.

Parameters
packetthe packet
ipHeaderthe IP header
iifInput Interface
Returns
true is the fragment completed the packet

Definition at line 1563 of file ipv4-l3-protocol.cc.

References ns3::Ipv4Address::Get(), ns3::Ipv4Header::GetDestination(), ns3::Ipv4Header::GetFragmentOffset(), ns3::Ipv4Header::GetIdentification(), ns3::Ipv4Header::GetProtocol(), ns3::Ipv4Header::GetSource(), ns3::Ipv4Header::IsLastFragment(), m_fragments, m_timeoutEventList, NS_LOG_FUNCTION, NS_LOG_LOGIC, and SetTimeout().

Referenced by LocalDeliver().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Receive()

void ns3::Ipv4L3Protocol::Receive ( Ptr< NetDevice device,
Ptr< const Packet p,
uint16_t  protocol,
const Address from,
const Address to,
NetDevice::PacketType  packetType 
)

Lower layer calls this method after calling L3Demux::Lookup The ARP subclass needs to know from which NetDevice this packet is coming to:

  • implement a per-NetDevice ARP cache
  • send back arp replies on the right device
    Parameters
    devicenetwork device
    pthe packet
    protocolprotocol value
    fromaddress of the correspondent
    toaddress of the destination
    packetTypetype of the packet

Definition at line 583 of file ipv4-l3-protocol.cc.

References ns3::Ipv4Header::EnableChecksum(), ns3::Ipv4Header::GetDestination(), ns3::Node::GetId(), ns3::Ipv4Header::GetPayloadSize(), ns3::Ipv4Header::GetSource(), ns3::ArpCache::Entry::IsAlive(), ns3::Ipv4Header::IsChecksumOk(), ns3::Ipv4Address::IsMulticast(), m_node, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, and ns3::ArpCache::Entry::UpdateSeen().

Referenced by AddInterface(), and SetupLoopback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Remove() [1/2]

void ns3::Ipv4L3Protocol::Remove ( Ptr< IpL4Protocol protocol)
overridevirtual
Parameters
protocolprotocol to remove from this demux.

The input value to this method should be the value returned from the Ipv4L4Protocol::Insert method.

Implements ns3::Ipv4.

Definition at line 174 of file ipv4-l3-protocol.cc.

References m_protocols, NS_LOG_FUNCTION, and NS_LOG_WARN.

◆ Remove() [2/2]

void ns3::Ipv4L3Protocol::Remove ( Ptr< IpL4Protocol protocol,
uint32_t  interfaceIndex 
)
overridevirtual

Remove a L4 protocol from a specific interface.

Parameters
protocolL4 protocol to remove.
interfaceIndexinterface index.

Implements ns3::Ipv4.

Definition at line 192 of file ipv4-l3-protocol.cc.

References m_protocols, NS_LOG_FUNCTION, and NS_LOG_WARN.

◆ RemoveAddress() [1/2]

bool ns3::Ipv4L3Protocol::RemoveAddress ( uint32_t  interface,
Ipv4Address  address 
)
overridevirtual

Remove the given address on named Ipv4 interface.

Parameters
interfaceInterface number of an Ipv4 interface
addressThe address to remove
Returns
true if the operation succeeded

Implements ns3::Ipv4.

Definition at line 1225 of file ipv4-l3-protocol.cc.

References ns3::Ipv4Address::GetLoopback(), NS_LOG_FUNCTION, and NS_LOG_WARN.

+ Here is the call graph for this function:

◆ RemoveAddress() [2/2]

bool ns3::Ipv4L3Protocol::RemoveAddress ( uint32_t  interface,
uint32_t  addressIndex 
)
overridevirtual

Remove the address at addressIndex on named interface.

The addressIndex for all higher indices will decrement by one after this method is called; so, for example, to remove 5 addresses from an interface i, one could call RemoveAddress (i, 0); 5 times.

Parameters
interfaceInterface number of an Ipv4 interface
addressIndexindex of Ipv4InterfaceAddress to remove
Returns
true if the operation succeeded

Implements ns3::Ipv4.

Definition at line 1208 of file ipv4-l3-protocol.cc.

References NS_LOG_FUNCTION.

◆ RemoveDuplicates()

void ns3::Ipv4L3Protocol::RemoveDuplicates ( )
private

Remove expired duplicates packet entry.

Definition at line 1852 of file ipv4-l3-protocol.cc.

References ns3::Time::IsStrictlyPositive(), m_cleanDpd, m_dups, m_purge, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, RemoveDuplicates(), and ns3::Simulator::Schedule().

Referenced by RemoveDuplicates(), and UpdateDuplicate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RouteInputError()

void ns3::Ipv4L3Protocol::RouteInputError ( Ptr< const Packet p,
const Ipv4Header ipHeader,
Socket::SocketErrno  sockErrno 
)
private

Fallback when no route is found.

Parameters
ppacket
ipHeaderIPv4 header
sockErrnoerror number

Definition at line 1466 of file ipv4-l3-protocol.cc.

References DROP_ROUTE_ERROR, m_dropTrace, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by Ipv4L3Protocol().

+ Here is the caller graph for this function:

◆ SelectSourceAddress()

Ipv4Address ns3::Ipv4L3Protocol::SelectSourceAddress ( Ptr< const NetDevice device,
Ipv4Address  dst,
Ipv4InterfaceAddress::InterfaceAddressScope_e  scope 
)
overridevirtual

Return the first primary source address with scope less than or equal to the requested scope, to use in sending a packet to destination dst out of the specified device.

This method mirrors the behavior of Linux inet_select_addr() and is provided because interfaces may have multiple IP addresses configured on them with different scopes, and with a primary and secondary status. Secondary addresses are never returned.

See also
Ipv4InterfaceAddress

If a non-zero device pointer is provided, the method first tries to return a primary address that is configured on that device, and whose subnet matches that of dst and whose scope is less than or equal to the requested scope. If a primary address does not match the subnet of dst but otherwise matches the scope, it is returned. If no such address on the device is found, the other devices are searched in order of their interface index, but not considering dst as a factor in the search. Because a loopback interface is typically the first one configured on a node, it will be the first alternate device to be tried. Addresses scoped at LINK scope are not returned in this phase.

If no device pointer is provided, the same logic as above applies, only that there is no preferred device that is consulted first. This means that if the device pointer is null, input parameter dst will be ignored.

If there are no possible addresses to return, a warning log message is issued and the all-zeroes address is returned.

Parameters
deviceoutput NetDevice (optionally provided, only to constrain the search)
dstDestination address to match, if device is provided
scopeScope of returned address must be less than or equal to this
Returns
the first primary Ipv4Address that meets the search criteria

Implements ns3::Ipv4.

Definition at line 1275 of file ipv4-l3-protocol.cc.

References ns3::Ipv4Address::CombineMask(), GetAddress(), GetInterfaceForDevice(), ns3::Ipv4InterfaceAddress::GetLocal(), ns3::Ipv4InterfaceAddress::GetMask(), GetNAddresses(), GetNInterfaces(), ns3::Ipv4InterfaceAddress::GetScope(), ns3::Ipv4InterfaceAddress::IsSecondary(), ns3::Ipv4InterfaceAddress::LINK, NS_ASSERT_MSG, NS_LOG_FUNCTION, and NS_LOG_WARN.

+ Here is the call graph for this function:

◆ Send()

void ns3::Ipv4L3Protocol::Send ( Ptr< Packet packet,
Ipv4Address  source,
Ipv4Address  destination,
uint8_t  protocol,
Ptr< Ipv4Route route 
)
overridevirtual

◆ SendRealOut()

void ns3::Ipv4L3Protocol::SendRealOut ( Ptr< Ipv4Route route,
Ptr< Packet packet,
const Ipv4Header ipHeader 
)
private

Send packet with route.

Parameters
routeroute
packetpacket to send
ipHeaderIPv4 header to add to the packet

Definition at line 986 of file ipv4-l3-protocol.cc.

References DROP_NO_ROUTE, ns3::Ipv4Header::GetDestination(), ns3::Ipv4Header::GetSerializedSize(), m_dropTrace, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, and NS_LOG_WARN.

Referenced by IpForward(), IpMulticastForward(), Send(), and SendWithHeader().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendWithHeader()

void ns3::Ipv4L3Protocol::SendWithHeader ( Ptr< Packet packet,
Ipv4Header  ipHeader,
Ptr< Ipv4Route route 
)
overridevirtual
Parameters
packetpacket to send
ipHeaderIP Header
routeroute entry

Higher-level layers call this method to send a packet with IPv4 Header (Intend to be used with IpHeaderInclude attribute.)

Implements ns3::Ipv4.

Definition at line 739 of file ipv4-l3-protocol.cc.

References ns3::Node::ChecksumEnabled(), ns3::Ipv4Header::EnableChecksum(), NS_LOG_FUNCTION, and SendRealOut().

+ Here is the call graph for this function:

◆ SetDefaultTtl()

void ns3::Ipv4L3Protocol::SetDefaultTtl ( uint8_t  ttl)
Parameters
ttldefault ttl to use

When we need to send an ipv4 packet, we use this default ttl value.

Definition at line 395 of file ipv4-l3-protocol.cc.

References m_defaultTtl, and NS_LOG_FUNCTION.

◆ SetDown()

void ns3::Ipv4L3Protocol::SetDown ( uint32_t  interface)
overridevirtual
Parameters
interfaceInterface number of Ipv4 interface

Set the interface into the "down" state. In this state, it is ignored during Ipv4 forwarding.

Implements ns3::Ipv4.

Definition at line 1397 of file ipv4-l3-protocol.cc.

References NS_LOG_FUNCTION.

◆ SetForwarding()

void ns3::Ipv4L3Protocol::SetForwarding ( uint32_t  interface,
bool  val 
)
overridevirtual
Parameters
interfaceInterface number of Ipv4 interface
valValue to set the forwarding flag

If set to true, IP forwarding is enabled for input datagrams on this device

Implements ns3::Ipv4.

Definition at line 1419 of file ipv4-l3-protocol.cc.

References NS_LOG_FUNCTION.

◆ SetIpForward()

void ns3::Ipv4L3Protocol::SetIpForward ( bool  forward)
overrideprivatevirtual

Set or unset the IP forwarding state.

Parameters
forwardthe forwarding state

Implements ns3::Ipv4.

Definition at line 1434 of file ipv4-l3-protocol.cc.

References m_interfaces, m_ipForward, and NS_LOG_FUNCTION.

◆ SetMetric()

void ns3::Ipv4L3Protocol::SetMetric ( uint32_t  interface,
uint16_t  metric 
)
overridevirtual
Parameters
interfaceThe interface number of an Ipv4 interface
metricrouting metric (cost) associated to the underlying Ipv4 interface

Implements ns3::Ipv4.

Definition at line 1337 of file ipv4-l3-protocol.cc.

References NS_LOG_FUNCTION.

◆ SetNode()

void ns3::Ipv4L3Protocol::SetNode ( Ptr< Node node)

Set node associated with this stack.

Parameters
nodenode to set

Definition at line 247 of file ipv4-l3-protocol.cc.

References m_node, NS_LOG_FUNCTION, and SetupLoopback().

Referenced by NotifyNewAggregate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetRoutingProtocol()

void ns3::Ipv4L3Protocol::SetRoutingProtocol ( Ptr< Ipv4RoutingProtocol routingProtocol)
overridevirtual

Register a new routing protocol to be used by this Ipv4 stack.

This call will replace any routing protocol that has been previously registered. If you want to add multiple routing protocols, you must add them to a Ipv4ListRoutingProtocol directly.

Parameters
routingProtocolsmart pointer to Ipv4RoutingProtocol object

Implements ns3::Ipv4.

Definition at line 301 of file ipv4-l3-protocol.cc.

References m_routingProtocol, and NS_LOG_FUNCTION.

◆ SetTimeout()

Ipv4L3Protocol::FragmentsTimeoutsListI_t ns3::Ipv4L3Protocol::SetTimeout ( FragmentKey_t  key,
Ipv4Header  ipHeader,
uint32_t  iif 
)
private

Set a new timeout "event" for a fragmented packet.

Parameters
keythe fragment identification
ipHeaderthe IPv4 header of the fragmented packet
iifinput interface of the packet
Returns
an iterator to the inserted "event"

Definition at line 1886 of file ipv4-l3-protocol.cc.

References HandleTimeout(), m_fragmentExpirationTimeout, m_timeoutEvent, m_timeoutEventList, ns3::Simulator::Now(), and ns3::Simulator::Schedule().

Referenced by ProcessFragment().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetUp()

void ns3::Ipv4L3Protocol::SetUp ( uint32_t  interface)
overridevirtual
Parameters
interfaceInterface number of Ipv4 interface

Set the interface into the "up" state. In this state, it is considered valid during Ipv4 forwarding.

Implements ns3::Ipv4.

Definition at line 1369 of file ipv4-l3-protocol.cc.

References NS_LOG_FUNCTION, and NS_LOG_LOGIC.

◆ SetupLoopback()

void ns3::Ipv4L3Protocol::SetupLoopback ( )
private

Setup loopback interface.

Definition at line 358 of file ipv4-l3-protocol.cc.

References ns3::Node::AddDevice(), AddIpv4Interface(), ns3::CreateObject(), ns3::Node::GetDevice(), ns3::Ipv4Address::GetLoopback(), ns3::Ipv4Mask::GetLoopback(), ns3::Node::GetNDevices(), m_node, m_routingProtocol, ns3::MakeCallback(), NS_LOG_FUNCTION, PROT_NUMBER, and Receive().

Referenced by SetNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetWeakEsModel()

void ns3::Ipv4L3Protocol::SetWeakEsModel ( bool  model)
overrideprivatevirtual

Set or unset the Weak Es Model.

RFC1122 term for whether host accepts datagram with a dest. address on another interface

Parameters
modeltrue for Weak Es Model

Implements ns3::Ipv4.

Definition at line 1452 of file ipv4-l3-protocol.cc.

References m_weakEsModel, and NS_LOG_FUNCTION.

◆ SourceAddressSelection()

Ipv4Address ns3::Ipv4L3Protocol::SourceAddressSelection ( uint32_t  interface,
Ipv4Address  dest 
)
overridevirtual

Choose the source address to use with destination address.

Parameters
interfaceinterface index
destIPv4 destination address
Returns
IPv4 source address to use

Implements ns3::Ipv4.

Definition at line 1248 of file ipv4-l3-protocol.cc.

References ns3::Ipv4Address::CombineMask(), GetAddress(), ns3::Ipv4InterfaceAddress::GetLocal(), GetNAddresses(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ UpdateDuplicate()

bool ns3::Ipv4L3Protocol::UpdateDuplicate ( Ptr< const Packet p,
const Ipv4Header header 
)
private

Registers duplicate entry, return false if new.

Parameters
[in]pPossibly duplicate packet.
[in]headerPacket p header.
Returns
True if this packet is a duplicate

Definition at line 1782 of file ipv4-l3-protocol.cc.

References ns3::Ipv4Header::GetDestination(), ns3::Ipv4Header::GetFragmentOffset(), ns3::Ipv4Header::GetIdentification(), ns3::Ipv4Header::GetProtocol(), ns3::Ipv4Header::GetSerializedSize(), ns3::Ipv4Header::GetSource(), ns3::Hash32(), ns3::Ipv4Header::IsLastFragment(), ns3::EventId::IsRunning(), ns3::Time::IsStrictlyPositive(), m_cleanDpd, m_dups, m_expire, m_purge, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, RemoveDuplicates(), ns3::Simulator::Schedule(), and ns3::Seconds().

Referenced by Send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ ::Ipv4L3ProtocolTestCase

friend class ::Ipv4L3ProtocolTestCase
friend

Ipv4L3ProtocolTestCase test case.

Definition at line 292 of file ipv4-l3-protocol.h.

Member Data Documentation

◆ m_cleanDpd

EventId ns3::Ipv4L3Protocol::m_cleanDpd
private

event to cleanup expired duplicate entries

Definition at line 632 of file ipv4-l3-protocol.h.

Referenced by DoDispose(), RemoveDuplicates(), and UpdateDuplicate().

◆ m_defaultTtl

uint8_t ns3::Ipv4L3Protocol::m_defaultTtl
private

Default TTL.

Definition at line 467 of file ipv4-l3-protocol.h.

Referenced by GetTypeId(), Send(), and SetDefaultTtl().

◆ m_dropTrace

TracedCallback<const Ipv4Header&, Ptr<const Packet>, DropReason, Ptr<Ipv4>, uint32_t> ns3::Ipv4L3Protocol::m_dropTrace
private

Trace of dropped packets.

Deprecated:
The non-const Ptr<Ipv4> argument is deprecated and will be changed to Ptr<const Ipv4> in a future release.

Definition at line 495 of file ipv4-l3-protocol.h.

Referenced by GetTypeId(), HandleFragmentsTimeout(), IpForward(), IpMulticastForward(), RouteInputError(), Send(), and SendRealOut().

◆ m_dups

DupMap_t ns3::Ipv4L3Protocol::m_dups
private

map of packet duplicate tuples to expiry event

Definition at line 629 of file ipv4-l3-protocol.h.

Referenced by DoDispose(), RemoveDuplicates(), and UpdateDuplicate().

◆ m_ecb

Ipv4RoutingProtocol::ErrorCallback ns3::Ipv4L3Protocol::m_ecb
private

Error callback.

Definition at line 637 of file ipv4-l3-protocol.h.

Referenced by Ipv4L3Protocol().

◆ m_enableDpd

bool ns3::Ipv4L3Protocol::m_enableDpd
private

Enable multicast duplicate packet detection.

Definition at line 628 of file ipv4-l3-protocol.h.

Referenced by GetTypeId(), and Send().

◆ m_expire

Time ns3::Ipv4L3Protocol::m_expire
private

duplicate entry expiration delay

Definition at line 630 of file ipv4-l3-protocol.h.

Referenced by GetTypeId(), and UpdateDuplicate().

◆ m_fragmentExpirationTimeout

Time ns3::Ipv4L3Protocol::m_fragmentExpirationTimeout
private

Expiration timeout.

Definition at line 607 of file ipv4-l3-protocol.h.

Referenced by GetTypeId(), and SetTimeout().

◆ m_fragments

◆ m_identification

std::map<std::pair<uint64_t, uint8_t>, uint16_t> ns3::Ipv4L3Protocol::m_identification
private

Identification (for each {src, dst, proto} tuple)

Definition at line 469 of file ipv4-l3-protocol.h.

Referenced by BuildHeader(), and DecreaseIdentification().

◆ m_interfaces

Ipv4InterfaceList ns3::Ipv4L3Protocol::m_interfaces
private

◆ m_ipForward

bool ns3::Ipv4L3Protocol::m_ipForward
private

Forwarding packets (i.e.

router mode) state.

Definition at line 461 of file ipv4-l3-protocol.h.

Referenced by AddInterface(), GetIpForward(), and SetIpForward().

◆ m_lcb

Ipv4RoutingProtocol::LocalDeliverCallback ns3::Ipv4L3Protocol::m_lcb
private

Local delivery callback.

Definition at line 636 of file ipv4-l3-protocol.h.

Referenced by Ipv4L3Protocol().

◆ m_localDeliverTrace

TracedCallback<const Ipv4Header&, Ptr<const Packet>, uint32_t> ns3::Ipv4L3Protocol::m_localDeliverTrace
private

Trace of locally delivered packets.

Definition at line 479 of file ipv4-l3-protocol.h.

Referenced by GetTypeId(), and LocalDeliver().

◆ m_mcb

Ipv4RoutingProtocol::MulticastForwardCallback ns3::Ipv4L3Protocol::m_mcb
private

Multicast forward callback.

Definition at line 635 of file ipv4-l3-protocol.h.

Referenced by Ipv4L3Protocol().

◆ m_multicastForwardTrace

TracedCallback<const Ipv4Header&, Ptr<const Packet>, uint32_t> ns3::Ipv4L3Protocol::m_multicastForwardTrace
private

Trace of multicast forwarded packets.

Definition at line 477 of file ipv4-l3-protocol.h.

Referenced by GetTypeId(), and IpMulticastForward().

◆ m_node

Ptr<Node> ns3::Ipv4L3Protocol::m_node
private

◆ m_protocols

L4List_t ns3::Ipv4L3Protocol::m_protocols
private

List of transport protocol.

Definition at line 463 of file ipv4-l3-protocol.h.

Referenced by DoDispose(), GetProtocol(), Insert(), and Remove().

◆ m_purge

Time ns3::Ipv4L3Protocol::m_purge
private

time between purging expired duplicate entries

Definition at line 631 of file ipv4-l3-protocol.h.

Referenced by GetTypeId(), RemoveDuplicates(), and UpdateDuplicate().

◆ m_reverseInterfacesContainer

Ipv4InterfaceReverseContainer ns3::Ipv4L3Protocol::m_reverseInterfacesContainer
private

Container of NetDevice / Interface index associations.

Definition at line 466 of file ipv4-l3-protocol.h.

Referenced by AddIpv4Interface(), DoDispose(), and GetInterfaceForDevice().

◆ m_routingProtocol

Ptr<Ipv4RoutingProtocol> ns3::Ipv4L3Protocol::m_routingProtocol
private

Routing protocol associated with the stack.

Definition at line 497 of file ipv4-l3-protocol.h.

Referenced by DoDispose(), GetRoutingProtocol(), Send(), SetRoutingProtocol(), and SetupLoopback().

◆ m_rxTrace

TracedCallback<Ptr<const Packet>, Ptr<Ipv4>, uint32_t> ns3::Ipv4L3Protocol::m_rxTrace
private

Trace of received packets.

Deprecated:
The non-const Ptr<Ipv4> argument is deprecated and will be changed to Ptr<const Ipv4> in a future release.

Definition at line 489 of file ipv4-l3-protocol.h.

Referenced by GetTypeId().

◆ m_sendOutgoingTrace

TracedCallback<const Ipv4Header&, Ptr<const Packet>, uint32_t> ns3::Ipv4L3Protocol::m_sendOutgoingTrace
private

Trace of sent packets.

Definition at line 473 of file ipv4-l3-protocol.h.

Referenced by GetTypeId(), and Send().

◆ m_sockets

SocketList ns3::Ipv4L3Protocol::m_sockets
private

List of IPv4 raw sockets.

Definition at line 499 of file ipv4-l3-protocol.h.

Referenced by CreateRawSocket(), DeleteRawSocket(), and DoDispose().

◆ m_timeoutEvent

EventId ns3::Ipv4L3Protocol::m_timeoutEvent
private

Event for the next scheduled timeout.

Definition at line 535 of file ipv4-l3-protocol.h.

Referenced by DoDispose(), HandleTimeout(), and SetTimeout().

◆ m_timeoutEventList

FragmentsTimeoutsList_t ns3::Ipv4L3Protocol::m_timeoutEventList
private

Timeout "events" container.

Definition at line 533 of file ipv4-l3-protocol.h.

Referenced by DoDispose(), HandleTimeout(), ProcessFragment(), and SetTimeout().

◆ m_txTrace

TracedCallback<Ptr<const Packet>, Ptr<Ipv4>, uint32_t> ns3::Ipv4L3Protocol::m_txTrace
private

Trace of transmitted packets.

Deprecated:
The non-const Ptr<Ipv4> argument is deprecated and will be changed to Ptr<const Ipv4> in a future release.

Definition at line 485 of file ipv4-l3-protocol.h.

Referenced by CallTxTrace(), and GetTypeId().

◆ m_ucb

Ipv4RoutingProtocol::UnicastForwardCallback ns3::Ipv4L3Protocol::m_ucb
private

Unicast forward callback.

Definition at line 634 of file ipv4-l3-protocol.h.

Referenced by Ipv4L3Protocol().

◆ m_unicastForwardTrace

TracedCallback<const Ipv4Header&, Ptr<const Packet>, uint32_t> ns3::Ipv4L3Protocol::m_unicastForwardTrace
private

Trace of unicast forwarded packets.

Definition at line 475 of file ipv4-l3-protocol.h.

Referenced by GetTypeId(), and IpForward().

◆ m_weakEsModel

bool ns3::Ipv4L3Protocol::m_weakEsModel
private

Weak ES model state.

Definition at line 462 of file ipv4-l3-protocol.h.

Referenced by GetWeakEsModel(), and SetWeakEsModel().

◆ PROT_NUMBER


The documentation for this class was generated from the following files: