Hello All

I am trying to work on simple telnet application. Please help to clarify the
problems i have encountered.

I simulated basic telnet application with wireless nodes. I want to find the
maximum data-rate that can be achieved using 802.11 g. I succeeded in
setting the data-rate to 54 Mbps using statement Mac/802_11 set dataRate_
54Mb

Setting the interval parameter in the following way

# ======================================================================
# Define options

# ======================================================================
set opt(chan)           Channel/WirelessChannel    ;# channel type
set opt(prop)           Propagation/TwoRayGround   ;# radio-propagation mode
set opt(netif)          Phy/WirelessPhy            ;# network interface type
set opt(mac)            Mac/802_11                 ;# MAC type
set opt(ifq)            Queue/DropTail/PriQueue    ;# interface queue type
set opt(ll)             LL                         ;# link layer type
set opt(ant)            Antenna/OmniAntenna        ;# antenna model
set opt(ifqlen)         50                         ;# max packet in ifq
set opt(nn)             5                          ;# number of mobilenodes
set opt(rp)             DSDV                       ;# routing protocol

# Phy/WirelessPhy set bandwidth_ 54Mb    ;# 54 Mbps bandwidth
Mac/802_11 set dataRate_ 54Mb
Mac/802_11 set RTSThreshold_ 0        ;# It will send RTS for a packet >
RTSThreshold value, O will turn on RTS/CTS

# ======================================================================
# Main Program
# ======================================================================

# Initialize Global Variables

#

set ns_         [new Simulator]


$ns_ use-newtrace

set tracefd [open out.tr w]
$ns_ trace-all $tracefd
set nf [open out.nam w]
$ns_ namtrace-all $nf

proc finish {} {
        global ns_ nf
        $ns_ flush-trace
        #Close the trace file
        close $nf
        #Execute nam on the trace file
        exec nam out.nam &
        #exec xgraph out.tr -geometry 800*400 &
        exit 0
}

$ns_ node-config -llType $opt(ll) \
                 -macType $opt(mac) \
                 -ifqType $opt(ifq) \
                 -ifqLen $opt(ifqlen) \
                 -antType $opt(ant) \
                 -propType $opt(prop) \
                 -phyType $opt(netif) \
                 -channelType $opt(chan) \
                 -agentTrace ON \
                 -routerTrace ON \
                 -macTrace ON 

for {set i 0} {$i < $opt(nn) } {incr i} {

                set node_($i) [$ns_ node]       

                

        }


$ns_ duplex-link $node_(0) $node_(1) 54mb 2ms DropTail
$ns_ duplex-link $node_(1) $node_(2) 54mb 2ms DropTail
$ns_ duplex-link $node_(3) $node_(1) 54mb 2ms DropTail
$ns_ duplex-link $node_(1) $node_(4) 54mb 2ms DropTail

set tcp [new Agent/TCP]
$ns_ attach-agent $node_(0) $tcp
set tel [new Application/Telnet]
$tel attach-agent $tcp

set sink [new Agent/TCPSink]
$sink listen

$ns_ attach-agent $node_(2) $sink

set tcp1 [new Agent/TCP]
$ns_ attach-agent $node_(3) $tcp1
set tel1 [new Application/Telnet]
$tel1 attach-agent $tcp1

set sink1 [new Agent/TCPSink]
$sink1 listen
$ns_ attach-agent $node_(4) $sink1

$ns_ connect $tcp $sink
$ns_ connect $tcp1 $sink1

$tel set interval_ 0.02
$tel1 set interval_ 0.02

$ns_ at 1.0 "$tel start"
$ns_ at 1.0 "$tel1 start"

$ns_ at 100.0 "$tel stop"
$ns_ at 100.0 "$tel1 stop"

$ns_ at 100.0 "finish"


puts "Starting Simulation..."

$ns_ run

Simulating application with above statements leads to a scenario in which
two packets are sent one after other even though the Acknowledgement for the
first packet us not received which is not the way Telnet works. 

Telnet works in fashion that after getting Acknowledgement for the first
packet only it starts sending the second packet. Please help me know how
interval variable works for telnet protocol. I also looked into its
source-code and found out that there's no mechanism for application for wait
until an Acknowledgement arrives and then start the further communication.
Please correct me if i am wrong.

Also i would like to know how can i set the push flag of packet which i am
sending from one node to another ?

Any comments and help would be really helpful and appreciated.

Thank you.
Kushal Shroff
[EMAIL PROTECTED]
-- 
View this message in context: 
http://www.nabble.com/Telnet-application-problem-tp19752533p19752533.html
Sent from the ns-users mailing list archive at Nabble.com.

Reply via email to