To implement the quench attack in OMNeT++ has several steps basically we need to know the term quench attack, the quench attacks is refers to a kind of attacks where an attacker sends ICMP Source Quench messages to a target that deceptive it into decreasing its transmission rate or disturbing the communication and the ICMP Source Quench messages are designed to designate congestion in a network, asking the sender to slow down its packet transmission. Furthermore these characteristics is usually criticised in advanced networks and the quench attack is less common delay.
In OMNeT++, we need to emulate a quench attack by configuring an attacker node to send ICMP Source Quench messages to a victim, which would emulate the disturbance of communication or the reduction of transmission speed.
The below are the detailed procedures on how to implement the quench attack in OMNeT++ using the INET framework:
Step-by-Step Implementation:
Example:
network QuenchAttackNetwork
{
submodules:
client: StandardHost;
server: StandardHost;
router: Router;
attacker: StandardHost;
connections:
client.ethg++ <–> Eth10G <–> router.ethg++;
attacker.ethg++ <–> Eth10G <–> router.ethg++;
router.ethg++ <–> Eth10G <–> server.ethg++;
}
Example C++ code for a custom quench attack module:
#include <omnetpp.h>
#include “inet/common/packet/Packet.h”
#include “inet/networklayer/icmpv4/IcmpHeader_m.h”
#include “inet/networklayer/contract/ipv4/Ipv4Header_m.h”
using namespace omnetpp;
using namespace inet;
class QuenchAttack : public cSimpleModule
{
protected:
virtual void initialize() override;
virtual void handleMessage(cMessage *msg) override;
void sendQuenchMessage();
};
void QuenchAttack::initialize()
{
// Schedule the first quench message to be sent
scheduleAt(simTime() + par(“startTime”), new cMessage(“sendQuenchMessage”));
}
void QuenchAttack::handleMessage(cMessage *msg)
{
if (msg->isSelfMessage()) {
sendQuenchMessage();
scheduleAt(simTime() + par(“interval”), msg); // Continuously send quench messages
} else {
delete msg;
}
}
void QuenchAttack::sendQuenchMessage()
{
auto packet = new Packet(“IcmpSourceQuench”);
// Create the ICMP Source Quench header
auto icmpHeader = makeShared<IcmpHeader>();
icmpHeader->setType(ICMP_SOURCE_QUENCH); // ICMP Type for Source Quench
icmpHeader->setCode(0);
packet->insertAtFront(icmpHeader);
// Add an IPv4 header for the original packet (to simulate that this is a response)
auto ipv4Header = makeShared<Ipv4Header>();
ipv4Header->setSourceAddress(Ipv4Address(“10.0.0.2”)); // Server IP
ipv4Header->setDestinationAddress(Ipv4Address(“10.0.0.1”)); // Client IP
ipv4Header->setProtocol(IP_PROT_ICMP);
packet->insertAtFront(ipv4Header);
// Send the ICMP Source Quench message to the client
send(packet, “out”);
}
Define_Module(QuenchAttack);
Example configuration in omnetpp.ini:
*.attacker.numApps = 1
*.attacker.app[0].typename = “QuenchAttack”
*.attacker.app[0].startTime = 1s
*.attacker.app[0].interval = 0.5s // Interval between sending quench messages
Example for the client:
*.client.numApps = 1
*.client.app[0].typename = “UdpBasicApp”
*.client.app[0].destAddr = “server”
*.client.app[0].destPort = 5000
*.client.app[0].sendInterval = 1s
*.client.app[0].messageLength = 1024B
Example for the server:
*.server.numApps = 1
*.server.app[0].typename = “UdpSink”
*.server.app[0].localPort = 5000
Example Files
We need to generate the following files as part of simulation:
Here, we had understood how the quench attack will perform and emulate the network scenario using the OMNeT++. If you need more details regarding the quench attack we will provide that too.
The execution of quench attack simulations in OMNeT++ is conducted by omnet-manual.com. We offer superior simulation outcomes and provide comprehensive explanations tailored to your projects. Our team specializes in configuring an attacker node for your initiatives, so please share the details of your projects with us, and we will assist you further.