An Ethernet module you might like

218 views
Skip to first unread message

Ireneusz Szcześniak

unread,
Oct 23, 2014, 3:40:22 AM10/23/14
to ns-3-...@googlegroups.com
Hi,

I was looking for an Ethernet module for ns-3 which I could use to
create a switched-network. I found some working code and adopted it a
bit.

Check it out:

https://github.com/iszczesniak/ethernet

The module was written by Andrey Churin and initially published at:

http://code.google.com/p/ns-3-shop/

I got the code from this repository:

https://github.com/cawka/ns-3-ethernet

I only fixed a bug, added an example and adopted the module to ns-3.21.

You can use the module with the bridge module to create an Ethernet
switched network. Have a look at examples/ethernet-bridge-example.cc
for how to use it.

The module provides EthernetChannel, EthernetNetDevice, and
EthernetHelper. You create Ethernet links with the
EthernetHelper::Install function, where you pass two nodes which you
want to connect. The function creates two EthernetNetDevice objects
and connects them with an EthernetChannel object. EthernetChannel is
full-duplex, and it's implemented with two CSMA links for each of the
two directions.

Copy the whole directory to the src directory of the ns-3 source tree,
and build as usual. For instance, if you use the ns-allinone-3.21
distribution, copy the directory to ns-allinone-3.21/ns-3.21/src/.

Enjoy!


Best,
Irek

Irek Szczesniak

unread,
Dec 8, 2014, 6:24:03 AM12/8/14
to ns-3-...@googlegroups.com
Hi,

