Zanobia Nisar: TCP, Udp, FTP Over TCP
Zanobia Nisar: TCP, Udp, FTP Over TCP
Zanobia Nisar
Create a TCP agent: where TCP agent is an object of and specify its class Agent/TCP
set tcp [new Agent/TCP]
Attach agent object created to a node object using the attach-agent member function.
$ns attach-agent $n0 $tcp
This function calls the attach member function of specified nodes which attaches given agent to itself.
Create TCP sink agent: it generates and sends ACK packets to the sender and terminate or frees the received packets
set sink [new Agent/TCPSink]
Use the attach-agent member function to specify which node will act as a sink agent as
$ns attach-agent $n3 $sink
Create a null agent: this agent will the receive the packets and frees them
set null [new Agent/Null]
To attach null agent to UDP agent use the attach-agent member function as
$ns attach-agent $n3 $null
Each agent object has a member function attach-agent that attaches a traffic source object to itself
$ftp attach-agent $tcp