Ipv6

Package: inet.networklayer.ipv6

Ipv6

simple module

Implements the IPv6 protocol.

The IPv6 protocol header is represented by the Ipv6Header message class.

Interfacing with higher layer protocols

To send a packet over IPv6 from a higher layer protocol, the module should fill in an L3AddressReq object, attach it to the packet with Packet's addTag() method, then send the packet to the Ipv6 module.

When Ipv6 sends up a packet to a higher layer protocol, it will also attach an L3AddressInd to the packet, with the source and destination IPv6 addresses of the Ipv6Header in which the packet arrived.

Ipv6 can serve several higher-layer protocols. The higher layer protocols should call registerProtocol with their gate towards the IPv6 module, for fill up the protocol-to-gateindex map. When delivering packets to them, the output gate is determined from the Protocol field in the IPv6 header.

Routing and interfacing with lower layers

The routing table is stored in the module Ipv6RoutingTable. When a datagram needs to be routed, Ipv6 queries Ipv6RoutingTable for the output interface (or "port") and next hop address of the packet. This is done by directly calling C++ methods of Ipv6RoutingTable. No message exchange with Ipv6RoutingTable takes place.

Routing protocol implementations can also query and manipulate the route table by calling Ipv6RoutingTable's methods in C++.

Performance model, QoS

In the current form, Ipv6 contains a FIFO which queues up IPv6 frames; these are processed in order. The processing time is determined by the procDelay module parameter.

See also: Ipv6RoutingTable, Ipv6NeighbourDiscovery, Icmpv6

Used in compound modules

Name Type Description
Ipv6NetworkLayer compound module

Represents an IPv6 network layer (L3).

Parameters

Name Type Default value Description
interfaceTableModule string

The path to the InterfaceTable module

routingTableModule string
ipv6NeighbourDiscoveryModule string
icmpv6Module string
ipv6TunnelingModule string
procDelay double 0s

Properties

Name Value Description
display i=block/network2

Gates

Name Direction Size Description
transportIn input
transportOut output
queueIn input
queueOut output
ndIn input
ndOut output
upperTunnelingIn input

tunneling gates - CB

upperTunnelingOut output
lowerTunnelingIn input
lowerTunnelingOut output
xMIPv6In input

the following gates are added by Zarrar Yousaf on 19.06.07

xMIPv6Out output

Signals

Name Type Unit
packetReceivedFromUpper inet::Packet
packetReceivedFromLower inet::Packet
packetDropped inet::Packet
packetSentToLower inet::Packet
packetSentToUpper inet::Packet

Direct method calls (observed)

call tofunctioninfo
MessageDispatcherinet::MessageDispatcher::arrivedarrived
MessageDispatcherinet::MessageDispatcher::handleRegisterProtocolhandleRegisterProtocol
MessageDispatcherinet::MessageDispatcher::handleRegisterServicehandleRegisterService
Ipv6NeighbourDiscoveryinet::Ipv6NeighbourDiscovery::resolveNeighbourresolveNeighbor(%s,if=%d)
Ipv6RoutingTableinet::Ipv6RoutingTable::doLongestPrefixMatchdoLongestPrefixMatch(%s)
Ipv6RoutingTableinet::Ipv6RoutingTable::getInterfaceByAddressgetInterfaceByAddress(%s)=?
Ipv6RoutingTableinet::Ipv6RoutingTable::isLocalAddressisLocalAddress(%s)
Ipv6RoutingTableinet::Ipv6RoutingTable::lookupDestCachelookupDestCache(%s)
Dymoinet::dymo::Dymo::datagramLocalOutHookdatagramLocalOutHook
Dymoinet::dymo::Dymo::datagramPreRoutingHookdatagramPreRoutingHook
Gpsrinet::Gpsr::datagramLocalOutHookdatagramLocalOutHook
Gpsrinet::Gpsr::datagramPreRoutingHookdatagramPreRoutingHook
TcpCrcInsertionHookinet::tcp::TcpCrcInsertionHook::datagramPostRoutingHookdatagramPostRoutingHook
UdpCrcInsertionHookinet::UdpCrcInsertionHook::datagramPostRoutingHookdatagramPostRoutingHook

Called methods (observed)

functioninfocall from
inet::Ipv6::handleRegisterProtocolhandleRegisterProtocolMessageDispatcher
inet::Ipv6::handleRegisterServicehandleRegisterServiceMessageDispatcher
inet::Ipv6::registerHookregisterHook()Dymo, Gpsr, Tcp, Udp

Incoming messages (observed)

