Menu

(Solved) : Example Given Professor Specify Language Use Public Class Mlt3 Takes Signal Pulses Assigns Q32730861 . . .

1. The figure shown below is about Setup Request in a virtual circuit network. In this figure, the source A sends a setup frame to switch 1. Then, the 1* switch acts as a packet switch which only knows the incoming virtual circuit identifier (VCI] but does not know the outgoing VCI yet. The 2d and the 3 switches do the same as the 1t switch Port IVCI Port VCI-77 Switch 1 Switch 3 Switch 2 Pot VCI Port The next figure is about Setup Acknowledgement Here, the destination B sends an acknowledgment to the 3 switch and the empty spot of the forwarding table is filled. Then, the 2nd and the 1st switches do the same as the 3 switch. Your task is to simulate Setup Request and Setup Acknowledgment using a set of programing codes. If you are not able to write a set of programming codes, you may write a pseudocode (50 points). 14 VCI-77 Switch 1 Switch 3 Swiich 2 Pont VCI Por

Example given by professor, he did not specify what language touse:

public class mlt3 {

   //takes in signal pulses and assignsvoltage

   public static voidmain(String[] args) {

     

      int[]inputSignal = {1, 0, 0, 1, 0, 1, 0, 1};

      //input values

      String[] voltLevel= new String[inputSignal.length+1];

      int[]clockPulse = new int[inputSignal.length+1];

      //storage for voltagevalues

           

      intcurrent;

      int pos =0;

      int neg =0;

      int pulse=0;

      String volt=“0V”;

     

     voltLevel[0]=“0V”;

      clockPulse[0]=pulse;

      //variables to start ifchecks

     

      for (int i = 0; i < inputSignal.length; i++){

         current =inputSignal[i];

         //storecurrent input value

         if( current == 1 && pos == 0 && neg == 0 ){

            //movesvolt to positive

            volt= “+V”;

           pos++;

         }elseif( current == 1 && pos == 1 && neg ==0){

            //movesvolt from pos to 0

            volt= “0V”;

           neg++;

         }elseif( current == 1 && pos == 1 && neg ==1){

           //moves volt from 0 to pos

            volt= “-V”;

           pos–;   

         }elseif (current == 1 && pos ==0 && neg ==1){

            //movesvolt from neg to 0

            volt= “0V”;

           neg–;

         }

         elseif ( current == 0){

            //keepsvoltage the same when pulse is 0

            try{

              volt = voltLevel[i-1];

           }catch(Exception e){

              volt = voltLevel[0];

           }

        

         }

        

        voltLevel[i]=volt;

         pulse++;

        clockPulse[i]=pulse;

         //storespulse and voltage

      }

   

      for (int j = 0; j < voltLevel.length-1; j++){

        System.out.println( “The voltage at pulse “+clockPulse[j]+ ” is “ + voltLevel[j]);

      }

   }

}

1. The figure shown below is about “Setup Request” in a virtual circuit network. In this figure, the source A sends a setup frame to switch 1. Then, the 1* switch acts as a packet switch which only knows the incoming virtual circuit identifier (VCI] but does not know the outgoing VCI yet. The 2d and the 3 switches do the same as the 1t switch Port IVCI Port VCI-77 Switch 1 Switch 3 Switch 2 Pot VCI Port The next figure is about “Setup Acknowledgement Here, the destination B sends an acknowledgment to the 3 switch and the empty spot of the forwarding table is filled. Then, the 2nd and the 1st switches do the same as the 3 switch. Your task is to simulate “Setup Request” and “Setup Acknowledgment” using a set of programing codes. If you are not able to write a set of programming codes, you may write a pseudocode (50 points). 14 VCI-77 Switch 1 Switch 3 Swiich 2 Pont VCI Por Show transcribed image text

Expert Answer


Answer to Example Given Professor Specify Language Use Public Class Mlt3 Takes Signal Pulses Assigns Q32730861 . . .

OR