Package: inet.networklayer.mpls
Mpls
simple moduleImplements the MPLS protocol.
Mpls module is added between layer 2 and 3 in the OSI model for fast packet switching. Mpls should be transparent to signalling protocols. Signalling protocol currently implemented in this simulation is RSVP-TE.
Operations
MPLS packets are represented by the MplsPacket class. The local LIB (Label Information Base) is stored in a LibTable module in the LSR.
For most of the time, the Mpls module will do the label swapping and message forwarding. Upon receiving a labelled packet from another LSR, the Mpls first extract the incoming interface and incoming label pair, and then look up the local LIB table. If an outgoing label and an outgoing interface can be found, the module will perform appropriate label operations (PUSH, POP, SWAP) based on the "outLabel" vector containing label and operation pairs.
Collaborations
Mpls module is required to interact with L2 (Link Layer) and L3 (Network Layer) in the OSI model. In addition, it needs to obtain label information from the LIB component and label query result from the Ldp module. Messages the model communicates with L2 and Network Layers are L2 packets (PPP, Frame Relay, ATM, Ethernet, etc.), and IP native packets. Specifically, Mpls module encapsulates IP packet and is encapsulated in L2 packet. Different L2 protocols may require different methods of encapsulation to inherit the L2's QoS. This implementation follows a generic approach; it assumes no information of QoS from the link layer.
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Used in compound modules
Name | Type | Description |
---|---|---|
LdpMplsRouter | compound module |
An LDP-capable router. |
RsvpMplsRouter | compound module |
An RSVP-TE capable router. |
Parameters
Name | Type | Default value | Description |
---|---|---|---|
interfaceTableModule | string |
The path to the InterfaceTable module |
|
libTableModule | string | ||
classifierModule | string |
The path to the module which implements the IIngressClassifier C++ interface |
Properties
Name | Value | Description |
---|---|---|
display | i=block/switch |
Gates
Name | Direction | Size | Description |
---|---|---|---|
upperLayerIn | input | ||
upperLayerOut | output | ||
lowerLayerIn | input | ||
lowerLayerOut | output |
Direct method calls (observed)
call to | function | info |
---|---|---|
MessageDispatcher | inet::MessageDispatcher::arrived | arrived |
MessageDispatcher | inet::MessageDispatcher::handleRegisterProtocol | handleRegisterProtocol |
MessageDispatcher | inet::MessageDispatcher::handleRegisterService | handleRegisterService |
InterfaceTable | inet::InterfaceTable::findInterfaceByName | findInterfaceByName |
Called methods (observed)
function | info | call from |
---|---|---|
inet::Mpls::handleRegisterProtocol | handleRegisterProtocol | MessageDispatcher |
inet::Mpls::handleRegisterService | handleRegisterService | MessageDispatcher |
Incoming messages (observed)
gate | msg | kind | ctrl | srcModule | tags |
---|---|---|---|---|---|
lowerLayerIn | Packet | 0 | Ppp | DispatchProtocolReq, InterfaceInd, PacketProtocolTag | |
upperLayerIn | Packet | 0 | Ipv4 | DispatchProtocolInd, InterfaceReq, NetworkProtocolInd, PacketProtocolTag, DscpInd?, EcnInd?, HopLimitInd?, InterfaceInd?, L3AddressInd?, MulticastReq?, TosInd?, TransportProtocolInd? |
Outgoing messages (observed)
gate | msg | kind | ctrl | destModule | tags |
---|---|---|---|---|---|
lowerLayerOut | Packet | 0 | DropTailQueue | InterfaceReq, PacketProtocolTag, DispatchProtocolInd?, DscpInd?, EcnInd?, HopLimitInd?, InterfaceInd?, L3AddressInd?, MulticastReq?, NetworkProtocolInd?, TosInd?, TransportProtocolInd? | |
upperLayerOut | Packet | 0 | Ipv4 | DispatchProtocolReq, InterfaceInd, PacketProtocolTag |
Packet operations (observed)
chunkType | packetAction |
---|---|
trim, trimFront | |
Ipv4Header | peekAtFront |
MplsHeader | insertAtFront, peekAtFront, popAtFront, removeAtFront |
UdpHeader | peekDataAt |
Shared Tagging operations (observed)
tagType | tagAction |
---|---|
DispatchProtocolReq | findTag, removeTagIfPresent |
InterfaceInd | findTag, getTag |
InterfaceReq | addTagIfAbsent, findTag |
PacketProtocolTag | addTagIfAbsent, findTag, getTag |
Source code
// // Implements the MPLS protocol. // // ~Mpls module is added between layer 2 and 3 in the OSI model for fast packet // switching. ~Mpls should be transparent to signalling protocols. Signalling // protocol currently implemented in this simulation is RSVP-TE. // // Operations // // MPLS packets are represented by the MplsPacket class. // The local LIB (Label Information Base) is stored in a ~LibTable module // in the LSR. // // For most of the time, the ~Mpls module will do the label swapping and // message forwarding. Upon receiving a labelled packet from another LSR, the // ~Mpls first extract the incoming interface and incoming label pair, and then // look up the local LIB table. If an outgoing label and an outgoing interface // can be found, the module will perform appropriate label operations (PUSH, // POP, SWAP) based on the "outLabel" vector containing label and operation // pairs. // // Collaborations // // ~Mpls module is required to interact with L2 (Link Layer) and L3 (Network // Layer) in the OSI model. In addition, it needs to obtain label information // from the LIB component and label query result from the ~Ldp module. Messages // the model communicates with L2 and Network Layers are L2 packets (PPP, // Frame Relay, ATM, Ethernet, etc.), and IP native packets. Specifically, // ~Mpls module encapsulates IP packet and is encapsulated in L2 packet. // Different L2 protocols may require different methods of encapsulation to // inherit the L2's QoS. This implementation follows a generic approach; it // assumes no information of QoS from the link layer. // simple Mpls like IProtocolLayer { parameters: string interfaceTableModule; // The path to the InterfaceTable module string libTableModule; string classifierModule; // The path to the module which implements the IIngressClassifier C++ interface @display("i=block/switch"); gates: input upperLayerIn; output upperLayerOut; input lowerLayerIn; output lowerLayerOut; }File: src/inet/networklayer/mpls/Mpls.ned