[j-sim-users] 2 NICs in wireless simulation

zhdu7528 at mail.usyd.edu.au zhdu7528 at mail.usyd.edu.au
Tue Jan 16 19:37:59 CST 2007


Quoting Hung-ying Tyan <tyanh at ieee.org>:

I proposed 2 NICs for Node 1 as following:

# NIC 1
mkdir drcl.inet.mac.LL              ll
mkdir drcl.inet.mac.ARP             arp
mkdir drcl.inet.core.queue.FIFO     queue
mkdir drcl.inet.mac.Mac_802_11      mac
mkdir drcl.inet.mac.WirelessPhy     phy
mkdir drcl.inet.mac.FreeSpaceModel  propagation
mkdir drcl.inet.mac.MobilityModel   mobility

puts "connect components in NIC1 in node 0"
connect phy/.mobility@    -and mobility/.query@
connect phy/.propagation@ -and propagation/.query@
connect mac/down@ -and phy/up@
connect mac/up@   -and queue/output@
connect ll/.mac@ -and mac/.linklayer@
connect ll/down@ -and queue/up@
connect ll/.arp@ -and arp/.arp@
connect mac/.linkbroken@ -and aodv/.linkbroken@

# NIC 2
mkdir drcl.inet.mac.LL              ll_2
mkdir drcl.inet.mac.ARP             arp_2
mkdir drcl.inet.core.queue.FIFO     queue_2
mkdir drcl.inet.mac.Mac_802_11      mac_2
mkdir drcl.inet.mac.WirelessPhy     phy_2
mkdir drcl.inet.mac.FreeSpaceModel  propagation_2
mkdir drcl.inet.mac.MobilityModel   mobility_2

puts "connect components in NIC 2"
connect phy_2/.mobility@    -and mobility_2/.query@
connect phy_2/.propagation@ -and propagation_2/.query@
connect mac_2/down@ -and phy_2/up@
connect mac_2/up@   -and queue_2/output@
connect ll_2/.mac@ -and mac_2/.linklayer@
connect ll_2/down@ -and queue_2/up@
connect ll_2/.arp@ -and arp_2/.arp@
connect mac_2/.linkbroken@ -and aodv/.linkbroken@

#any component up PktDispatcher
mkdir drcl.inet.protocol.aodv.AODV  aodv
set PD [mkdir drcl.inet.core.PktDispatcher      pktdispatcher]
set RT [mkdir drcl.inet.core.RT                 rt           ]
set ID [mkdir drcl.inet.core.Identity           id           ]
$PD bind $RT
$PD bind $ID

# enable route_back flag at PktDispatcher
! pktdispatcher setRouteBackEnabled true

# set up the address for NIC1
! arp setAddresses  0 0
! ll  setAddresses  0 0
! mac setMacAddress 0
! phy setNid        0
! mobility setNid   0
! id setDefaultID   0
! . addAddress      0

# set up the address for NIC2
! arp_2 setAddresses  1 1
! ll_2  setAddresses  1 1
! mac_2 setMacAddress 1
! phy_2 setNid        1
! mobility_2 setNid   1
! id_2 setDefaultID   1
! . addAddress       1

The same structure for Node 2. As a proposed two NICs, apparently i have to
create two channels as following:

puts "create channel 1"

mkdir drcl.inet.mac.Channel channel
mkdir drcl.inet.mac.NodePositionTracker tracker
#! tracker setGrid maxX  minX  maxY  minY    dX   dY
! tracker setGrid 100.0   0.0 100.0   0.0  50.0 50.0

connect channel/.tracker@ -and tracker/.channel@
connect /example/n0/mobility/.report@ -and /example/tracker/.node@
connect /example/n1/mobility/.report@ -and /example/tracker/.node@

! channel setCapacity 4

connect n0/phy/down@ -to channel/.node@
! channel attachPort 0 [! /example/n0/phy getPort .channel]

connect n1/phy/down@ -to channel/.node@
! channel attachPort 1 [! /example/n1/phy getPort .channel]


puts "create channel 2"

mkdir drcl.inet.mac.Channel channel_2
mkdir drcl.inet.mac.NodePositionTracker tracker_2
#! tracker setGrid maxX  minX  maxY  minY    dX   dY
! tracker1 setGrid 100.0   0.0 100.0   0.0  50.0 50.0

connect channel_2/.tracker@ -and tracker_2/.channel@
connect /example/n0/mobility_2/.report@ -and /example/tracker_2/.node@
connect /example/n1/mobility_2/.report@ -and /example/tracker_2/.node@

! channel_2 setCapacity 2

connect n0/phy_2/down@ -to channel_2/.node@
! channel_2 attachPort 0 [! /example/n0/phy_2 getPort .channel]

connect n1/phy_2/down@ -to channel_2/.node@
! channel_2 attachPort 1 [! /example/n1/phy_2 getPort .channel]

is my concept right?

Best regards

> It's definitely possible.  For starter, you can replicate all the
> components below pktdispatcher.  Then you need to figure out routing,
> radio interference and maybe some other issues I missed.
>
> HT
>
> On 1/5/07, zhdu7528 at mail.usyd.edu.au <zhdu7528 at mail.usyd.edu.au> wrote:
> > Hi,Hung
> >
> > is that possible to simulate the wireless network with two or more
> NICs in
> > Jsim?
> >
> > The jsim wireless examples only simulate the network with 1 wireless
> NIC.
> >
> > Best regards
> >
> > ----------------------------------------------------------------
> > This message was sent using IMP, the Internet Messaging Program.
> >
>




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


More information about the j-sim-users mailing list