IP spoofing attack in 802.11s environments using ns3

267 views
Skip to first unread message

Mouna Gassara

unread,
Nov 4, 2014, 8:20:42 AM11/4/14
to ns-3-...@googlegroups.com
How can i simulate an ip spoofing attack in 802.11s environments using ns3? I am new in ns3, i find the example of WMN 802.11s topology mesh.cc but I need to add an ip spoofing scenario attack in order to evaluate my ip traceback solution. Can you give me an example of code .cc of this attack.
I need your help and thanks in advance.

Mouna Gassara

unread,
Nov 18, 2014, 1:12:04 AM11/18/14
to ns-3-...@googlegroups.com
Dear NS3 users
Someone can help me. it is possible to simulate an ip spoofing with ns3???!!!!

Tommaso Pecorella

unread,
Nov 18, 2014, 5:25:45 PM11/18/14
to ns-3-...@googlegroups.com
Hi,

if by "IP spoofing" you mean to assign the same IP address to two nodes, just do it. I honestly don't see the problem. You will "just" have to do it manually, as the Ipv4AddressHelper will throw an assert if you try to do it. No problem, just assign the address "manually" to the interface.
As an alternative, use a IP raw socket or, even better, create your own IP header and send the packet in the NetDevice.

Tbh, I didn't reply to the first message because the answer was too obvious to me: do it like you would do in a normal Internet host. Doh.

Cheers,

T.

Mouna Gassara

unread,
Nov 19, 2014, 1:59:52 AM11/19/14
to ns-3-...@googlegroups.com
Thanks very much for your reply. Just I have a second question:
I installed ns-3.18 with visual studio 2012 in windows 7. I used netAnim 3.104 to view the mesh.cc scenario and the result is this:
Images intégrées 1
But when i look to the result existed in the youtube https://www.youtube.com/watch?v=5_VNHfBRtRg i understand that isn't correct.
What's the problem?? I installed ns-3-dev and ns-3.21 in the virtual machine but the result was the same. I need your help and thanks in advance.

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/DxGuw-GyXLM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Tommaso Pecorella

unread,
Nov 19, 2014, 3:14:39 AM11/19/14
to ns-3-...@googlegroups.com
Hi,

the video you linked only shows 3 packets sent by a wireless source. Nothing extemely different than what you have in your table.

As a side note, I' strongly suggest to use ns-3.21 or ns-3-dev, i.e., always the latest version.

Cheers,

T.

Mouna Gassara

unread,
Nov 19, 2014, 4:00:52 AM11/19/14
to ns-3-users
Thank you sir. I am new in ns3 and i have some questions:
** I need to do a simple senario between an attacker (ip spoofer) and a victim. Which application can i use?? Does GridPositionAllocator helpful to do that??
** I have to add some IP traceback function to router nodes. How can i get those nodes (intermidiates nodes, nexthop)??
** In the router node, i have to change IPv4Header fields: type of service+ fragment ID+ unused flag+ fragment offset.

I found this function which permits to have a specific field in the header:

MeshTest::GetPacketSource(Ptr<Packet> packet)
{
  Ipv4Address src_ip;
  //The following code is based from
 
  // To get a header from Ptr<Packet> packet first, copy the packet 
  Ptr<Packet> q = packet->Copy();
  
  // Use indicator to search the packet
  PacketMetadata::ItemIterator metadataIterator = q->BeginItem();
  PacketMetadata::Item item;
  while (metadataIterator.HasNext())
  {
    item = metadataIterator.Next();
    //NS_LOG_FUNCTION("item name: " << item.tid.GetName());
    
    // If we want to have an ip header
    if(item.tid.GetName() == "ns3::Ipv4Header")
    {
      Callback<ObjectBase *> constr = item.tid.GetConstructor();
      NS_ASSERT(!constr.IsNull());
 
      // Ptr<> and DynamicCast<> won't work here as all headers are from ObjectBase, not Object
      ObjectBase *instance = constr();
      NS_ASSERT(instance != 0);
 
      Ipv4Header* ipv4Header = dynamic_cast<Ipv4Header*> (instance);
      NS_ASSERT(ipv4Header != 0);
 
      ipv4Header->Deserialize(item.current);
 
      // The ipv4Header can now obtain the source of the packet
      src_ip = ipv4Header->GetSource();
 
      // Finished, clear the ip header and go back
      delete ipv4Header;
      break;
    }
  }  
but how can i get specially the three fragments in IPv4Header???
Thanks  in advance sir. You are very helpful and gentil.

Haftu Halefom

unread,
Apr 25, 2017, 9:10:11 AM4/25/17
to ns-3-users
Hi there

I know I am too late, but I need some help from you.

I am trying to simulate hybrid IP traceback (based on packet marking and packet logging). Can you help me find some sample code for ns3 on other? I am new to codding but I really need this.

Tommaso Pecorella

unread,
Apr 25, 2017, 10:20:37 AM4/25/17
to ns-3-users
Dear Haftu,

stop spamming the group or I'll build a tiny Python script to handle your issue.

T.

Haftu Halefom

unread,
Apr 25, 2017, 11:23:01 AM4/25/17
to ns-3-...@googlegroups.com
Ok sir. I am so sorry.
I have lack of knowledge on how to look for help. I didnt even know that.


Virus-free. www.avast.com

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/DxGuw-GyXLM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages