How to Start EGP Protocol Projects Using NS2

To start Exterior Gateway Protocol (EGP) projects in NS2 (Network Simulator 2), which is traditional routing protocol swaps the routing data among diverse autonomous systems (AS). NS2 environment supports to successfully replicate the behavior of inter-domain routing. Here’s a comprehensive mechanisms to get started:

Steps to Start an EGP Protocol Project in NS2

  1. Set Up NS2 Environment
  • Install NS2: Assure we have installed NS2 and it is working properly.
    • For Linux/Ubuntu:

sudo apt-get update

sudo apt-get install ns2 nam xgraph

    • Verify installation:

ns

If effectively installed NS2 then it will show the % installation prompt.

  1. Understanding EGP
  • EGP Overview:
    • EGP is utilised for inter-domain routing among diverse autonomous systems networks (AS).
    • It describes the “reachability” of routes amongst networks.
  • EGP Concepts:
    • Route propagation and link-state updates
    • Autonomous Systems (AS)
  1. Design Your Project

Key Components:

  • Topology: We can create network topology with numerous autonomous systems for sample AS1, AS2, AS3.
  • Routing: Execute the EGP for routing interaction among the ASes.
  • Traffic Sources: CBR (Constant Bit Rate), FTP, or TCP/UDP traffic are sources of traffic.
  • Performance Metrics:
    • Throughput
    • Average delay
    • Packet delivery ratio
    • Routing overhead
  1. Create a TCL Script

Below is an outline NS2 script for replicating simple EGP interaction among numerous autonomous systems:

# Initialize the Simulator

set ns [new Simulator]

set tracefile [open egp_trace.tr w]

$ns trace-all $tracefile

set namfile [open egp_nam.nam w]

$ns namtrace-all $namfile

# Define Colors for Tracing

$ns color 1 Red

$ns color 2 Blue

# Create Nodes in Different ASes

set as1_node1 [$ns node]

set as1_node2 [$ns node]

set as2_node1 [$ns node]

set as2_node2 [$ns node]

# Define Links Between Nodes

$ns duplex-link $as1_node1 $as1_node2 2Mb 5ms DropTail

$ns duplex-link $as2_node1 $as2_node2 2Mb 5ms DropTail

$ns duplex-link $as1_node2 $as2_node1 1Mb 10ms DropTail

# Define Traffic Sources (EGP Traffic Between ASes)

set udp1 [new Agent/UDP]

$ns attach-agent $as1_node1 $udp1

set sink [new Agent/Null]

$ns attach-agent $as2_node2 $sink

$ns connect $udp1 $sink

set cbr1 [new Application/Traffic/CBR]

$cbr1 attach-agent $udp1

$cbr1 set packetSize_ 512

$cbr1 set rate_ 1Mb

# Schedule Traffic

$ns at 1.0 “$cbr1 start”

$ns at 5.0 “$cbr1 stop”

# Finish Procedure

proc finish {} {

global ns tracefile namfile

$ns flush-trace

close $tracefile

close $namfile

exec nam egp_nam.nam &

exit 0

}

# Run the Simulation

$ns at 6.0 “finish”

$ns run

  1. Compile and Run the Simulation
  1. We need to store the above tcl script code like egp_simulation.tcl.
  2. Then, we can execute the script using NS2:

ns egp_simulation.tcl

  1. Outputs:
    • Trace file: egp_trace.tr which is applied for performance analysis.
    • NAM visualization: egp_nam.nam supports to visualize the routing.
  1. Analyze Results
  • Make use of awk or Python scripts for examining the trace file for:
    • Throughput:

awk ‘BEGIN {total=0} {if ($1 == “r” && $4 == “tcp”) total += $6} END {print “Throughput:”, total/5}’ egp_trace.tr

    • Packet delivery ratio: Compute the rate of transmitted vs received packets.
  • Graph Metrics: Envision the performance parameters like throughput, delay, and so on, using xgraph or MATLAB.
  1. Compare with Other Protocols
  • We will equate the performance of EGP along with other protocols such as BGP or RIP in:
    • Delay
    • Convergence time
    • Routing overhead
    • Packet loss
  1. Document Results

The project report should contain:

  • Simulation metrics like bandwidth, packet size
  • Topology model (indicate the AS configuration)
  • Performance parameters
  • Finally, it has comparative analysis with other routing protocols.

Through this process, you can acquire effective understanding about how to start, implement and simulate the EGP Protocol projects and its analysis and comparisons in NS2 simulation platform. For further clarification of the project, please check the additional manual to be offered in it.