Ipv6Header

Namespace inet

Ipv6Header

class

Ipv6 datagram. RFC 2460 Section 3.

Header fields not explicitly modelled:

    • payload length: will be calculated from encapsulated message length and extension headers' length

Extends

Name Type Description
NetworkHeaderBase (unknown -- not in documented files)

Fields

Name Type Description
chunkLength
version uint8_t
srcAddress Ipv6Address
destAddress Ipv6Address
payloadLength B

The size of the payload in octets, including any extension headers. The length is set to zero when a Hop-by-Hop extension header carries a Jumbo Payload option.

trafficClass short

@bits(8) Traffic Class OMNeT++ 6.0: short __dscp @custom @getter(getDscp) @setter(setDscp); // @bit(6), maps to bits 0-5 of trafficClass short __ecn @custom @getter(getEcn) @setter(setEcn); // @bit(2), maps to bits 6-7 of trafficClass

flowLabel unsigned int
hopLimit short
protocolId IpProtocolId
extensionHeader Ipv6ExtensionHeader[]

array of extension headers, subclassed from Ipv6ExtensionHeader

Packet operations (observed)

actionmodule
insertAtFrontIpv6, Gpsr, Udp, UdpCrcInsertionHook
peekAtFrontIcmpv6, Ipv6NeighbourDiscovery, Ipv6
peekDataAtIcmpv6
popAtFrontIpv6, Udp
removeAtFrontIpv6, Gpsr

Source code

//
// Ipv6 datagram. RFC 2460 Section 3.
//
// Header fields not explicitly modelled:
//    - payload length: will be calculated from encapsulated message length
//      and extension headers' length
//
class Ipv6Header extends NetworkHeaderBase
{
    chunkLength = IPv6_HEADER_BYTES;
    uint8_t version = 6;
    Ipv6Address srcAddress;
    Ipv6Address destAddress;
    B payloadLength = B(-1);    // The size of the payload in octets, including any extension headers. The length is set to zero when a Hop-by-Hop extension header carries a Jumbo Payload option.
    short trafficClass;    // @bits(8) Traffic Class
    // OMNeT++ 6.0:
    // short __dscp @custom @getter(getDscp) @setter(setDscp);  // @bit(6), maps to bits 0-5 of trafficClass
    // short __ecn @custom @getter(getEcn) @setter(setEcn);  // @bit(2),  maps to bits 6-7 of trafficClass

    unsigned int flowLabel;
    short hopLimit = 0;
    IpProtocolId protocolId = IP_PROT_NONE;

    Ipv6ExtensionHeader *extensionHeader[] @owned; // array of extension headers, subclassed from ~Ipv6ExtensionHeader
}

File: src/inet/networklayer/ipv6/Ipv6Header.msg