ExtLowerIpv4

Package: inet.emulation.networklayer.ipv4

compound module ExtLowerIpv4

Provides IPv4 layer functionality for network emulation that connects the simulation to a real network on the host computer. Sends packets from the simulation to the real network and receives packets from the real network into the simulation using raw sockets. Uses Ipv4Encap for packet encapsulation and ExtIpv4Socket for the connection to the host’s networking stack.

Usage diagram

Inheritance diagram

Used in compound modules

Name

Type

Description

ExtLowerIpv4NetworkLayer

compound module

Provides a simplified network layer for emulation that connects the simulation to a real network on the host computer. Uses ExtLowerIpv4 to send packets from the simulation to the real network and receive packets from the real network into the simulation using raw sockets.

Gates

Name

Direction

Size

Description

transportIn

input

transportOut

output

queueIn

input

queueOut

output

Unassigned submodule parameters

Name

Type

Default value

Description

encap.displayStringTextFormat

string

“”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

socket.displayStringTextFormat

string

“snt:{numSent} rcv:{numReceived}”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

socket.namespace

string

“”

socket.packetName

string

“Ext-%p-%t-%n”

Source code

//
// Provides IPv4 layer functionality for network emulation that connects
// the simulation to a real network on the host computer. Sends packets from
// the simulation to the real network and receives packets from the real network
// into the simulation using raw sockets. Uses ~Ipv4Encap for packet encapsulation
// and ~ExtIpv4Socket for the connection to the host's networking stack.
//
module ExtLowerIpv4 like IIpv4
{
    gates:
        input transportIn @labels(Ipv4ControlInfo/down,TcpHeader,UdpHeader,SctpHeader);
        output transportOut @labels(Ipv4ControlInfo/up,TcpHeader,UdpHeader,SctpHeader);
        input queueIn @labels(Ipv4Header,ArpPacket,Ieee802Ctrl);
        output queueOut @labels(Ipv4Header,ArpPacket,Ieee802Ctrl);
    submodules:
        encap: Ipv4Encap {
            parameters:
                @display("p=100,50");
        }
        socket: ExtIpv4Socket {
            parameters:
                @display("p=100,150");
        }
    connections allowunconnected:
        transportIn --> encap.upperLayerIn;
        transportOut <-- encap.upperLayerOut;
        encap.lowerLayerOut --> socket.upperLayerIn;
        encap.lowerLayerIn <-- socket.upperLayerOut;
}

File: src/inet/emulation/networklayer/ipv4/ExtLowerIpv4.ned