Skip to content

Commit

Permalink
Fixes perfomance issue with unnecessary use of the ARP module for PPP…
Browse files Browse the repository at this point in the history
…. From oversim Brach
  • Loading branch information
aarizaq committed Mar 17, 2009
1 parent e6fc5c2 commit b568cc5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/networklayer/arp/ARP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void ARP::initialize(int stage)
WATCH_PTRMAP(arpCache);
WATCH_PTRMAP(globalArpCache);

// initialize global cache
// initialize global cache
for (int i=0;i<ift->getNumInterfaces();i++)
{
InterfaceEntry *ie = ift->getInterface(i);
Expand Down Expand Up @@ -159,7 +159,8 @@ void ARP::processOutboundPacket(cMessage *msg)
if (!ie->isBroadcast())
{
EV << "output interface " << ie->getName() << " is not broadcast, skipping ARP\n";
send(msg, nicOutBaseGateId + ie->getNetworkLayerGateIndex());
// send(msg, nicOutBaseGateId + ie->getNetworkLayerGateIndex());
sendDirect(msg, getParentModule(), "ifOut", ie->getNetworkLayerGateIndex());
return;
}

Expand All @@ -185,7 +186,7 @@ void ARP::processOutboundPacket(cMessage *msg)
// more than one host group address may map to the same Ethernet multicast
// address."
//


// if (nextHopAddr.isMulticast())
if (nextHopAddr.isMulticast() || nextHopAddr == IPAddress::ALLONES_ADDRESS) // also include all nodes
Expand Down Expand Up @@ -292,7 +293,9 @@ void ARP::sendPacketToNIC(cMessage *msg, InterfaceEntry *ie, const MACAddress& m
msg->setControlInfo(controlInfo);

// send out
send(msg, nicOutBaseGateId + ie->getNetworkLayerGateIndex());
// send(msg, nicOutBaseGateId + ie->getNetworkLayerGateIndex());
sendDirect(msg, getParentModule(), "ifOut",
ie->getNetworkLayerGateIndex());
}

void ARP::sendARPRequest(InterfaceEntry *ie, IPAddress ipAddress)
Expand Down
8 changes: 8 additions & 0 deletions src/networklayer/ipv4/IP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,13 @@ void IP::sendDatagramToOutput(IPDatagram *datagram, InterfaceEntry *ie, IPAddres
icmpAccess.get()->sendErrorMessage(datagram, ICMP_TIME_EXCEEDED, 0);
return;
}
if (!ie->isBroadcast())
{
EV << "output interface " << ie->getName() << " is not broadcast, skipping ARP\n";
sendDirect(datagram, getParentModule(), "ifOut",
ie->getNetworkLayerGateIndex());

} else {
// send out datagram to ARP, with control info attached
IPRoutingDecision *routingDecision = new IPRoutingDecision();
routingDecision->setInterfaceId(ie->getInterfaceId());
Expand All @@ -685,6 +691,8 @@ void IP::sendDatagramToOutput(IPDatagram *datagram, InterfaceEntry *ie, IPAddres
send(datagram, queueOutGate);
}

}

void IP::controlMessageToManetRouting(int code,IPDatagram *datagram)
{
ControlManetRouting *control;
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/inet/NetworkLayer.ned
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ module NetworkLayer
// L2 interfaces to IP and from ARP
for i=0..sizeof(ifOut)-1 {
ifIn[i] --> { @display("m=s"); } --> ip.queueIn[i];
ifOut[i] <-- { @display("m=s"); } <-- arp.nicOut[i];
// ifOut[i] <-- { @display("m=s"); } <-- arp.nicOut[i];
}
}

2 changes: 1 addition & 1 deletion src/nodes/inet/NetworkLayerGlobalArp.ned
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ module NetworkLayerGlobalArp
// L2 interfaces to IP and from ARP
for i=0..sizeof(ifOut)-1 {
ifIn[i] --> { @display("m=s"); } --> ip.queueIn[i];
ifOut[i] <-- { @display("m=s"); } <-- arp.nicOut[i];
// ifOut[i] <-- { @display("m=s"); } <-- arp.nicOut[i];
}
}

0 comments on commit b568cc5

Please sign in to comment.