Package: inet.routing.rip
Rip
simple moduleRouting Information Protocol.
This module implements distance vector routing as specified in RFC 2453 (RIPv2) and RFC 2080 (RIPng). The routing protocol uses the Bellman-Ford algorithm to compute the optimal routes. Each router periodically sends its routes to the neighboring routers. This update message contains the destination (address, netmask) and metric of each route. When a router receives an update message, it adds the cost of the incoming interface to the cost of the received route and if it is smaller than the metric of its current route then it updates the current route.
Limitations of the protocol:
- only the hop-count metric is supported
- the metric diameter of the network must be smaller than 16
- the protocol depends on "counting to infinity" to recover from routing loops
The module has the following parameters:
- mode: either "RIPv2" (RFC 2453) or "RIPng" (RFC 2080)
- routingTableModule: path to the routing table module
- ripConfig: an XML configuration file containing per-interface parameters
The configuration file specifies the per interface parameters. Each <interface> element configures one or more interfaces; the @hosts, @names, @towards, @among attributes select the configured interfaces (see Ipv4NetworkConfigurator). The other attributes sets parameters of the selected interfaces:
- @metric: metric assigned to the link, default value is 1. This value is added to the metric of a learned route, received on this interface. It must be an integer in the [1,15] interval.
- @mode: mode of the interface; an enumerated value, default is 'SplitHorizonPoisonedReverse'. Accepted values are:
- 'NoRIP': no RIP messages are sent or received on this interface
- 'NoSplitHorizon': no split horizon filtering; send all routes to neighbors.
- 'SplitHorizon': do not sent routes whose next hop is the neighbor
- 'SplitHorizonPoisonedReverse': if the next hop is the neighbor, then set the metric of the route to infinity.
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
interfaceTableModule | string |
The path to the InterfaceTable module |
|
routingTableModule | string | ||
ripConfig | xml | xml(" |
|
mode | string | "RIPv2" | |
udpPort | int | (mode == "RIPng" ? 521 : 520) | |
startupTime | double | uniform(0s,5s) |
delay before starting RIP |
shutdownTime | double | 1s |
delay before shutting down RIP |
updateInterval | double | 30s |
RIP timers |
routeExpiryTime | double | 180s |
invalid timer |
routePurgeTime | double | 120s |
garbage collection timer or flush timer |
holdDownTime | double | 0s |
hold-down timer (not defined in RFC). 0s means not active |
triggeredUpdate | bool | true |
sending triggered updates on route changes |
triggeredUpdateDelay | double | uniform(1s,5s) | |
stopOperationExtraTime | double | -1s |
extra time after lifecycle stop operation finished |
stopOperationTimeout | double | 2s |
timeout value for lifecycle stop operation |
Properties
Name | Value | Description |
---|---|---|
display | i=block/network2 | |
lifecycleSupport |
Gates
Name | Direction | Size | Description |
---|---|---|---|
socketIn | input | ||
socketOut | output |
Signals
Name | Type | Unit |
---|---|---|
rcvdResponse | cPacket | |
sentUpdate | cPacket | |
numRoutes | unsigned long | |
sentRequest | cPacket | |
badResponse | cPacket |
Statistics
Name | Title | Source | Record | Unit | Interpolation Mode |
---|---|---|---|---|---|
rcvdResponse | response received | rcvdResponse | count, vector(constant1) | none | |
sentUpdate | update sent | sentUpdate | count, vector(constant1) | none | |
numRoutes | number of routes | numRoutes | last, vector | none | |
sentRequest | request sent | sentRequest | count, vector(constant1) | none | |
badResponse | bad response received | badResponse | count, vector(constant1) | none |
Scheduled messages (observed)
msg | kind | ctrl | tags | msgname | context |
---|---|---|---|---|---|
omnetpp::cMessage | 0 | RIP-shutdown | |||
omnetpp::cMessage | 0 | RIP-startup | |||
omnetpp::cMessage | 0 | RIP-timer | |||
omnetpp::cMessage | 0 | RIP-trigger |
Direct method calls (observed)
call to | function | info |
---|---|---|
MessageDispatcher | inet::MessageDispatcher::arrived | arrived |
ScenarioManager | inet::ScenarioManager::moduleOperationStageCompleted | moduleOperationStageCompleted |
Ipv4RoutingTable | inet::Ipv4RoutingTable::addRoute | addRoute(...) |
Ipv4RoutingTable | inet::Ipv4RoutingTable::deleteRoute | deleteRoute(...) |
Ipv4RoutingTable | inet::Ipv4RoutingTable::isLocalAddress | isLocalAddress(%u.%u.%u.%u) |
Ipv6RoutingTable | inet::Ipv6RoutingTable::isLocalAddress | isLocalAddress(%s) |
Rip | inet::Rip::receiveSignal | routeChanged |
Called methods (observed)
function | info | call from |
---|---|---|
inet::Rip::handleOperationStage | handleOperationStage | ScenarioManager |
inet::Rip::receiveSignal | interfaceStateChanged | InterfaceTable |
inet::Rip::receiveSignal | routeAdded | Ipv4RoutingTable |
inet::Rip::receiveSignal | routeChanged | Rip |
inet::Rip::receiveSignal | routeDeleted | Ipv4RoutingTable |
Incoming messages (observed)
gate | msg | kind | ctrl | srcModule | tags |
---|---|---|---|---|---|
socketIn | Indication | 1 (UdpStatusInd::UDP_I_ERROR) | UdpErrorIndication | Udp | L3AddressInd, L4PortInd, SocketInd |
socketIn | Indication | 2 (UdpStatusInd::UDP_I_SOCKET_CLOSED) | UdpSocketClosedIndication | Udp | SocketInd |
socketIn | Packet | 0 (UdpStatusInd::UDP_I_DATA) | Udp | DscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, L4PortInd, NetworkProtocolInd, SocketInd, TosInd, TransportProtocolInd, DispatchProtocolInd?, MacAddressInd? |
Outgoing messages (observed)
gate | msg | kind | ctrl | destModule | tags |
---|---|---|---|---|---|
socketOut | Packet | 0 (UdpCommandCode::UDP_C_DATA) | Udp | DispatchProtocolReq, L3AddressReq, L4PortReq, SocketReq, InterfaceReq? | |
socketOut | Request | 1 (UdpCommandCode::UDP_C_BIND) | UdpBindCommand | Udp | DispatchProtocolReq, SocketReq |
socketOut | Request | 3 (UdpCommandCode::UDP_C_SETOPTION) | UdpJoinMulticastGroupsCommand | Udp | DispatchProtocolReq, SocketReq |
socketOut | Request | 3 (UdpCommandCode::UDP_C_SETOPTION) | UdpSetMulticastLoopCommand | Udp | DispatchProtocolReq, SocketReq |
socketOut | Request | 3 (UdpCommandCode::UDP_C_SETOPTION) | UdpSetTimeToLiveCommand | Udp | DispatchProtocolReq, SocketReq |
socketOut | Request | 4 (UdpCommandCode::UDP_C_CLOSE) | UdpCloseCommand | Udp | DispatchProtocolReq, SocketReq |
Packet operations (observed)
chunkType | packetAction |
---|---|
RipPacket | insertAtBack, peekAtFront |
Shared Tagging operations (observed)
tagType | tagAction |
---|---|
clearTags | |
DispatchProtocolReq | addTagIfAbsent |
HopLimitInd | getTag |
InterfaceInd | getTag |
InterfaceReq | addTagIfAbsent |
L3AddressInd | getTag |
L3AddressReq | addTagIfAbsent |
L4PortInd | getTag |
L4PortReq | addTagIfAbsent |
SocketReq | addTagIfAbsent |
Tagging operations (observed)
tagType | tagAction |
---|---|
inet::Ipv4InterfaceData | findTag |
inet::Ipv6InterfaceData | findTag |
Source code
// // Routing Information Protocol. // // This module implements distance vector routing as // specified in RFC 2453 (RIPv2) and RFC 2080 (RIPng). // The routing protocol uses the Bellman-Ford algorithm to compute // the optimal routes. Each router periodically sends its // routes to the neighboring routers. This update message // contains the destination (address, netmask) and metric // of each route. When a router receives an update message, // it adds the cost of the incoming interface // to the cost of the received route and if it is smaller than the metric // of its current route then it updates the current route. // // Limitations of the protocol: // - only the hop-count metric is supported // - the metric diameter of the network must be smaller than 16 // - the protocol depends on "counting to infinity" to recover // from routing loops // // The module has the following parameters: // - mode: either "RIPv2" (RFC 2453) or "RIPng" (RFC 2080) // - routingTableModule: path to the routing table module // - ripConfig: an XML configuration file containing per-interface parameters // // The configuration file specifies the per interface parameters. // Each <interface> element configures one or more interfaces; // the @hosts, @names, @towards, @among attributes select the // configured interfaces (see ~Ipv4NetworkConfigurator). // The other attributes sets parameters of the selected interfaces: // // - @metric: metric assigned to the link, default value is 1. // This value is added to the metric of a learned route, // received on this interface. It must be an integer in // the [1,15] interval. // - @mode: mode of the interface; an enumerated value, default is // 'SplitHorizonPoisonedReverse'. Accepted values are: // - 'NoRIP': no RIP messages are sent or received on this interface // - 'NoSplitHorizon': no split horizon filtering; send all routes to // neighbors. // - 'SplitHorizon': do not sent routes whose next hop is the neighbor // - 'SplitHorizonPoisonedReverse': if the next hop is the neighbor, then // set the metric of the route to infinity. simple Rip like IApp { parameters: @display("i=block/network2"); string interfaceTableModule; // The path to the InterfaceTable module string routingTableModule; xml ripConfig = default(xml("<config><interface metric='1'/></config>")); string mode @enum("RIPv2","RIPng") = default("RIPv2"); int udpPort = (mode == "RIPng" ? 521 : 520); volatile double startupTime @unit(s) = default(uniform(0s,5s)); // delay before starting RIP double shutdownTime @unit(s) = default(1s); // delay before shutting down RIP // RIP timers double updateInterval @unit(s) = default(30s); // 30s timer or update timer double routeExpiryTime @unit(s) = default(180s); // invalid timer double routePurgeTime @unit(s) = default(120s); // garbage collection timer or flush timer double holdDownTime @unit(s) = default(0s); // hold-down timer (not defined in RFC). 0s means not active bool triggeredUpdate = default(true); // sending triggered updates on route changes volatile double triggeredUpdateDelay @unit(s) = default(uniform(1s,5s)); @lifecycleSupport; double stopOperationExtraTime @unit(s) = default(-1s); // extra time after lifecycle stop operation finished double stopOperationTimeout @unit(s) = default(2s); // timeout value for lifecycle stop operation @signal[sentRequest](type=cPacket); @signal[sentUpdate](type=cPacket); @signal[rcvdResponse](type=cPacket); @signal[badResponse](type=cPacket); @signal[numRoutes](type=unsigned long); @statistic[sentRequest](title="request sent"; source=sentRequest; record=count,"vector(constant1)"; interpolationmode=none); @statistic[sentUpdate](title="update sent"; source=sentUpdate; record=count,"vector(constant1)"; interpolationmode=none); @statistic[rcvdResponse](title="response received"; source=rcvdResponse; record=count,"vector(constant1)"; interpolationmode=none); @statistic[badResponse](title="bad response received"; source=badResponse; record=count,"vector(constant1)"; interpolationmode=none); @statistic[numRoutes](title="number of routes"; source=numRoutes; record=last,vector; interpolationmode=none); gates: input socketIn @labels(UdpControlInfo/up); output socketOut @labels(UdpControlInfo/down); }File: src/inet/routing/rip/Rip.ned