About a month ago I wrote about an Ethernet module that I thought was cool (https://github.com/iszczesniak/ethernet).  It ain't.  Don't use it, because it's seriously flawed: it models a duplex Ethernet channel by two half-duplex CSMA channels.  The delay set for the Ethernet channel is set for the two CSMA channels.  During this delay no new packet can be sent, because the packet just sent propagates through the shared medium.  And that's not what we want in the Ethernet channel, where we want to model channel latency, and be able to send packets one by one, without waiting for packets to propagate through the medium.

On this mailing list there is a history of people bashing their heads against this problem, and I haven't found a good working model.

So I wonder, does someone have a good ns-3 Ethernet module that I could use?


Thanks,
Irek

Tommaso Pecorella

unread,
Dec 8, 2014, 9:53:42 AM12/8/14
to ns-3-...@googlegroups.com
Hi Irek,

thanks for the heads up. May I suggest to remove the project from github if you think it's flawed ? In this way we'll avoid mistakes in the future.
An even better solution is to remove the sources and place a note in the project main page (i.e., don't use, it wasn't that good).

About a good working model, we had some discussions recently in ns-devs mailing list, but I can't remember the results. You may want to crawl the ns-devs archives.
If you're interested in developing a realistic Ethernet module, I'd suggest to move the discussion to ns-devs. Given the fact that a good 802.3 model is something very welcome, I'm quite sure you'll find people interested in helping the design and development.

Cheers,

T.

Ireneusz Szcześniak

unread,
Dec 8, 2014, 12:15:21 PM12/8/14
to ns-3-...@googlegroups.com
Hi Tom,

Thanks for your email. I wanna keep the github repository, because
I'm using the module myself even though it's flawed, and it might be
useful for others for the time being.

Even though ns-3 is great (I moved from OMNet++), I can't commit to
working on a good Ethernet module, just because the Ethernet part is
not critical to the project I'm currently working on.


Best,
Irek

On 08.12.2014 15:53, Tommaso Pecorella wrote:
> Hi Irek,
>
> thanks for the heads up. May I suggest to remove the project from
> github if you think it's flawed ? In this way we'll avoid mistakes in
> the future.
> An even better solution is to remove the sources and place a note in
> the project main page (i.e., don't use, it wasn't that good).
>
> About a good working model, we had some discussions recently in
> ns-devs mailing list, but I can't remember the results. You may want
> to crawl the ns-devs archives.
> If you're interested in developing a realistic Ethernet module, I'd
> suggest to move the discussion to ns-devs. Given the fact that a good
> 802.3 model is something very welcome, I'm quite sure you'll find
> people interested in helping the design and development.
>
> Cheers,
>
> T.
>
> On Monday, December 8, 2014 12:24:03 PM UTC+1, Irek Szczesniak wrote:
>
> Hi,
>
> About a month ago I wrote about an Ethernet module that I thought
> was cool (https://github.com/iszczesniak/ethernet
> <https://github.com/iszczesniak/ethernet>). It ain't. Don't use
> --
> 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/7pXhwJ5T6p4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ns-3-users+...@googlegroups.com
> <mailto:ns-3-users+...@googlegroups.com>.
> To post to this group, send email to ns-3-...@googlegroups.com
> <mailto: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,
Dec 8, 2014, 12:22:48 PM12/8/14
to ns-3-...@googlegroups.com
Hi Irek,

I perfectly understand. I would still suggest to put the concerns you expressed into the github project page. In this way whoever wants to pick your work and complete it will know where to start from.

Cheers,

T.

Ireneusz Szcześniak

unread,
Dec 8, 2014, 12:25:37 PM12/8/14
to ns-3-...@googlegroups.com
Yes, I stated it on the github page.

Best,
Irek
> <https://groups.google.com/d/topic/ns-3-users/7pXhwJ5T6p4/unsubscribe>.
>
> > To unsubscribe from this group and all its topics, send an
> email to
> > ns-3-users+...@googlegroups.com <javascript:>
> > <mailto:ns-3-users+...@googlegroups.com <javascript:>>.
> > To post to this group, send email to ns-3-...@googlegroups.com
> <javascript:>
> > <mailto:ns-3-...@googlegroups.com <javascript:>>.
> <http://groups.google.com/group/ns-3-users>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> 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/7pXhwJ5T6p4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ns-3-users+...@googlegroups.com
> <mailto:ns-3-users+...@googlegroups.com>.

Tom Henderson

unread,
Dec 9, 2014, 1:31:24 AM12/9/14
to ns-3-...@googlegroups.com
On 12/08/2014 03:24 AM, Irek Szczesniak wrote:

> So I wonder, does someone have a good ns-3 Ethernet module that I could use?
>

Irek, there has been a small group trying to improve modeling in this
area. A lengthy discussion can be found on the switched ethernet code
review issue here: https://codereview.appspot.com/5615049/

Someone then took the essence of this new model and created an extension
to the existing CSMA half duplex model to make it support a full duplex
mode. To try to move this along, today I created a new code review
issue for this patch here:
https://codereview.appspot.com/187880044/
and would like to try to include it in the next ns-3 release if the open
issues are resolved.

Whether this model is a "good ns-3 Ethernet model" or not depends on the
requirements, but at least it allows the existing CSMA model to better
model how a switched ethernet would behave. If you or others have
suggestions for behavior, API, or test cases to evaluate this new mode
of operation, please comment on the new code posted for review.

- Tom

Ireneusz Szcześniak

unread,
Dec 9, 2014, 12:57:14 PM12/9/14
to ns-3-...@googlegroups.com
Hi Tom,

Thanks for the information. I'll have a look at the code. It looks
promising.


Best,
Irek

ES SALHI Afaf

unread,
Mar 16, 2016, 8:42:11 AM3/16/16
to ns-3-users
Hi Irek,

I need to use switched Ethernet in my project. You say that the code of GitHub has limitation. You mean that we can't send packet on the second half duplex when an other packet is propagating in the first half duplex? Or you talk about the full duplex?
So can we use the two hal duplex in the same time or not?

Thanks by advance!

Best,
Afaf

Ireneusz Szcześniak

unread,
Mar 16, 2016, 8:48:30 AM3/16/16
to ns-3-...@googlegroups.com
Hi Afaf,

The module is full duplex: it can send and receive frames at the same
time, because it's has two separate CSMA channels. The problem is
that the CSMA channels is considered busy, while a frame is
propagating, and so no new frame can be send during that time.
However, in the current Ethernet channels, a new frame can be sent
right after the previous frame was transmitted, i.e., they are sent
back-to-back, and this is not supported by the CSMA channel.


Best,
Irek
> --
> 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/7pXhwJ5T6p4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ns-3-users+...@googlegroups.com
> <mailto:ns-3-users+...@googlegroups.com>.
> To post to this group, send email to ns-3-...@googlegroups.com
> <mailto:ns-3-...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/ns-3-users.

Hugo Sousa Pinto

unread,
Mar 18, 2016, 2:47:03 PM3/18/16
to ns-3-users
Hey i changed the code myself to create a full duplex ethernet, nothing like in shape for being released but let me know if you want me to send you the zip. Seems to work well in the sense that the link can be fully utilized.

Hugo

jo...@berkeley.edu

unread,
Jul 8, 2016, 5:50:36 PM7/8/16
to ns-3-users
Hi Hugo, I would be interested in checking the code.

I have seen the discussion here https://codereview.appspot.com/5615049/ . Do you know if this patch has been merged?

Hugo Sousa Pinto

unread,
Jul 8, 2016, 5:58:40 PM7/8/16
to ns-3-...@googlegroups.com
Hello:

I remember I changed the code myself. Do you want to see my code? I don't think this is part of the official review yet.

Hugo

> To post to this group, send email to ns-3-...@googlegroups.com
> <mailto:ns-3-...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.

--
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/7pXhwJ5T6p4/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.

jo...@berkeley.edu

unread,
Jul 8, 2016, 6:02:39 PM7/8/16
to ns-3-users
Yes. Can you send that (attach or link)? Thanks
> To post to this group, send email to ns-3-...@googlegroups.com
> <mailto:ns-3-...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.

Hugo Sousa Pinto

unread,
Jul 8, 2016, 6:12:52 PM7/8/16
to ns-3-...@googlegroups.com
Check this. Let me know your thoughts.

Hugo

> To post to this group, send email to ns-3-...@googlegroups.com
> <mailto:ns-3-...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.

--
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/7pXhwJ5T6p4/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 https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.
csma.tar.gz

SUBIN JOSEPH

unread,
Oct 21, 2016, 8:14:16 AM10/21/16
to ns-3-users
Hello Hugo,
Does it work correctly.Would it be possible for your to upload the updated version of the code?
Regards
Subin
> To post to this group, send email to ns-3-...@googlegroups.com
> <mailto:ns-3-...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.

--
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/7pXhwJ5T6p4/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 https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Hugo Sousa Pinto

unread,
Nov 4, 2016, 7:58:52 PM11/4/16
to ns-3-...@googlegroups.com
Hello,

Can you see the tar.gz file I attached in the previous e-mail?

Best,
Hugo

> To post to this group, send email to ns-3-...@googlegroups.com
> <mailto:ns-3-...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.

--
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/7pXhwJ5T6p4/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 https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

--
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/7pXhwJ5T6p4/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 https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

--
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/7pXhwJ5T6p4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages