[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Questions regarding the MAC layer in NS



I looked at the code and it seemed to me that the implementation of
802.3 is incomplete.  As far as I can tell, it doesn't have mac-layer
retransmissions.

  -Yuri

> I am not a member of the ns mailing list.  I have a few questions regarding
> the MAC layer in NS and I was wondering if someone could answer them.  I am
> trying to develop some example MAC layer visualizations for educational
> purposes.
> 
> 1) I have developed an example for CSMA/CD using the Mac/802_3 class. I
> create a LAN with four nodes.
> 	set n0 [$ns node]
>       set n1 [$ns node]
>       set n2 [$ns node]
>       set n3 [$ns node]
> 
>       $ns make-lan "$n0 $n2 $n3 $n1" 20Mbps 20ms LL Queue/DropTail Mac/802_3
> 
>      Two are TCP senders and two are TCP receivers.
> 
> 	set tcpSender [new Agent/TCP]
> 	$ns attach-agent $n0 $tcpSender
> 	set cbr [new Application/Traffic/CBR]
> 	$cbr attach-agent $tcpSender
> 
> 	set tcpSender2 [new Agent/TCP]
> 	$ns attach-agent $n2 $tcpSender2
> 	$tcpSender2 set fid_ 1
> 	set cbr2 [new Application/Traffic/CBR]
> 	$cbr2 attach-agent $tcpSender2
> 
> 	$cbr set packet_size 1000
> 	$cbr set rate_ 1Mbps
> 
> 	$cbr2 set packet_size 1000
> 	$cbr2 set rate_ 1Mbps
> 
> 	set tcpReceiver [new Agent/TCPSink]
> 	$ns attach-agent $n1 $tcpReceiver
> 
> 	set tcpReceiver3 [new Agent/TCPSink]
> 	$ns attach-agent $n3 $tcpReceiver3
> 
>       If I have the 2 TCP receivers send at the same time there is a
> collision, but neither receiver is able to recover and send
>       any more packets.
> 
>          	$ns connect $tcpSender $tcpReceiver3
> 	$ns connect $tcpSender2 $tcpReceiver
> 
> 	$ns at 0.1 "$cbr start"
> 	$ns at 0.1 "$cbr2 start"
> 
>      Why is the MAC 802_3 protocol behaving this way?  Why can't the LAN
> using CSMA/CD recover on an initial collision.
>      I have included an the tcl file that is a copy of this example,
> lan1.tcl.
> 
> 2) If I change the above example so that the 2 TCP senders do not send at
> the same time, the MAC protocol starts to work.
> 	$ns at 0.1 "$cbr start"
> 	$ns at 0.15 "$cbr2 start"
>    But it seems that collision occurs randomly.  Packets from different TCP
> senders and receivers cross the shared part
>       part of the LAN at the same time,  but most of the time no packets are
> lost.  I can tell when a packet is lost because
>       of slow start.  Why is there a random loss of packets on collisions?
> It seems like the MAC layer is not simulating and
>       detecting collision all the time.  How Should I interpret this?
> 
> 3)   Is there any way to visually show collision on the MAC layer?  For
> instance, changing the color of the packets. Or
>       possibly have the packet fall off like it does in drop tail.  It would
> be nice for someone watching the simulation to
>       see this.
> 
> 4)   I have not found any documentation on CSMA or Aloha protocol for the
> MAC layer.   Is there any support?  If not, what
>       exactly would it entail to develop this.   I.E.  Would I need to write
> a new MAC class.  Would I need a new Agent?  Or
>       possibly need a new Channel?  Also,  has anyone in the group written
> these already and could provide some insight?
> 
> For those that to the time to read this e-mail, I thank you for your
> patience.  Any help you could give would be greatly appreciated.
> 
> Respectfully,
> 
> Jason Todoroff
> 
> 
> 
> 
> ------- End of Forwarded Message