As the general note, the transmission control protocol (TCP) is defined as the communication standards in network simulator 2. In Ns2, the simulation nodes are communicating through the utilization of communication model which includes the elements such as,
- FTP application
- TCP sick agent
- TCP agent
Code for TCP Connection
Here, we have highlighted the Ns2 sample code mainly for the TCP based FTP data transmission.
set ns [new Simulator] ;
set node1 [$ns node] ;
set node2 [$ns node] ;
set tcp1 [$ns create-connection TCP $node1 TCPSink $node2 42]
$tcp set window_ 50 ;
set ftp1 [new Application/FTP]
$ftp1 attach-agent $tcp1
$ns at 0.0 “$ftp start“
TCP Agents in Ns2
Moreover, we have highlighted the TCP agents which are all supportive with network simulator 2.
- One way TCP sending agents support the below mentioned agents
Agent/TCP
Agent/TCP/Reno
Agent/TCP/Newreno
Agent/TCP/Vegas
- One way TCP receiving agents supports the following agents
Agent/TCPSink
Agent/TCPSink/DelAck
Agent/TCPSink/Sack1
Agent/TCPSink/Sack1/DelAck
- Two way experimental sender are supportive for the Reno from TCP
Agent/TCP/FullTcp
If you have any issues, you people can reach us at any time to acquire the best guidance from our technical experts.