0. MAC in ns-2 LAN is within Berkeley Architecture, WLAN cannot create with “newLan” command Ethernet could be created as a LAN with common bandwidth and delay. 1. The general structure of MAC related sourcecode: mac.cc, mac.h MAC class is derived from Bi-Connector class. Local Variables: pktTx_ pktRx_ Macstate_ : index_ : mac address Basic … Continue reading
Undesrstanding Carrier Sense & Back Off: Consider the following two questions about IEEE 802.11 Standard: Carrier Sense is provided by the physical layer, thus, when MAC layer get a packet to transmit. It will initiate a carrier sense mechanism, and it took >= DIFS time to determine that the channel is free, thus, at least … Continue reading
General Architecture of a mobile node in ns-2: the relationship of MAC could be found in ns-mobilenode.tcl. The source code: Actually, from top to down path, the structure is ll —> ifq —-> mac —> netif . for packets going up, it is netif —> mac —>ll. Thus, ifq is only used for down … Continue reading
Notice that by default, all packet headers are included. A diagram: Common-header: Access method: What’s in common header (refer to ./common/packet.h) ch->ptype() : protocl type. e.g. PT_DSR shows this is a signaling message for DSR protocol, not a normal DATA packet ch->size(); ch->direction() : Up or Down ch->uid() ch->iface(): Interface ch->next_hop(): next hop for … Continue reading
1. Node Movement and Topology Generation Instead of specifying and control each nodes’ position and movement pattern, we use a CMU tool “setdest” to generate large number of nodes and there movements. The tool use a random waypoint model. setdest Setdest tool is used to generate the positions of nodes and their moving speed and … Continue reading
In this section, you are going to learn to use the mobile wireless simulation model available in ns. The section consists of two parts. In the first subsection, we discuss how to create and run a simple 2-node wireless network simulation. In second subsection, we will extend our example (in subsection 1) to create a … Continue reading