Package: inet.networklayer.ipv4
ICMP
simple moduleICMP implementation
Receive ICMP message from localDeliver and process it:
- echo/timestamp reply: strip ICMP header and send to pingOut
- echo/timestamp request: create reply and send to IPSend
- destination unreachable: ignore/send to IPRouting (static)?
- time exceeded: ignore ?
- parameter problem: ignore ?
- redirect ?
Receive echo/timestamp message from pingIn: encapsulate in ICMP header and send to IPSend
author: Jochen Reber date: 2.5.00, 9.5.00, 20.5.00, 9.6.00 redesign: Andras Varga 1.3.2004
Used in compound modules
Name | Type | Description |
---|---|---|
IPv4NetworkLayer | compound module |
Network layer of an IPv4 node. |
Parameters
Name | Type | Default value | Description |
---|---|---|---|
interfaceTableModule | string |
The path to the InterfaceTable module |
|
routingTableModule | string |
Properties
Name | Value | Description |
---|---|---|
display | i=block/control_s |
Gates
Name | Direction | Size | Description |
---|---|---|---|
localIn | input |
delivered ICMP packets |
|
pingIn [ ] | input |
ping requests from app |
|
pingOut [ ] | output |
result of ping |
|
sendOut | output |
towards network |
|
errorOut | output |
errors |
Source code
// // ICMP implementation // // Receive ICMP message from localDeliver and process it: // - echo/timestamp reply: strip ICMP header and send to pingOut // - echo/timestamp request: create reply and send to IPSend // - destination unreachable: ignore/send to IPRouting (static)? // - time exceeded: ignore ? // - parameter problem: ignore ? // - redirect ? //#FIXME question marks above... // // Receive echo/timestamp message from pingIn: encapsulate in ICMP header // and send to IPSend // // author: Jochen Reber // date: 2.5.00, 9.5.00, 20.5.00, 9.6.00 // redesign: Andras Varga 1.3.2004 // simple ICMP { parameters: string interfaceTableModule; // The path to the InterfaceTable module string routingTableModule; @display("i=block/control_s"); gates: input localIn @labels(IPv4ControlInfo/up); // delivered ICMP packets input pingIn[]; // ping requests from app output pingOut[]; // result of ping output sendOut @labels(IPv4ControlInfo/down); // towards network output errorOut; // errors }File: src/inet/networklayer/ipv4/ICMP.ned