gatemsgkindctrlsrcModuletags
ndInPacket0Ipv6NeighbourDiscoveryHopLimitReq, InterfaceReq, L3AddressReq, PacketProtocolTag
ndInPacket0Ipv6NdControlInfoIpv6NeighbourDiscoveryDispatchProtocolReq, NetworkProtocolInd, PacketProtocolTag, InterfaceInd?, MacAddressInd?, TransportProtocolInd?
queueInPacket0EthernetEncapsulationDispatchProtocolReq, InterfaceInd, MacAddressInd, PacketProtocolTag
queueInPacket0Ieee80211LlcLpdDispatchProtocolReq, ErrorRateInd, Ieee802SapInd, InterfaceInd, MacAddressInd, PacketProtocolTag, SignalPowerInd, SignalTimeInd, SnirInd, Ieee80211ChannelInd, Ieee80211ModeInd
queueInPacket0PppDispatchProtocolReq, InterfaceInd, PacketProtocolTag
transportInPacket0PingAppDispatchProtocolReq, L3AddressReq, PacketProtocolTag, SocketReq
transportInPacket0Icmpv6DispatchProtocolReq, L3AddressReq, PacketProtocolTag
transportInPacket0DymoDispatchProtocolReq, HopLimitReq, L3AddressReq, PacketProtocolTag
transportInPacket0EigrpSplitterDispatchProtocolReq, HopLimitReq, InterfaceReq, L3AddressReq, PacketProtocolTag
transportInPacket0GpsrDispatchProtocolReq, HopLimitReq, L3AddressReq, PacketProtocolTag
transportInPacket0Ospfv3SplitterDispatchProtocolReq, HopLimitReq, InterfaceReq, L3AddressReq, PacketProtocolTag
transportInPacket0SctpDispatchProtocolReq, L3AddressReq, PacketProtocolTag, SocketReq, TransportProtocolInd
transportInPacket0TcpDispatchProtocolReq, EcnReq, L3AddressReq, PacketProtocolTag, TransportProtocolInd
transportInPacket0TcpLwipDispatchProtocolReq, L3AddressReq, PacketProtocolTag, TransportProtocolInd
transportInPacket0UdpDispatchProtocolReq, L3AddressReq, MulticastReq, PacketProtocolTag, TransportProtocolInd, HopLimitReq?, InterfaceReq?
transportInRequest1Ipv6SocketBindCommandPingAppDispatchProtocolReq, SocketReq

Outgoing messages (observed)

gatemsgkindctrldestModuletags
ndOutPacket0Ipv6NeighbourDiscoveryDispatchProtocolInd, DispatchProtocolReq, DscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, NetworkProtocolInd, PacketProtocolTag, TosInd, ErrorRateInd?, Ieee802SapInd?, MacAddressInd?, SignalPowerInd?, SignalTimeInd?, SnirInd?, Ieee80211ChannelInd?, Ieee80211ModeInd?
ndOutPacket0Ipv6NdControlInfoIpv6NeighbourDiscoveryDispatchProtocolReq, NetworkProtocolInd, PacketProtocolTag, InterfaceInd?, MacAddressInd?, MulticastReq?, SocketReq?, TransportProtocolInd?
queueOutPacket0EthernetEncapsulationDispatchProtocolInd, DispatchProtocolReq, InterfaceReq, MacAddressReq, NetworkProtocolInd, PacketProtocolTag, InterfaceInd?, MacAddressInd?, MulticastReq?, TransportProtocolInd?
queueOutPacket0Ieee80211LlcLpdDispatchProtocolInd, InterfaceReq, MacAddressReq, NetworkProtocolInd, PacketProtocolTag
queueOutPacket0DropTailQueueDispatchProtocolInd, InterfaceReq, MacAddressReq, NetworkProtocolInd, PacketProtocolTag, InterfaceInd?, MacAddressInd?, MulticastReq?, SocketReq?, TransportProtocolInd?
transportOutPacket0PingAppDispatchProtocolInd, DispatchProtocolReq, DscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, MacAddressInd, NetworkProtocolInd, PacketProtocolTag, SocketInd, TosInd, ErrorRateInd?, Ieee802SapInd?, SignalPowerInd?, SignalTimeInd?, SnirInd?, Ieee80211ChannelInd?, Ieee80211ModeInd?
transportOutPacket0Icmpv6DispatchProtocolInd, DispatchProtocolReq, DscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, NetworkProtocolInd, PacketProtocolTag, TosInd
transportOutPacket0EigrpSplitterDispatchProtocolInd, DispatchProtocolReq, DscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, MacAddressInd, NetworkProtocolInd, PacketProtocolTag, TosInd
transportOutPacket0Ospfv3SplitterDispatchProtocolInd, DispatchProtocolReq, DscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, MacAddressInd, NetworkProtocolInd, PacketProtocolTag, TosInd
transportOutPacket0SctpDispatchProtocolInd, DispatchProtocolReq, DscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, NetworkProtocolInd, PacketProtocolTag, TosInd
transportOutPacket0TcpDispatchProtocolInd, DispatchProtocolReq, DscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, NetworkProtocolInd, PacketProtocolTag, TosInd, MacAddressInd?
transportOutPacket0TcpLwipDispatchProtocolInd, DispatchProtocolReq, DscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, MacAddressInd, NetworkProtocolInd, PacketProtocolTag, TosInd
transportOutPacket0UdpDispatchProtocolInd, DispatchProtocolReq, DscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, NetworkProtocolInd, PacketProtocolTag, TosInd, MacAddressInd?

