How to Implement Fibre Channel Arbitrated Loop in NS2

To implement the Fibre Channel Arbitrated Loop (FC-AL) in ns2, the FC-AL is a variant of topology that is used in storage area networks (SANs) in which their devices are linked in a loop and they interact via an arbitration process to state which device can deliver data. In FC-AL, all devices share a common loop and only one device can exchange data at a time. It is typically used for linking several storage devices like hard drives, to a host.

NS2 lacks the in-built support for Fibre Channel or SAN-related protocols because the ns2 is generally used for network and wireless communication. Yet, you can simulate Fibre Channel Arbitrated Loop in ns2 by fairly accurate the activities using its simplified networking elements including duplex links and token-related transmission modes. You can build a logical ring of nodes with only one node can exchange at a time, recreating the arbitration mechanisms of FC-AL. Here is the detailed protocol to implement FC-AL topology in ns2:

Steps to Implement Fibre Channel Arbitrated Loop in NS2:

  1. Set Up the Physical Nodes:
    • Build a couple of nodes to indicate devices in the FC-AL loop (such as storage devices or hosts).
  2. Arrange Nodes in a Loop (Ring Topology):
    • Link nodes in a circular manner (each node links to the next and the last node links back to the first).
  3. Simulate the Arbitration Process:
    • You can replicate arbitration by permitting only one node to transfer data at a time, which can be accomplished by controlling the packet generation.
  4. Simulate Traffic Flow:
    • Produce traffic amongst nodes, with a control features to make sure only one node can send data at a time, recreating the shared access of FC-AL.

Example of Fibre Channel Arbitrated Loop (FC-AL) Simulation in NS2:

The following below is a sample script in NS2 that simulates a ring topology (alike to FC-AL) with a basic arbitration mechanism where only one node can transmit at a time.

# Create a new simulator

set ns [new Simulator]

# Open trace file for output

set tracefile [open out.tr w]

$ns trace-all $tracefile

# Define the nodes in the loop (6 nodes for example)

set n0 [$ns node]

set n1 [$ns node]

set n2 [$ns node]

set n3 [$ns node]

set n4 [$ns node]

set n5 [$ns node]

# Create duplex links to form a loop (ring)

$ns duplex-link $n0 $n1 100Mb 1ms DropTail

$ns duplex-link $n1 $n2 100Mb 1ms DropTail

$ns duplex-link $n2 $n3 100Mb 1ms DropTail

$ns duplex-link $n3 $n4 100Mb 1ms DropTail

$ns duplex-link $n4 $n5 100Mb 1ms DropTail

$ns duplex-link $n5 $n0 100Mb 1ms DropTail  ;# Complete the loop

# Define TCP agents for communication

# Only one node can transmit at a time (to simulate arbitration)

set tcp0 [new Agent/TCP]

set sink0 [new Agent/TCPSink]

$ns attach-agent $n0 $tcp0

$ns attach-agent $n3 $sink0

$ns connect $tcp0 $sink0

# Simulate FTP traffic from node n0 to node n3

set ftp0 [new Application/FTP]

$ftp0 attach-agent $tcp0

$ns at 1.0 “$ftp0 start”   ;# Start traffic at 1 second

# Schedule another transmission after the first one is complete

# Arbitration: only one node can transmit at a time

set tcp1 [new Agent/TCP]

set sink1 [new Agent/TCPSink]

$ns attach-agent $n2 $tcp1

$ns attach-agent $n5 $sink1

$ns connect $tcp1 $sink1

# Simulate FTP traffic from node n2 to node n5 (after n0 is done)

$ns at 3.0 “$ftp0 stop”

$ns at 4.0 “$ftp1 start”   ;# Start traffic from n2 to n5 after arbitration

# End the simulation after 10 seconds

$ns at 10.0 “finish”

proc finish {} {

global ns tracefile

$ns flush-trace

close $tracefile

exit 0

}

# Run the simulation

$ns run

Explanation of the Script:

  1. Nodes:
    • n0, n1, n2, n3, n4, n5 denotes the devices (for instance: storage devices or hosts) in the FC-AL loop.
  2. Links:
    • Use the duplex links to connect the nodes in a circular (ring) manner. The last node (n5) links back to the first node (n0), creating a loop.
    • The link bandwidth is set to 100Mb and a delay of 1ms is allotted to each link to indicate high-speed communication typical in FC-AL networks.
  3. Traffic Simulation:
    • Simulate communication amongst the nodes by using TCP agents.
    • FTP (File Transfer Protocol) produces traffic, simulating file transfers amongst the nodes.
    • To simulate the arbitration mechanism of FC-AL, only one node can transmit data at a time. In this instance, n0 sends traffic to n3, and once that transmission is done, n2 delivers data to n5.
  4. Arbitration Simulation:
    • The arbitration process is mimicked by controlling the traffic start and end times. For example, node n0 starts transmitting at 1.0 seconds, and node n2 starts transmitting after node n0 completes at 4.0 seconds.
  5. Simulation Duration:
    • The simulation executes for 10 seconds, with two various nodes transmitting data during this time, indicating the shared access in FC-AL.

Post-Simulation Analysis:

  1. Trace File Analysis:
    • The trace file (out.tr) will contain information about packet transmission, packet delivery, delay, and throughput. Analyze how the FC-AL arbitration mechanism impacts the communication by analyzing the trace file.
  2. NAM Visualization:
    • You can visualize the ring topology using NAM (Network Animator) to monitor the flow of traffic through the loop and how only one node transfers at a time.
  3. Performance Metrics:
    • Compute network performance metrics includes delay, throughput, and packet loss to assess the activities of the FC-AL network in the simulated arbitration mechanism.

Enhancing the Simulation:

  1. Adding More Nodes:
    • Replicate a larger FC-AL loop by maximizing the amount of nodes.
  2. Dynamic Arbitration:
    • Execute a more dynamic arbitration mechanism where multiple nodes request access to the loop and a central arbiter grants access depends on the queue or round-robin scheduling.
  3. Simulating Faults:
    • Imitate node or link failures and see how the loop manages failures by bypassing the faulty node or link.
  4. Changing Traffic Types:
    • Replace TCP with UDP or simulate various kinds of traffic (such as Constant Bit Rate – CBR) to estimate how the FC-AL loop manages several traffic methods.
  5. Varying Link Parameters:
    • Assess how performance differs in various conditions by examining with different link parameters like bandwidth, delay, and queue types (for instance: DropTail, RED).

Through this presented demonstration, we will walk you through the implementation of Fibre Channel Arbitrated Loop (FC-AL) Topology and how to analyze the outcomes after the simulation and how to enhance it by referring the provided steps and how to execute it in the Network simulator 2.

Fibre Channel Arbitrated Loop Topology in NS2 implementation is supported by our team, and we encourage you to connect with ns2project.com for the best guidance. We are here to offer you excellent topic assistance and ensure that your work is completed on time by our dedicated developers.