What are Agents in Ns2

Are you people eagerly waiting and searching to know about the agents that are functional in network simulator 2? Then, you have spotted right!!!

Agents in Ns2

Here, we have listed out the significant agents that are used in network simulator 2 along with its specifications.

  • SRM
  • It is used to perform the functions such as session message activity, loss recovery and packet handing
  • SCTP
  • It is defined as two way agents thus they are symmetric in sense and that represents the receiver and sender
  • TCP
  • The simulation user is capable to connect the traffic generation module to the TCP agent to generate data
  • UDP
  • It accepts the data in variable size chunks from the application and segments when the data is required

Ns2 Code to Create Agents

For instance, we have highlighted the sample source code based on network simulator 2 for the creation of agents.

  • Code to define agents

set udp0 [new Agent/UDP]

set tcpobj [Agent/TCP]

set tcprenoobj [Agent/TCP/Reno]

set tcpnewrenoobj [Agent/TCP/Newreno]

set tcpsinkobj [Agent/TCPSink]

set sctpobj [Agent/SCTP]

set sctpnewrenoobj [Agent/SCTP/Newreno]

set srm [new Agent/SRM]

  • Common structure to connect with agents

$ns attach-agent $node $srm

Reach us to aid more guidance form our experts!!!