|
|
Created:
13 years, 3 months ago by Jeff Y Modified:
10 years, 1 month ago CC:
ns-3-reviews_googlegroups.com Visibility:
Public. |
DescriptionNew feature - switched-ethernet-device
Patch Set 1 #
Total comments: 76
MessagesTotal messages: 35
Overall, this seems good. Just two questions/comments: - Do you have a plan to validate the implementation (e.g. comparing it to real world results)? - Do you have a plan to implement a model for any kind of Ethernet switch? This would be very useful for colleges teaching Computer Networks 101 on ns-3. http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... File src/switched-ethernet/model/switched-ethernet-channel.cc (right): http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.cc:228: for (it = m_deviceList.begin (); it < m_deviceList.end(); it++) Because you have only two devices, this for loop can be eliminated and code can be simplified. http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.cc:260: SwitchedEthernetChannel::GetNumActDevices (void) Please rename to GetNActiveDevices() http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... File src/switched-ethernet/model/switched-ethernet-channel.h (right): http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:43: class SwitchedEthernetDeviceRec { I would eliminated this class entirely and just store pointers to devices in the channel object. http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:55: bool IsActive(); This function doesn't do anything special, so you can safely assume that devices are active when attached. http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:63: enum FullDuplexWireState Please put this inside the SwitchedEthernetChannel class, and introduces some kind of prefix, such as FULL_DUPLEX_WIRE_ or so, i.e. IDLE_STATE would become FULL_DUPLEX_WIRE_IDLE_STATE. http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:329: * Current state of the channel It's clear what it means from looking at the code, but please explain this a bit better (something along the lines of "current state of the channel wires looking from the perspective of sender") http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:332: FullDuplexWireState m_State[2]; m_state instead of m_State http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... File src/switched-ethernet/model/switched-ethernet-net-device.cc (right): http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.cc:266: SwitchedEthernetNetDevice::AddHeader (Ptr<Packet> p, Mac48Address source, Mac48Address dest, uint16_t protocolNumber) To avoid code duplicaton, we should discuss factoring out this method and related stuff in ProcessHeader/Receive() along with similar methods for PppHeader and putting it into network/utils. Please start a discussion on the topic on ns-developers mailing list. http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.cc:425: NS_ASSERT_MSG ((m_txMachineState == READY) || (m_txMachineState == BACKOFF), Is BACKOFF case possible? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.cc:490: NS_ASSERT_MSG (m_txMachineState == BACKOFF, "Must be in BACKOFF state to abort. Tx state is: " << m_txMachineState); Same comment as above. http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... File src/switched-ethernet/model/switched-ethernet-net-device.h (right): http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:63: ILLEGAL, /**< Encapsulation mode not set */ Please prefix these with ENCAPSULATION_MODE_ http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:437: READY, /**< The transmitter is ready to begin transmission of a packet */ Please prefix these with TX_MACHINE_STATE_
Sign in to reply to this message.
Mostly minor comments. Not-minor: need a page for the Models manual. Major: After reading everything I realize I don't understand the model being implemented here. Is this supposed to be a switch? or just a full-duplex NIC, of which a switch contains many? (If not a switch, discuss in the Model page how to implement one, or provide an implementation.) http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/examples/s... File src/switched-ethernet/examples/switched-ethernet-packet-socket.cc (right): http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/examples/s... src/switched-ethernet/examples/switched-ethernet-packet-socket.cc:73: NS_LOG_INFO ("Create channels."); channel http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... File src/switched-ethernet/helper/switched-ethernet-helper.cc (right): http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... src/switched-ethernet/helper/switched-ethernet-helper.cc:42: Helpers aren't NS_OBJECT_ENSURE_REGISTERED ()? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... src/switched-ethernet/helper/switched-ethernet-helper.cc:200: oss << "/NodeList/" << nd->GetNode ()->GetId () << "/DeviceList/" << deviceid << "/$ns3::SwitchedEthernetNetDevice/MacRx"; nodeId...NetDevice/" http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... src/switched-ethernet/helper/switched-ethernet-helper.cc:201: Config::Connect (oss.str (), MakeBoundCallback (&AsciiTraceHelper::DefaultReceiveSinkWithContext, stream)); oss.str ( ) + "MacRx" http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... src/switched-ethernet/helper/switched-ethernet-helper.cc:203: oss.str (""); Delete http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... src/switched-ethernet/helper/switched-ethernet-helper.cc:204: oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::SwitchedEthernetNetDevice/TxQueue/Enqueue"; oss << "TxQueue/"; http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... src/switched-ethernet/helper/switched-ethernet-helper.cc:205: Config::Connect (oss.str (), MakeBoundCallback (&AsciiTraceHelper::DefaultEnqueueSinkWithContext, stream)); oss.str () + "Enqueue" http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... src/switched-ethernet/helper/switched-ethernet-helper.cc:207: oss.str (""); Delete http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... src/switched-ethernet/helper/switched-ethernet-helper.cc:208: oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::SwitchedEthernetNetDevice/TxQueue/Dequeue"; Delete http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... src/switched-ethernet/helper/switched-ethernet-helper.cc:209: Config::Connect (oss.str (), MakeBoundCallback (&AsciiTraceHelper::DefaultDequeueSinkWithContext, stream)); OSS.str () + "Dequeue" http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... src/switched-ethernet/helper/switched-ethernet-helper.cc:211: oss.str (""); Delete http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... src/switched-ethernet/helper/switched-ethernet-helper.cc:212: oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::SwitchedEthernetNetDevice/TxQueue/Drop"; Delete http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... src/switched-ethernet/helper/switched-ethernet-helper.cc:213: Config::Connect (oss.str (), MakeBoundCallback (&AsciiTraceHelper::DefaultDropSinkWithContext, stream)); oss.str () + "Drop" http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... File src/switched-ethernet/helper/switched-ethernet-helper.h (right): http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... src/switched-ethernet/helper/switched-ethernet-helper.h:65: * \param v4 the value of the attribute to set on the queue Why so many args? Could you use SetQueue (type); SetQueueAttribute (n1, v1); instead? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... src/switched-ethernet/helper/switched-ethernet-helper.h:200: Ptr<NetDevice> InstallPriv (Ptr<Node> node, Ptr<SwitchedEthernetChannel> channel) const; Why not just use public method? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/helper/swi... src/switched-ethernet/helper/switched-ethernet-helper.h:225: * \param nd Net device for which you want to enable tracing. \param explicitFilename http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... File src/switched-ethernet/model/switched-ethernet-channel.cc (right): http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.cc:45: MakeDataRateChecker ()) How do Attributes show up in Doxygen? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.cc:61: m_deviceList.clear(); .reserve (2)? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.cc:110: if (deviceId < m_deviceList.size ()) deviceId >= size () http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.cc:221: NS_LOG_LOGIC ("Schedule event in " << m_delay.GetSeconds () << " sec"); Which event? PropagationComplete? Can this go next to the Schedule call? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.cc:239: devId++; Put this in for () to make clear there are multiple counters? Even simpler, just use devId as the only for loop var, and m_deviceList[devId] to access. http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.cc:305: i++; Put this in for () to make clear there are multiple counters? Even simpler, just use I as the only for loop var, and m_deviceList[i] to access. http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... File src/switched-ethernet/model/switched-ethernet-channel.h (right): http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:38: * \brief CsmaNetDevice Record SwitchedEthernetNetDevice http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:43: class SwitchedEthernetDeviceRec { Shouldn't this be private to SwitchedEthernetChannel? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:45: Ptr< SwitchedEthernetNetDevice > devicePtr; /// Pointer to the net device m_devicePtr? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:46: bool active; /// Is net device enabled to TX/RX m_active? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:60: * conflict with the csma-channel definition for WireState Why is this outside the channel class? Inside would avoid conflict and renaming. If it needs to be visible without knowing the type of channel, could it be in the Channel class? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:92: * \param device Device pointer to the netdevice to attach to the channel Ptr to the SwitchedEthernetNetDevice... And others below. http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:95: int32_t Attach (Ptr<SwitchedEthernetNetDevice> device); Return uint32_t? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:137: bool Reattach(uint32_t deviceId); I'd prefer to have e Detaches in the same order as Attaches. http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:158: * until the packet has completely reached all destinations. "reached the other device." http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:174: * propagated to all net devices attached to the channel. The "propagated to the other net device..." http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:176: * will free the channel for further transmissions. Stores the Do we need to document here the internals (caching the packet)? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:204: * channel Document -1, -2 error codes. http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:256: * \return Get a NetDevice pointer to a connected network device. \brief, and the next one http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:305: * Devices are nor removed from this list, they are marked as "are not..." http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:312: std::vector<SwitchedEthernetDeviceRec> m_deviceList; Why is this a vector, below you have simple arrays [2]? Simple arrays would let you simplify all the loops; just check each of two entries. http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-channel.h:319: Ptr<Packet> m_currentPkt[2]; Why [2]? And below. http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... File src/switched-ethernet/model/switched-ethernet-net-device.cc (right): http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.cc:355: #if 0 Remove this outline? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.cc:451: NS_LOG_WARN ("Channel TransmitStart returns an error"); "returned an error, though in IDLE_STATE" http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.cc:530: NS_ASSERT (m_channel->GetState(m_deviceId) == TRANSMITTING_STATE); NS_ASSERT_MSG? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.cc:681: trailer.CheckFcs (packet); Why make this call and discard return value, then repeat call on next line? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.cc:711: protocol = header.GetLengthType (); Put this before if, to save a redundant call? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.cc:927: if (m_queue->IsEmpty () == false) ! m_queue->IsEmpty () http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... File src/switched-ethernet/model/switched-ethernet-net-device.h (right): http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:94: * The function Attach is used to add a SwitchedEthernetNetDevice to a SwitchedEthernetChannel. Break line (too long) http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:98: * \param ch a pointer to the channel to which this object is being attached. \param ch Ptr to the... Also clarify all Ptr arguments below http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:100: bool Attach (Ptr<SwitchedEthernetChannel> ch); Document meaning of \return http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:105: * The SwitchedEthernetNetDevice "owns" a queue. This queue may be set by higher Break line http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:126: * the packet receive chain to simulate data errors in during transmission. "data errors during" (delete "in") http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:143: * \param sender the SwitchedEthernetNetDevice that transmitted the packet in the first place Break line http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:152: bool IsSendEnabled (void); Should be const? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:166: bool IsReceiveEnabled (void); Should be const? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:188: SwitchedEthernetNetDevice::EncapsulationMode GetEncapsulationMode (void); Should be const? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:216: * to an EUI-48-based SwitchedEthernet device. This MAC address is encapsulated in an Break line http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:260: virtual bool SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, Break line http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:300: virtual Address GetMulticast (Ipv6Address addr) const; Move up to follow GetMulticast(Ipv4)? http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:323: void AddHeader (Ptr<Packet> p, Mac48Address source, Mac48Address dest, uint16_t protocolNumber); Break line http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:464: * The interframe gap that the Net Device uses insert time between packet "Device inserts between" http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:478: * The SwitchedEthernetChannel to which this SwitchedEthernetNetDevice has been Break line http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:486: * Management of this Queue has been delegated to the SwitchedEthernetNetDevice Break line http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:595: * On the transmit size, this trace hook will fire after a packet is dequeued "transmit side," http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:612: * to the device. This trace source fire on packets destined for any host "source fires" http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:646: * The callback used to notify higher layers that a packet has been received in promiscuous mode. Break line http://codereview.appspot.com/5615049/diff/1/src/switched-ethernet/model/swit... src/switched-ethernet/model/switched-ethernet-net-device.h:651: * The interface index (really net evice index) that has been assigned to "net device index"
Sign in to reply to this message.
> Overall, this seems good. Just two questions/comments: > - Do you have a plan to validate the implementation (e.g. comparing it to real > world results)? > - Do you have a plan to implement a model for any kind of Ethernet switch? This > would be very useful for colleges teaching Computer Networks 101 on ns-3. Vedran, Thanks for the comments - I'll make these changes and re-upload. In answer to your questions: 1) I haven't really thought about validating this particular patch since it is really just a model for a full-duplex channel (Ethernet cable and simple ethernet NIC) connected to a switch. Validation seems like it might make more sense for a switch model (which this patch doesn't include). 2) I talked to George Riley previously about creating an L2 switch, and I think this is a really good idea. However, I determined I didn't need that much fidelity for the simulations I was running, so I used Gustavo's CSMA bridge to fill in as a simple switch. I would be willing to help get this started as a separate feature, but I'll be honest that I don't have a great deal of time currently to devote to it.
Sign in to reply to this message.
On 2012/07/16 20:08:48, Peter Barnes wrote: > Mostly minor comments. > > Not-minor: need a page for the Models manual. > > Major: After reading everything I realize I don't understand the model being > implemented here. Is this supposed to be a switch? or just a full-duplex NIC, > of which a switch contains many? (If not a switch, discuss in the Model page > how to implement one, or provide an implementation.) > Hi Peter, Thank you for the comments - I'll merge these along with Vedran's changes. The model page is a good idea. Can you point me to any documentation on how to contribute new text to the models document? This is just a full-duplex NIC model (i.e. a NIC that sits at an endpoint in a server blade) and a full-duplex Ethernet cable (switched-ethernet-channel) that can be connected to an Ethernet switch. In order to have the most accurate representation of switched ethernet model, an L2 switch would be best. However, I have used this model with the CSMA bridge model and custom delays (cut-through latency for a commercial L2 switch) to get a pretty close approximation of actual packet latency. I can add the description of a switch to the model documentation, but I think it would take me a little while to code up and test a switch design that is customizable (varying pipeline depth, crossbar delay, number of ports, etc). I see this patch as an intermediate step that allows a more faithful simulation of switched Ethernet but one that must be used with a few caveats (since it does not include a switch model).
Sign in to reply to this message.
On 2012/07/17 16:14:36, Jeff Y wrote: > On 2012/07/16 20:08:48, Peter Barnes wrote: > > Mostly minor comments. > > > > Not-minor: need a page for the Models manual. > > > > Major: After reading everything I realize I don't understand the model being > > implemented here. Is this supposed to be a switch? or just a full-duplex NIC, > > of which a switch contains many? (If not a switch, discuss in the Model page > > how to implement one, or provide an implementation.) > > > Hi Peter, > > Thank you for the comments - I'll merge these along with Vedran's changes. > > The model page is a good idea. Can you point me to any documentation on how to > contribute new text to the models document? If you cd into ns-3-dev/src and run "./create-module.py switched-ethernet", it will generate a skeleton module named switched-ethernet for you. If you descend into the doc directory, you should find an outline of a model chapter, outlining the suggested material to cover. For a worked example (written before this template was formed, but overall is close to your device type): http://www.nsnam.org/docs/release/3.14/models/html/csma.html This file then needs to be added to the Makefile in ns-3-dev/doc/models/ > > This is just a full-duplex NIC model (i.e. a NIC that sits at an endpoint in a > server blade) and a full-duplex Ethernet cable (switched-ethernet-channel) that > can be connected to an Ethernet switch. In order to have the most accurate > representation of switched ethernet model, an L2 switch would be best. However, > I have used this model with the CSMA bridge model and custom delays (cut-through > latency for a commercial L2 switch) to get a pretty close approximation of > actual packet latency. if you have any documentation of how you convinced yourself that the latency in the model is close to real-world, you can add a summary or details in a validation section in the model library chapter. I can add the description of a switch to the model > documentation, but I think it would take me a little while to code up and test a > switch design that is customizable (varying pipeline depth, crossbar delay, > number of ports, etc). I see this patch as an intermediate step that allows a > more faithful simulation of switched Ethernet but one that must be used with a > few caveats (since it does not include a switch model).
Sign in to reply to this message.
Aside from Vedran and Peter's comments, I think it is hard to merge this without any test code (for regression testing). Do you need any help in creating such tests? Once you've updated the patch set, I'll try to make another detailed review.
Sign in to reply to this message.
Tom, Thanks for the pointer. I think that I used an earlier version of the script that didn't generate all the directories for new chapter, but I can add this in. I can put in some links to published numbers for switch latencies, but this really varies by company and changes over time as technology improves. There is also the problem that most switches don't detail their internal structure, so the cut-through latency is based on a "black box". I've used csma-bridge as a "black box", so this approach is OK for having an approximate latency. For any future L2 switch model, I'd rather focus on detailing how a switch can be built with tunable parameters for the internal components and then maybe worry about matching up performance with real systems.
Sign in to reply to this message.
On 2012/07/25 13:08:35, Tom Henderson wrote: > Aside from Vedran and Peter's comments, I think it is hard to merge this without > any test code (for regression testing). Do you need any help in creating such > tests? > > Once you've updated the patch set, I'll try to make another detailed review. Tom, Would it be suitable to build off the "src/test/csma-system-test-suite.cc" file for this test, or did you need something more substantial? I could add in some code to check that packets can be sent and received simultaneously (so send packets from n0 ==> n1 and also n1 ==> n0).
Sign in to reply to this message.
Jeff, do you have any interest in trying to move this forward now? I was discussing it with another potential user today who expressed interest in it.
Sign in to reply to this message.
Hi Tom, I would definitely be interested in getting this merged. I'd probably need to port it to the latest build of NS-3 and shoot for the 3.19 release right? The main reason it was delayed (if I remember correctly) was a request for additional documentation on how to build a L2-based switch model, which this patch doesn't provide. I wrote some of the documentation on how such a switch could be constructed, but I'm not sure if there was something else that was required. --Jeff On Wed, Aug 21, 2013 at 10:53 PM, <tomh.org@gmail.com> wrote: > Jeff, do you have any interest in trying to move this forward now? I > was discussing it with another potential user today who expressed > interest in it. > > https://codereview.appspot.**com/5615049/<https://codereview.appspot.com/5615... >
Sign in to reply to this message.
Jeff, have you considered the possibility of sharing the code between this and csma, as in reusing the common part?
Sign in to reply to this message.
Vedran, This would probably be a good idea. I haven't looked at the CSMA code in a while (I assume it hasn't changed much), but switched-ethernet is really just CSMA with no backoff and two channels for simultaneous RX/TX. I'll check next week to see if this is feasible. --Jeff
Sign in to reply to this message.
On 2013/08/22 16:37:41, Jeff Y wrote: > Vedran, > > This would probably be a good idea. I haven't looked at the CSMA code in a > while (I assume it hasn't changed much), but switched-ethernet is really just > CSMA with no backoff and two channels for simultaneous RX/TX. I'll check next > week to see if this is feasible. > > --Jeff It looks like this got dropped, but I needed it. So I took it as a starting point and reimplemented it atop current csma. At construction time, you can now specify whether you want full duplex mode; it falls back if you ever add more than two devices. I haven't tested it extensively (I've only been working on it today), but it seems to work as expected for me thus far. I know y'all have a submission process and this isn't it, but the code is in my github fork if someone wants to run with it: https://github.com/MurphyMc/ns-3-dev-git/commits/feature_csma_full_duplex
Sign in to reply to this message.
Murphy, Thanks for your mail. I transitioned jobs right around the time this patch was reconsidered last year, so I haven't had time to look at it further. If I remember correctly, the sticking point was that Vedran wanted to merge the full-duplex code with the base CSMA code (rather than having separate modules), and it sounds like your code might be a good start towards this. I'd be glad to help review your code to patch this, but I probably can't dedicate much development time to my original code at the moment. --Jeff On Sat, Aug 16, 2014 at 5:18 AM, <murphy.mccauley@gmail.com> wrote: > On 2013/08/22 16:37:41, Jeff Y wrote: > >> Vedran, >> > > This would probably be a good idea. I haven't looked at the CSMA >> > code in a > >> while (I assume it hasn't changed much), but switched-ethernet is >> > really just > >> CSMA with no backoff and two channels for simultaneous RX/TX. I'll >> > check next > >> week to see if this is feasible. >> > > --Jeff >> > > It looks like this got dropped, but I needed it. So I took it as a > starting point and reimplemented it atop current csma. At construction > time, you can now specify whether you want full duplex mode; it falls > back if you ever add more than two devices. I haven't tested it > extensively (I've only been working on it today), but it seems to work > as expected for me thus far. > > I know y'all have a submission process and this isn't it, but the code > is in my github fork if someone wants to run with it: > https://github.com/MurphyMc/ns-3-dev-git/commits/feature_csma_full_duplex > > https://codereview.appspot.com/5615049/ >
Sign in to reply to this message.
Hello, I also needed this code for a project, and so I was exploring it a bit, and it looks like there are some parts of the code that are only needed for half-duplex csma that weren't dropped. In particular, with full-duplex communication, I don't understand why you need the backoff state in the netdevice, and I don't think you should have the propagating state in the wire state, because you don't need anymore to wait until the signal has reached all devices to make sure there were no collisions. Let me know your thoughts. I would also like to know if you are planning on integrating this in any next ns3 release. Hugo
Sign in to reply to this message.
Hello, I also needed this code for a project, and so I was exploring it a bit, and it looks like there are some parts of the code that are only needed for half-duplex csma that weren't dropped. In particular, with full-duplex communication, I don't understand why you need the backoff state in the netdevice, and I don't think you should have the propagating state in the wire state, because you don't need anymore to wait until the signal has reached all devices to make sure there were no collisions. Let me know your thoughts. I would also like to know if you are planning on integrating this in any next ns3 release. Hugo
Sign in to reply to this message.
On 2014/09/29 14:47:19, hugo.s.pinto wrote: > Hello, > > I also needed this code for a project, and so I was exploring it a bit, and it > looks like there are some parts of the code that are only needed for half-duplex > csma that weren't dropped. In particular, with full-duplex communication, I > don't understand why you need the backoff state in the netdevice, and I don't > think you should have the propagating state in the wire state, because you don't > need anymore to wait until the signal has reached all devices to make sure there > were no collisions. > > Let me know your thoughts. I would also like to know if you are planning on > integrating this in any next ns3 release. > > Hugo Hugo, I would be happy to put this into the release roadmap but we will need a shepherd to do so. I don't have the time to drive it myself, at the moment, but I'd be happy to guide someone who has some time to move it forward (by this, I mean that I would provide some suggestions on how to get started, how to resolve issues encountered, ...). Do you or anyone else want to do this? Please have a look at the other CSMA improvements proposed here. http://www.nsnam.org/wiki/Current_Development#CSMA_model In brief, there probably needs to be a decision on structurally how we want to accomplish this (merge with CSMA or keep separate), and then the code needs to have some more documentation and testing written around it before we could add it to the release.
Sign in to reply to this message.
On 2014/09/29 14:47:19, hugo.s.pinto wrote: > Hello, > > I also needed this code for a project, and so I was exploring it a bit, and it > looks like there are some parts of the code that are only needed for half-duplex > csma that weren't dropped. In particular, with full-duplex communication, I > don't understand why you need the backoff state in the netdevice, and I don't > think you should have the propagating state in the wire state, because you don't > need anymore to wait until the signal has reached all devices to make sure there > were no collisions. > > Let me know your thoughts. I would also like to know if you are planning on > integrating this in any next ns3 release. > > Hugo Just a note that in the case of my patch, that's all needed (since mine incorporates both full and half duplex).
Sign in to reply to this message.
Murphy, do you have any example code that uses your full duplex implementation? As I understand, you would need to have 2 CSMA channel instances to have a full duplex-channel, but I would like to see some code where the topology is created. Also, have you considered creating a helper? Also, what do you think about my previous comments, regarding correctness of the algorithm? I was also wondering if it would make send to make one device only SendEnabled, and another only ReceiveEnabled. Tom, I am also a bit tight on time right now, but I could contribute on the full-duplex part of the problem. Thanks, Hugo On Tue, Sep 30, 2014 at 1:21 AM, <murphy.mccauley@gmail.com> wrote: > On 2014/09/29 14:47:19, hugo.s.pinto wrote: > >> Hello, >> > > I also needed this code for a project, and so I was exploring it a >> > bit, and it > >> looks like there are some parts of the code that are only needed for >> > half-duplex > >> csma that weren't dropped. In particular, with full-duplex >> > communication, I > >> don't understand why you need the backoff state in the netdevice, and >> > I don't > >> think you should have the propagating state in the wire state, because >> > you don't > >> need anymore to wait until the signal has reached all devices to make >> > sure there > >> were no collisions. >> > > Let me know your thoughts. I would also like to know if you are >> > planning on > >> integrating this in any next ns3 release. >> > > Hugo >> > > Just a note that in the case of my patch, that's all needed (since mine > incorporates both full and half duplex). > > https://codereview.appspot.com/5615049/ >
Sign in to reply to this message.
On 2014/09/30 16:21:33, hugo.s.pinto wrote: > > Tom, I am also a bit tight on time right now, but I could contribute on the > full-duplex part of the problem. > One possible way forward is to do both of the following: * extend existing CSMA module so that it has two modes: full-duplex and half-duplex (existing behavior) -- should full-duplex be the default going forward? * improve the half-duplex behavior, starting with https://codereview.appspot.com/109450044/ Questions: 1) is it too much of a misnomer to have a full-duplex Ethernet in a module named CSMA (which is not even a full CSMA/CD model in half-duplex mode)? The answer to this depends, I guess, on what users will find useful to model and use in their simulations. Do the developers interested in this (Jeff Y., MurphyMC, hugo) have any interest in the half-duplex CSMA mode? If not, perhaps we could consider a new model more along the lines of Jeff Y.s original patch? Opinions? What features in the Ethernet model are of most interest to people? In other words, we might consider to evolve the existing CSMA as a historical "shared medium" kind of model, implementing improvements suggested above, but then have a separate full duplex Ethernet model. 2) we ought to have an Ethernet switch model at some point. Are there any issues we should be concerned about in anticipating this, or are the existing proposals expected to be already compatible with some future-defined Ethernet switch model?
Sign in to reply to this message.
On Sep 30, 2014, at 1:23 PM, tomh.org@gmail.com wrote: > One possible way forward is to do both of the following: > > * extend existing CSMA module so that it has two modes: full-duplex and half-duplex (existing behavior) > -- should full-duplex be the default going forward? > > * improve the half-duplex behavior, starting with > https://codereview.appspot.com/109450044/ > > Questions: > > 1) is it too much of a misnomer to have a full-duplex Ethernet in a > module named CSMA (which is not even a full CSMA/CD model in half-duplex mode)? On the one hand, when I plug in an Ethernet cable, the box figures out if it's one of two devices (and enters full duplex), or one of many (and enters half-duplex CD). It would be nice to if ns-3 was so smart. > ... > In other words, we might consider to evolve the existing CSMA as a > historical "shared medium" kind of model, implementing improvements > suggested above, but then have a separate full duplex Ethernet model. On the other hand, it might be cleaner to leave the existing CSMA/CA as an historical shared channel abstraction, and launch a new CSMA/CD half/full duplex model. I think all the pieces are lying around... > 2) we ought to have an Ethernet switch model at some point. Are there any issues we should be concerned about in anticipating this, or are the existing proposals expected to be already compatible with some future-defined Ethernet switch model? How is a (real) Ethernet switch different from the SwitchedEthernetDevice proposed here? Just half/full negotiation? > https://codereview.appspot.com/5615049/ _______________________________________________________________________ Dr. Peter D. Barnes, Jr. Physics Division Lawrence Livermore National Laboratory Physical and Life Sciences 7000 East Avenue, L-50 email: pdbarnes@llnl.gov P. O. Box 808 Voice: (925) 422-3384 Livermore, California 94550 Fax: (925) 423-3371
Sign in to reply to this message.
On 2014/09/30 20:36:20, barnes26_llnl.gov wrote: > On Sep 30, 2014, at 1:23 PM, mailto:tomh.org@gmail.com wrote: > > One possible way forward is to do both of the following: > > > > * extend existing CSMA module so that it has two modes: full-duplex and > half-duplex (existing behavior) > > -- should full-duplex be the default going forward? > > > > * improve the half-duplex behavior, starting with > > https://codereview.appspot.com/109450044/ > > > > Questions: > > > > 1) is it too much of a misnomer to have a full-duplex Ethernet in a > > module named CSMA (which is not even a full CSMA/CD model in half-duplex > mode)? > > On the one hand, when I plug in an Ethernet cable, the box figures out if it's > one of two devices (and enters full duplex), or one of many (and enters > half-duplex CD). It would be nice to if ns-3 was so smart. > > > > ... > > In other words, we might consider to evolve the existing CSMA as a > > historical "shared medium" kind of model, implementing improvements > > suggested above, but then have a separate full duplex Ethernet model. > > On the other hand, it might be cleaner to leave the existing CSMA/CA as an > historical shared channel abstraction, and launch a new CSMA/CD half/full duplex > model. I think all the pieces are lying around... I would be fine with this outcome, if we can find a shepherd/maintainer for getting this done. > > > 2) we ought to have an Ethernet switch model at some point. Are there any > issues we should be concerned about in anticipating this, or are the existing > proposals expected to be already compatible with some future-defined Ethernet > switch model? > > How is a (real) Ethernet switch different from the SwitchedEthernetDevice > proposed here? Just half/full negotiation? I am guessing that people may want to build nodes that are models of switches (as opposed to our host-centric node models), that have different buffering architectures, and have to deal with e.g. port line rate mismatches, or large shortest-path-bridging networks someday, etc.
Sign in to reply to this message.
> > How is a (real) Ethernet switch different from the SwitchedEthernetDevice > > proposed here? Just half/full negotiation? > > I am guessing that people may want to build nodes that are models of switches > (as opposed to our host-centric node models), that have different buffering > architectures, and have to deal with e.g. port line rate mismatches, or large > shortest-path-bridging networks someday, etc. But to clarify my comment here, I was asking (perhaps as you are) whether the device model we do now for hosts would be incompatible if one were to put it into a 'switch' node that implements these things, in the future.
Sign in to reply to this message.
On 2014/09/30 16:21:33, hugo.s.pinto wrote: > Murphy, do you have any example code that uses your full duplex > implementation? As I understand, you would need to have 2 CSMA channel > instances to have a full duplex-channel, but I would like to see some code > where the topology is created. Also, have you considered creating a helper? I didn't see a reason to have a separate helper. If I remember right, one can use the existing helper and existing half-duplex setup/topology code (where a given channel has only two devices on it) and convert it to full-duplex with a single line of code -- use SetChannelAttribute to set FullDuplex to true on the helper and you're done. You don't need two CSMA channel instances. Like the original patch, mine keeps two copies of various data. In the half-duplex case, it uses only one of them, sharing between directions. In the full-duplex case, it uses one for one direction and the other for the other direction. > Also, what do you think about my previous comments, regarding correctness > of the algorithm? I was also wondering if it would make send to make one > device only SendEnabled, and another only ReceiveEnabled. > > Tom, I am also a bit tight on time right now, but I could contribute on the > full-duplex part of the problem. > > Thanks, > Hugo > > > On Tue, Sep 30, 2014 at 1:21 AM, <mailto:murphy.mccauley@gmail.com> wrote: > > > On 2014/09/29 14:47:19, hugo.s.pinto wrote: > > > >> Hello, > >> > > > > I also needed this code for a project, and so I was exploring it a > >> > > bit, and it > > > >> looks like there are some parts of the code that are only needed for > >> > > half-duplex > > > >> csma that weren't dropped. In particular, with full-duplex > >> > > communication, I > > > >> don't understand why you need the backoff state in the netdevice, and > >> > > I don't > > > >> think you should have the propagating state in the wire state, because > >> > > you don't > > > >> need anymore to wait until the signal has reached all devices to make > >> > > sure there > > > >> were no collisions. > >> > > > > Let me know your thoughts. I would also like to know if you are > >> > > planning on > > > >> integrating this in any next ns3 release. > >> > > > > Hugo > >> > > > > Just a note that in the case of my patch, that's all needed (since mine > > incorporates both full and half duplex). > > > > https://codereview.appspot.com/5615049/ > >
Sign in to reply to this message.
To briefly weigh in - Peter makes a good point about naming issues since a full-duplex Ethernet link doesn't really need CSMA and renaming CSMA would cause issues with existing code. My suggestion would be to start from Murphy's patch and create a separate "Switched-Ethernet" or "Full-Duplex-Ethernet" model to avoid confusion. My "SwitchedEthernetDevice" may be slightly misnamed in that it is just a full-duplex Ethernet link that I used with a normal node and the csma-bridge helper for a simple, delay-based switch. To answer Tom's question, "Whether the device model we do now for hosts would be incompatible if one were to put it into a 'switch' node that implements these things": I don't think so, but that may just be because I was thinking about a very simple switch model. Another researcher I talked to, Mike Schlansker at HP, indicated that the netdevice model was the main limitation for creating multi-port switches. From his email: "The netdevice holds dedicated queuing needed for exactly one output port. Our initial attempts to build a multiport switch on top of a netdevice resulted in a switch with a separate output buffers for each output port. More realistic switches, that I wanted to model, shared buffering between multiple output ports." My understanding of this is that sharing an output port would require a separate netdevice model to support this type of switch. --Jeff On Tue, Sep 30, 2014 at 6:05 PM, <murphy.mccauley@gmail.com> wrote: > On 2014/09/30 16:21:33, hugo.s.pinto wrote: > >> Murphy, do you have any example code that uses your full duplex >> implementation? As I understand, you would need to have 2 CSMA channel >> instances to have a full duplex-channel, but I would like to see some >> > code > >> where the topology is created. Also, have you considered creating a >> > helper? > > I didn't see a reason to have a separate helper. If I remember right, > one can use the existing helper and existing half-duplex setup/topology > code (where a given channel has only two devices on it) and convert it > to full-duplex with a single line of code -- use SetChannelAttribute to > set FullDuplex to true on the helper and you're done. > > You don't need two CSMA channel instances. Like the original patch, > mine keeps two copies of various data. In the half-duplex case, it uses > only one of them, sharing between directions. In the full-duplex case, > it uses one for one direction and the other for the other direction. > > Also, what do you think about my previous comments, regarding >> > correctness > >> of the algorithm? I was also wondering if it would make send to make >> > one > >> device only SendEnabled, and another only ReceiveEnabled. >> > > Tom, I am also a bit tight on time right now, but I could contribute >> > on the > >> full-duplex part of the problem. >> > > Thanks, >> Hugo >> > > > On Tue, Sep 30, 2014 at 1:21 AM, <mailto:murphy.mccauley@gmail.com> >> > wrote: > > > On 2014/09/29 14:47:19, hugo.s.pinto wrote: >> > >> >> Hello, >> >> >> > >> > I also needed this code for a project, and so I was exploring it a >> >> >> > bit, and it >> > >> >> looks like there are some parts of the code that are only needed >> > for > >> >> >> > half-duplex >> > >> >> csma that weren't dropped. In particular, with full-duplex >> >> >> > communication, I >> > >> >> don't understand why you need the backoff state in the netdevice, >> > and > >> >> >> > I don't >> > >> >> think you should have the propagating state in the wire state, >> > because > >> >> >> > you don't >> > >> >> need anymore to wait until the signal has reached all devices to >> > make > >> >> >> > sure there >> > >> >> were no collisions. >> >> >> > >> > Let me know your thoughts. I would also like to know if you are >> >> >> > planning on >> > >> >> integrating this in any next ns3 release. >> >> >> > >> > Hugo >> >> >> > >> > Just a note that in the case of my patch, that's all needed (since >> > mine > >> > incorporates both full and half duplex). >> > >> > https://codereview.appspot.com/5615049/ >> > >> > > > https://codereview.appspot.com/5615049/ >
Sign in to reply to this message.
On 2014/10/01 15:13:53, Jeff Y wrote: > > To answer Tom's question, "Whether the device model we do now for hosts > would be incompatible if one were to put it into a 'switch' node that > implements these things": I don't think so, but that may just be because I > was thinking about a very simple switch model. > > Another researcher I talked to, Mike Schlansker at HP, indicated that the > netdevice model was the main limitation for creating multi-port switches. > From his email: "The netdevice holds dedicated queuing needed for exactly > one output port. Our initial attempts to build a multiport switch on top > of a netdevice resulted in a switch with a separate output buffers for each > output port. More realistic switches, that I wanted to model, shared > buffering between multiple output ports." My understanding of this is that > sharing an output port would require a separate netdevice model to support > this type of switch. The abstract base class for NetDevice doesn't constrain or specify any queueing model. The CSMA NetDevice type, however, uses ns3::Queue which is not designed for multi-port usage. So it may not be compatible at the CsmaNetDevice level, but at ns3::NetDevice, it seems like we could still handle shared memory with a different internal device organization than CsmaNetDevice. I wonder whether we could get better requirements written down regarding how we need to plan for supporting Ethernet switches (including both input and output buffering requirements, what service and drop policies are required by the buffers, etc.). If anyone has a good reference for this, please send it along ... - Tom
Sign in to reply to this message.
Tom, I also agree that having a full-duplex ethernet in a csma module is somewhat misleading. I would go for a separate module called ethernet, which as Peter suggested could potentially support both full and half-duplex modes. In my case, I have no interest in the half-duplex mode. The issue that I encountered were that there was no link-layer technology to connect switches with high bandwidth and high delay links. Regarding the availability of switches, I would like to point out that currently there are already some switch implementations, such as the openflow switch module, or the bridge module, which should of course work with whatever full-duplex model we end up developing (as I believe they do with the current patch) . It would also would be nice if the device could be made general enough to be used by more sophisticated switches, by e.g. configuring the device with an external queue. Hugo On Wed, Oct 1, 2014 at 5:59 PM, <tomh.org@gmail.com> wrote: > On 2014/10/01 15:13:53, Jeff Y wrote: > > > To answer Tom's question, "Whether the device model we do now for >> > hosts > >> would be incompatible if one were to put it into a 'switch' node that >> implements these things": I don't think so, but that may just be >> > because I > >> was thinking about a very simple switch model. >> > > Another researcher I talked to, Mike Schlansker at HP, indicated >> > that the > >> netdevice model was the main limitation for creating multi-port >> > switches. > >> From his email: "The netdevice holds dedicated queuing needed for >> > exactly > >> one output port. Our initial attempts to build a multiport switch on >> > top > >> of a netdevice resulted in a switch with a separate output buffers for >> > each > >> output port. More realistic switches, that I wanted to model, shared >> buffering between multiple output ports." My understanding of this is >> > that > >> sharing an output port would require a separate netdevice model to >> > support > >> this type of switch. >> > > The abstract base class for NetDevice doesn't constrain or specify any > queueing model. The CSMA NetDevice type, however, uses ns3::Queue which > is not designed for multi-port usage. So it may not be compatible at > the CsmaNetDevice level, but at ns3::NetDevice, it seems like we could > still handle shared memory with a different internal device organization > than CsmaNetDevice. > > I wonder whether we could get better requirements written down regarding > how we need to plan for supporting Ethernet switches (including both > input and output buffering requirements, what service and drop policies > are required by the buffers, etc.). If anyone has a good reference for > this, please send it along ... > > - Tom > > > > https://codereview.appspot.com/5615049/ >
Sign in to reply to this message.
Murphy, I understand your implementation now, and I see that you only use one device on each terminal. I believe that the following are bugs: i) in csma-net-device.cc, in function CsmaNetDevice::TransmitStart (void), m_txMachineState = BACKOFF; should be only in case of half-duplex links, otherwise state machine gets stuck in backoff mode. ii) in csma-channel.cc, in function CsmaChannel::TransmitEnd Simulator::Schedule (m_delay, &CsmaChannel::PropagationCompleteEvent, this, srcId); I believe that the device shouldn't be busy while propagating, because otherwise you cannot have high speed links.. (this delay will substantially limit the speeds you get). Let me know if you agree. Thank you, Hugo On Thu, Oct 2, 2014 at 4:44 PM, Hugo Sousa Pinto <hugo.s.pinto@gmail.com> wrote: > Tom, I also agree that having a full-duplex ethernet in a csma module is > somewhat misleading. I would go for a separate module called ethernet, > which as Peter suggested could potentially support both full and > half-duplex modes. > > In my case, I have no interest in the half-duplex mode. The issue that I > encountered were that there was no link-layer technology to connect > switches with high bandwidth and high delay links. > > Regarding the availability of switches, I would like to point out that > currently there are already some switch implementations, such as the > openflow switch module, or the bridge module, which should of course work > with whatever full-duplex model we end up developing (as I believe they do > with the current patch) . > > It would also would be nice if the device could be made general enough to > be used by more sophisticated switches, by e.g. configuring the device with > an external queue. > > Hugo > > > > > > > > > > > On Wed, Oct 1, 2014 at 5:59 PM, <tomh.org@gmail.com> wrote: > >> On 2014/10/01 15:13:53, Jeff Y wrote: >> >> >> To answer Tom's question, "Whether the device model we do now for >>> >> hosts >> >>> would be incompatible if one were to put it into a 'switch' node that >>> implements these things": I don't think so, but that may just be >>> >> because I >> >>> was thinking about a very simple switch model. >>> >> >> Another researcher I talked to, Mike Schlansker at HP, indicated >>> >> that the >> >>> netdevice model was the main limitation for creating multi-port >>> >> switches. >> >>> From his email: "The netdevice holds dedicated queuing needed for >>> >> exactly >> >>> one output port. Our initial attempts to build a multiport switch on >>> >> top >> >>> of a netdevice resulted in a switch with a separate output buffers for >>> >> each >> >>> output port. More realistic switches, that I wanted to model, shared >>> buffering between multiple output ports." My understanding of this is >>> >> that >> >>> sharing an output port would require a separate netdevice model to >>> >> support >> >>> this type of switch. >>> >> >> The abstract base class for NetDevice doesn't constrain or specify any >> queueing model. The CSMA NetDevice type, however, uses ns3::Queue which >> is not designed for multi-port usage. So it may not be compatible at >> the CsmaNetDevice level, but at ns3::NetDevice, it seems like we could >> still handle shared memory with a different internal device organization >> than CsmaNetDevice. >> >> I wonder whether we could get better requirements written down regarding >> how we need to plan for supporting Ethernet switches (including both >> input and output buffering requirements, what service and drop policies >> are required by the buffers, etc.). If anyone has a good reference for >> this, please send it along ... >> >> - Tom >> >> >> >> https://codereview.appspot.com/5615049/ >> > >
Sign in to reply to this message.
I'd like to move this forward if possible. It seemed that sentiment leaned towards a separate full-duplex ethernet module; should we try to move forward with that goal? We had a comment that the existing device model was not amenable to multiport, shared memory queue structures on the switch. However, it was stated that the 'bridge' module could serve as a stand-in until a better ethernet switch model could be developed. Agree? If so, can someone propose minimal functional requirements of the device to get us started thinking about validation tests? e.g. * the following attributes should be configurable on the device model and on the channel model... * the device should support channel delays of up to X ns (what to do if user exceeds assumptions about cable length)? * two devices should be able to be hooked up in cross-over configuration and support X Gb/s with packet sizes of X in full-duplex mode * two devices should be able to be hooked together with a 'bridge' device in between, and we ought to see what difference in performance with respect to cross-over cable connection? * N devices should be able to be hooked together with a 'bridge', and we should see the behavior change as follows... Should we take MurphyMc's patch as starting point? Who has time to contribute further to debugging, documenting, testing this (over the next two months)? The switch model could perhaps be suggested as a GSoC project if there are no takers now. For example, UIUC has developed some models and published here about them: http://web.engr.illinois.edu/~caesar/papers/ethsim.pdf Perhaps someone could try to port that work and use the tests in the paper as starting points?
Sign in to reply to this message.
On 2014/10/15 12:52:08, Tom Henderson wrote: > I'd like to move this forward if possible. It seemed that sentiment leaned > towards a separate full-duplex ethernet module; should we try to move forward > with that goal? When I needed this, I started by diffing Jeff Y's full duplex model against the CSMA model. They are extremely similar (as Jeff Y notes), though the CSMA model had gotten a few patches since they diverged. I also read the reviews of the original patch and found that many were actually reviews of things that existed in the CSMA model. This seemed like a bad road to go down. It seems to me like the maintenance work is increasing by duplicating code that's so similar and that the minor additional complexity of merging the code is a better route. I'll also note that 802.3 contains language like the following: "The Carrier Sense Multiple Access with Collision Detection (CSMA/CD) MAC protocol specifies shared medium (half duplex) operation, as well as full duplex operation." So whatever confusion comes from sticking them together is already a fact of life. :) I'm not particularly invested here, but thought I'd throw in some rationale for a single merged implementation. > We had a comment that the existing device model was not amenable to multiport, > shared memory queue structures on the switch. However, it was stated that the > 'bridge' module could serve as a stand-in until a better ethernet switch model > could be developed. Agree? I totally agree with this. The custom model I am using is based on the bridge. IMO the bridge is useful as-is, and it's a huge step up from half-duplex anything. > If so, can someone propose minimal functional requirements of the device to get > us started thinking about validation tests? e.g. > > * the following attributes should be configurable on the device model and on the > channel model... > * the device should support channel delays of up to X ns (what to do if user > exceeds assumptions about cable length)? > * two devices should be able to be hooked up in cross-over configuration and > support X Gb/s with packet sizes of X in full-duplex mode > * two devices should be able to be hooked together with a 'bridge' device in > between, and we ought to see what difference in performance with respect to > cross-over cable connection? > * N devices should be able to be hooked together with a 'bridge', and we should > see the behavior change as follows... > > Should we take MurphyMc's patch as starting point? Who has time to contribute > further to debugging, documenting, testing this (over the next two months)? If you're not planning on a merged implementation with CSMA, there's not much difference between my version and the original patch. Mine should have a couple extra patches from the mainline and slightly better adherence to ns-3 coding conventions, but it also adds some unnecessary complexity if it's not going to have both modes. > The switch model could perhaps be suggested as a GSoC project if there are no > takers now. For example, UIUC has developed some models and published here > about them: http://web.engr.illinois.edu/~caesar/papers/ethsim.pdf Perhaps > someone could try to port that work and use the tests in the paper as starting > points?
Sign in to reply to this message.
On 2014/10/06 21:52:49, hugo.s.pinto wrote: > Murphy, I understand your implementation now, and I see that you only use > one device on each terminal. I believe that the following are bugs: > > i) in csma-net-device.cc, in function CsmaNetDevice::TransmitStart (void), > m_txMachineState = BACKOFF; > > should be only in case of half-duplex links, otherwise state machine gets > stuck in backoff mode. > > ii) in csma-channel.cc, in function CsmaChannel::TransmitEnd > Simulator::Schedule (m_delay, &CsmaChannel::PropagationCompleteEvent, > this, srcId); > > I believe that the device shouldn't be busy while propagating, because > otherwise you cannot have high speed links.. (this delay will substantially > limit the speeds you get). Let me know if you agree. > > Thank you, > Hugo I didn't actually pay much attention to the logic -- it was my intention to replicate it from the original patch which had already been written and reviewed by people that no doubt know ns-3 better than I do. I was just trying to integrate the original patch with the CSMA model. That said, your comments seem reasonable and like they merit further review. As far as limiting the link speed, I will note that I didn't see this in my testing -- once I added full duplex, my results matched expectations. It's totally possible I just didn't run up against it. > > > > > > > > > > > > On Thu, Oct 2, 2014 at 4:44 PM, Hugo Sousa Pinto <mailto:hugo.s.pinto@gmail.com> > wrote: > > > Tom, I also agree that having a full-duplex ethernet in a csma module is > > somewhat misleading. I would go for a separate module called ethernet, > > which as Peter suggested could potentially support both full and > > half-duplex modes. > > > > In my case, I have no interest in the half-duplex mode. The issue that I > > encountered were that there was no link-layer technology to connect > > switches with high bandwidth and high delay links. > > > > Regarding the availability of switches, I would like to point out that > > currently there are already some switch implementations, such as the > > openflow switch module, or the bridge module, which should of course work > > with whatever full-duplex model we end up developing (as I believe they do > > with the current patch) . > > > > It would also would be nice if the device could be made general enough to > > be used by more sophisticated switches, by e.g. configuring the device with > > an external queue. > > > > Hugo > > > > > > > > > > > > > > > > > > > > > > On Wed, Oct 1, 2014 at 5:59 PM, <mailto:tomh.org@gmail.com> wrote: > > > >> On 2014/10/01 15:13:53, Jeff Y wrote: > >> > >> > >> To answer Tom's question, "Whether the device model we do now for > >>> > >> hosts > >> > >>> would be incompatible if one were to put it into a 'switch' node that > >>> implements these things": I don't think so, but that may just be > >>> > >> because I > >> > >>> was thinking about a very simple switch model. > >>> > >> > >> Another researcher I talked to, Mike Schlansker at HP, indicated > >>> > >> that the > >> > >>> netdevice model was the main limitation for creating multi-port > >>> > >> switches. > >> > >>> From his email: "The netdevice holds dedicated queuing needed for > >>> > >> exactly > >> > >>> one output port. Our initial attempts to build a multiport switch on > >>> > >> top > >> > >>> of a netdevice resulted in a switch with a separate output buffers for > >>> > >> each > >> > >>> output port. More realistic switches, that I wanted to model, shared > >>> buffering between multiple output ports." My understanding of this is > >>> > >> that > >> > >>> sharing an output port would require a separate netdevice model to > >>> > >> support > >> > >>> this type of switch. > >>> > >> > >> The abstract base class for NetDevice doesn't constrain or specify any > >> queueing model. The CSMA NetDevice type, however, uses ns3::Queue which > >> is not designed for multi-port usage. So it may not be compatible at > >> the CsmaNetDevice level, but at ns3::NetDevice, it seems like we could > >> still handle shared memory with a different internal device organization > >> than CsmaNetDevice. > >> > >> I wonder whether we could get better requirements written down regarding > >> how we need to plan for supporting Ethernet switches (including both > >> input and output buffering requirements, what service and drop policies > >> are required by the buffers, etc.). If anyone has a good reference for > >> this, please send it along ... > >> > >> - Tom > >> > >> > >> > >> https://codereview.appspot.com/5615049/ > >> > > > >
Sign in to reply to this message.
I would like to propose trying to move forward with the full duplex extension rather than the separate Ethernet model at this time. I created a separate code review issue here: https://codereview.appspot.com/187880044/ and left some comments in the summary about open issues (resolving Hugo Pinto's comments, writing some tests, selection of the default mode of the device). I also created a testing repo at http://code.nsnam.org/tomh/ns-3-dev-csmafd that I'll keep in sync with any future Rietveld modifications. I'd like to try to close this out over the next few weeks if possible, to include in ns-3.22.
Sign in to reply to this message.
Thanks, Tom. I apologize, but I am currently very limited on development time at the moment. Hugo's first suggestion seems fine and is an easy change. I'm not sure I understand the ramifications of his second point - does the propagation even just need to be pushed under a "IsActive" or "!IsActive" if statement or something else? Otherwise, what tests do we need? Create two nodes and connect via full-duplex with 2 simple send/recv apps? --Jeff On Tue, Dec 9, 2014 at 1:20 AM, <tomh.org@gmail.com> wrote: > > I would like to propose trying to move forward with the full duplex > extension rather than the separate Ethernet model at this time. > > I created a separate code review issue here: > https://codereview.appspot.com/187880044/ > > and left some comments in the summary about open issues (resolving Hugo > Pinto's comments, writing some tests, selection of the default mode of > the device). > > I also created a testing repo at > http://code.nsnam.org/tomh/ns-3-dev-csmafd that I'll keep in sync with > any future Rietveld modifications. > > I'd like to try to close this out over the next few weeks if possible, > to include in ns-3.22. > > > > https://codereview.appspot.com/5615049/ >
Sign in to reply to this message.
On 12/16/2014 12:19 PM, Jeff wrote: > Otherwise, what tests do we need? Create two nodes and connect via > full-duplex with 2 simple send/recv apps? > One minimal test would be to create two nodes and one channel. At time t, have an application enqueue two packets on each side of the link. Using a receive trace source, measure the packet reception time for each packet, and confirm that the two modes (half-duplex and full-duplex) are working as expected. Are there other state machine transitions and interactions that should be tested? If so, can someone elaborate a test case such as above? - Tom
Sign in to reply to this message.
I'm getting back to using this, so I've made changes that relate to Hugo's comments, as well as having rebased on top of 3.22. Results are in my fork on github if anyone is interested. https://github.com/MurphyMc/ns-3-dev-git/tree/feature_csma_full_duplex_rebase... On 2014/10/06 21:52:49, hugo.s.pinto wrote: > Murphy, I understand your implementation now, and I see that you only use > one device on each terminal. I believe that the following are bugs: > > i) in csma-net-device.cc, in function CsmaNetDevice::TransmitStart (void), > m_txMachineState = BACKOFF; > > should be only in case of half-duplex links, otherwise state machine gets > stuck in backoff mode. > > ii) in csma-channel.cc, in function CsmaChannel::TransmitEnd > Simulator::Schedule (m_delay, &CsmaChannel::PropagationCompleteEvent, > this, srcId); > > I believe that the device shouldn't be busy while propagating, because > otherwise you cannot have high speed links.. (this delay will substantially > limit the speeds you get). Let me know if you agree. > > Thank you, > Hugo > > > > > > > > > > > > On Thu, Oct 2, 2014 at 4:44 PM, Hugo Sousa Pinto <mailto:hugo.s.pinto@gmail.com> > wrote: > > > Tom, I also agree that having a full-duplex ethernet in a csma module is > > somewhat misleading. I would go for a separate module called ethernet, > > which as Peter suggested could potentially support both full and > > half-duplex modes. > > > > In my case, I have no interest in the half-duplex mode. The issue that I > > encountered were that there was no link-layer technology to connect > > switches with high bandwidth and high delay links. > > > > Regarding the availability of switches, I would like to point out that > > currently there are already some switch implementations, such as the > > openflow switch module, or the bridge module, which should of course work > > with whatever full-duplex model we end up developing (as I believe they do > > with the current patch) . > > > > It would also would be nice if the device could be made general enough to > > be used by more sophisticated switches, by e.g. configuring the device with > > an external queue. > > > > Hugo > > > > > > > > > > > > > > > > > > > > > > On Wed, Oct 1, 2014 at 5:59 PM, <mailto:tomh.org@gmail.com> wrote: > > > >> On 2014/10/01 15:13:53, Jeff Y wrote: > >> > >> > >> To answer Tom's question, "Whether the device model we do now for > >>> > >> hosts > >> > >>> would be incompatible if one were to put it into a 'switch' node that > >>> implements these things": I don't think so, but that may just be > >>> > >> because I > >> > >>> was thinking about a very simple switch model. > >>> > >> > >> Another researcher I talked to, Mike Schlansker at HP, indicated > >>> > >> that the > >> > >>> netdevice model was the main limitation for creating multi-port > >>> > >> switches. > >> > >>> From his email: "The netdevice holds dedicated queuing needed for > >>> > >> exactly > >> > >>> one output port. Our initial attempts to build a multiport switch on > >>> > >> top > >> > >>> of a netdevice resulted in a switch with a separate output buffers for > >>> > >> each > >> > >>> output port. More realistic switches, that I wanted to model, shared > >>> buffering between multiple output ports." My understanding of this is > >>> > >> that > >> > >>> sharing an output port would require a separate netdevice model to > >>> > >> support > >> > >>> this type of switch. > >>> > >> > >> The abstract base class for NetDevice doesn't constrain or specify any > >> queueing model. The CSMA NetDevice type, however, uses ns3::Queue which > >> is not designed for multi-port usage. So it may not be compatible at > >> the CsmaNetDevice level, but at ns3::NetDevice, it seems like we could > >> still handle shared memory with a different internal device organization > >> than CsmaNetDevice. > >> > >> I wonder whether we could get better requirements written down regarding > >> how we need to plan for supporting Ethernet switches (including both > >> input and output buffering requirements, what service and drop policies > >> are required by the buffers, etc.). If anyone has a good reference for > >> this, please send it along ... > >> > >> - Tom > >> > >> > >> > >> https://codereview.appspot.com/5615049/ > >> > > > >
Sign in to reply to this message.
|