Packet operations (observed)

chunkTypepacketAction
trim, trimFront
Icmpv6HeaderpeekAtFront
Ipv6HeaderinsertAtFront, peekAtFront, popAtFront, removeAtFront

Shared Tagging operations (observed)

tagTypetagAction
DispatchProtocolIndaddTagIfAbsent
DispatchProtocolReqaddTagIfAbsent, removeTagIfPresent
DscpIndaddTagIfAbsent
DscpReqremoveTagIfPresent
EcnIndaddTagIfAbsent
EcnReqremoveTagIfPresent
HopLimitIndaddTagIfAbsent
HopLimitReqremoveTagIfPresent
InterfaceIndfindTag, getTag
InterfaceReqaddTagIfAbsent, findTag
Ipv6ExtHeaderReqremoveTagIfPresent
L3AddressIndaddTagIfAbsent
L3AddressReqgetTag, removeTag
MacAddressReqaddTagIfAbsent
NetworkProtocolIndaddTagIfAbsent, removeTagIfPresent
PacketProtocolTagaddTagIfAbsent, getTag, removeTagIfPresent
SocketIndaddTagIfAbsent
SocketReqgetTag
TosIndaddTagIfAbsent
TosReqremoveTagIfPresent

Tagging operations (observed)

tagTypetagAction
inet::Ipv6InterfaceDatagetTag

Source code

//
// Implements the IPv6 protocol.
//
// The IPv6 protocol header is represented by the ~Ipv6Header message class.
//
// <b>Interfacing with higher layer protocols</b>
//
// To send a packet over IPv6 from a higher layer protocol, the module should
// fill in an ~L3AddressReq object, attach it to the packet with Packet's
// addTag() method, then send the packet to the ~Ipv6 module.
//
// When ~Ipv6 sends up a packet to a higher layer protocol, it will also attach
// an ~L3AddressInd to the packet, with the source and destination IPv6 addresses
// of the ~Ipv6Header in which the packet arrived.
//
// ~Ipv6 can serve several higher-layer protocols. The higher layer protocols
// should call registerProtocol with their gate towards the IPv6 module,
// for fill up the protocol-to-gateindex map. When delivering packets to them,
// the output gate is determined from the Protocol field in the IPv6 header.
//
// <b>Routing and interfacing with lower layers</b>
//
// The routing table is stored in the module ~Ipv6RoutingTable. When a datagram
// needs to be routed, Ipv6 queries ~Ipv6RoutingTable for the output interface
// (or "port") and next hop address of the packet. This is done by directly
// calling C++ methods of ~Ipv6RoutingTable. No message exchange with ~Ipv6RoutingTable
// takes place.
//
//#FIXME describe operation
//
// Routing protocol implementations can also query and manipulate the route table
// by calling ~Ipv6RoutingTable's methods in C++.
//
// <b>Performance model, QoS</b>
//
// In the current form, ~Ipv6 contains a FIFO which queues up IPv6 frames;
// these are processed in order. The processing time is determined by the
// procDelay module parameter.
//
// @see ~Ipv6RoutingTable, ~Ipv6NeighbourDiscovery, ~Icmpv6
//
simple Ipv6
{
    parameters:
        string interfaceTableModule;   // The path to the InterfaceTable module
        string routingTableModule;
        string ipv6NeighbourDiscoveryModule;
        string icmpv6Module;
        string ipv6TunnelingModule;
        double procDelay @unit(s) = default(0s);
        @display("i=block/network2");
        @signal[packetDropped](type=inet::Packet);
        @signal[packetSentToUpper](type=inet::Packet);
        @signal[packetReceivedFromUpper](type=inet::Packet);
        @signal[packetSentToLower](type=inet::Packet);
        @signal[packetReceivedFromLower](type=inet::Packet);
    gates:
        input transportIn @labels(Ipv6ControlInfo/down,TcpHeader,UdpHeader);
        output transportOut @labels(Ipv6ControlInfo/up,TcpHeader,UdpHeader);
        input queueIn @labels(IPv6Datagram);
        output queueOut @labels(IPv6Datagram);
        input ndIn;
        output ndOut;
        // tunneling gates - CB
        input upperTunnelingIn;
        output upperTunnelingOut;
        input lowerTunnelingIn;
        output lowerTunnelingOut;
        //the following gates are added by Zarrar Yousaf on 19.06.07
        input xMIPv6In;
        output xMIPv6Out;
}

File: src/inet/networklayer/ipv6/Ipv6.ned