ns3::Ipv4L3Protocol Class Reference

Implement the Ipv4 layer. More...

#include <ipv4-l3-protocol.h>

Inherits ns3::Ipv4.

Collaboration diagram for ns3::Ipv4L3Protocol:

Collaboration graph

List of all members.

Public Member Functions

void Insert (Ptr< Ipv4L4Protocol > protocol)
Ptr< Ipv4L4ProtocolGetProtocol (int protocolNumber) const
void Remove (Ptr< Ipv4L4Protocol > protocol)
void SetDefaultTtl (uint8_t ttl)
void Receive (Ptr< NetDevice > device, Ptr< const Packet > p, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType)
void Send (Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, uint8_t protocol, Ptr< Ipv4Route > route)

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::Ipv4L3Protocol.

Protected Member Functions

virtual void DoDispose (void)
virtual void NotifyNewAggregate ()

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.

Member Function Documentation

virtual void ns3::Ipv4L3Protocol::DoDispose ( void   )  [protected, virtual]

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

Subclasses are expected to implement their real destruction code in an overriden 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.

Reimplemented from ns3::Object.

Ptr<Ipv4L4Protocol> ns3::Ipv4L3Protocol::GetProtocol ( int  protocolNumber  )  const

protocolNumber number of protocol to lookup in this L4 Demux
a matching L4 Protocol
This method is typically called by lower layers to forward packets up the stack to the right protocol. It is also called from NodeImpl::GetUdp for example.

static TypeId ns3::Ipv4L3Protocol::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::Ipv4L3Protocol.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/$ns3::Ipv4L3Protocol
Attributes defined for this type:
  • DefaultTtl: The TTL value set by default on all outgoing packets generated on this node.
  • InterfaceList: The set of Ipv4 interfaces associated to this Ipv4 stack.
Attributes defined in parent class ns3::Ipv4:
  • IpForward: Globally enable or disable IP forwarding for all current and future Ipv4 devices.
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: true
    • Flags: construct write read
TraceSources defined for this type:
  • Tx: Send ipv4 packet to outgoing interface.
  • Rx: Receive ipv4 packet from incoming interface.
  • Drop: Drop ipv4 packet

Reimplemented from ns3::Object.

void ns3::Ipv4L3Protocol::Insert ( Ptr< Ipv4L4Protocol protocol  ) 

protocol a template for the protocol to add to this L4 Demux.
the L4Protocol effectively added.
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.

virtual void ns3::Ipv4L3Protocol::NotifyNewAggregate (  )  [protected, virtual]

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.

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

void ns3::Ipv4L3Protocol::Remove ( Ptr< Ipv4L4Protocol protocol  ) 

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

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

packet packet to send
source source address of packet
destination address of packet
protocol number of packet
route route entry
Higher-level layers call this method to send a packet down the stack to the MAC and PHY layers.

void ns3::Ipv4L3Protocol::SetDefaultTtl ( uint8_t  ttl  ) 

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

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

Generated on Fri Apr 9 15:01:10 2010 for NS-3 by  doxygen 1.5.8