CS代写 CMPUT 379, U. of Alberta, course instructor (E. Elmallah). All rights reser

Copyright Notice: Copyright by CMPUT 379, U. of Alberta, course instructor (E. Elmallah). All rights reserved. Do not post any part on a publicly-available Web site.
Example 2. This example gives a sample output where two packet switches are started, and the input file does not specify delays (so the switch that started later may miss receiving some packets). Here, we open three terminal windows on the same lab workstation. On the first window, we invoke a2w22 as a master switch. On the second and third windows, we invoke a2w22 as switches psw1 and psw2, respectively, as described in the data file below:
# Data file for a2w22
# a2w22 master 2

Copyright By PowCoder代写 加微信 powcoder

# a2w22 psw1 ex2.dat null psw2 100-110
# a2w22 psw2 ex2.dat psw1 null 200-210
psw1 100 102
psw1 100 200
psw1 100 300
psw2 200 300
psw3 200 300
psw2 200 100
psw2 200 100
psw1 100 103
psw1 100 104
Sample output (edited for clarity):
• An info command to the master switch produces the following output:
Switch information:
[psw1] port1= -1, port2= 2, port3= 100-110
[psw2] port1= 1, port2= -1, port3= 200-210
Packet Stats:
Received: HELLO:2, ASK:4
Transmitted: HELLO_ACK:2, ADD:4
• An info command to switch psw1 produces the following output:
Forwarding table:
[0] (srcIP= 0-1000, destIP= 100-110, action= FORWARD:3, pktCount= 3 –> 5 )
[1] (srcIP= 0-1000, destIP= 200-200, action= DROP:0, pktCount= 1)
[2] (srcIP= 0-1000, destIP= 300-300, action= DROP:0, pktCount= 1)
Packet Stats:
Received: ADMIT:5, HELLO_ACK:1, ADD:2, RELAYIN:2
Transmitted: HELLO:1, ASK:2, RELAYOUT:0
Note that rule [1] in the forwarding table drops a packet with destIP= 200 instead of forwarding the packet to psw2. This can happen if psw1 asks the master switch before the start of psw2. The master switch then instructs psw1 to drop the packet.

Copyright Notice: Copyright by CMPUT 379, U. of Alberta, course instructor (E. Elmallah). All rights reserved. Do not post any part on a publicly-available Web site.
• An info command to switch psw2 produces the following output:
Forwarding table:
[0] (srcIP= 0-1000, destIP= 200-210, action= FORWARD:3, pktCount= 0)
[1] (srcIP= 0-1000, destIP= 300-300, action= DROP:0, pktCount= 1)
[2] (srcIP= 0-1000, destIP= 100-110, action= FORWARD:1, pktCount= 2)
Packet Stats:
Received: ADMIT:3, HELLO_ACK:1, ADD:2, RELAYIN:0
Transmitted: HELLO:1, ASK:2, RELAYOUT:2

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com