IPv6Datagram

Namespace inet

IPv6Datagram

packet

IPv6 datagram. RFC 2460 Section 3.

Header fields not explicitly modelled:

    • version (=6): represented by the class name itself
    • payload length: will be calculated from encapsulated message length and extension headers' length

Fields

Name Type Description
srcAddress IPv6Address
destAddress IPv6Address
trafficClass unsigned char
diffServCodePoint int

maps to bits 0-5 of trafficClass

explicitCongestionNotification int

maps to bits 6-7 of trafficClass

flowLabel unsigned int
hopLimit short
transportProtocol int
extensionHeader IPv6ExtensionHeader[]

array of extension headers, subclassed from IPv6ExtensionHeader

Source code

//
// IPv6 datagram. RFC 2460 Section 3.
//
// Header fields not explicitly modelled:
//    - version (=6): represented by the class name itself
//    - payload length: will be calculated from encapsulated message length
//      and extension headers' length
//
packet IPv6Datagram
{
    @customize(true);
    IPv6Address srcAddress;
    IPv6Address destAddress;
    unsigned char trafficClass;
    abstract int diffServCodePoint;  // maps to bits 0-5 of trafficClass
    abstract int explicitCongestionNotification;  // maps to bits 6-7 of trafficClass
    unsigned int flowLabel;
    short hopLimit = 0;
    int transportProtocol @enum(IPProtocolId);

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

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