程序代写 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 3. This example gives a sample output where the master switch, psw1, and psw2 are started in this order (from three different terminal windows on the same lab workstation). However, since psw1 delays for 5000 msec, queries from psw2 comes to the master switch before queries from psw1. Note also that while psw1 delays reading from the data file, the switch has received and processed two relayed packets.
Note: The output below shows all received and transmitted packets for each switch. This feature is not required in the assignment, however, it is highly recommended for gaining partial marks if the submitted assignment does not work as specified.
# ex3.dat: data file for a2w22

Copyright By PowCoder代写 加微信 powcoder

# a2w22 master 2
# a2w22 psw1 ex3.dat null psw2 100-110
# a2w22 psw2 ex3.dat psw1 null 200-210
psw1 100 102
psw1 delay 5000
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):
• Master switch output:
Received (src= psw1, dest= master) [HELLO]:
(port0= master, port1= null, port2= psw2, port3= 100-110)
Transmitted (src= master, dest= psw1) [HELLO_ACK]
Received (src= psw2, dest= master) [HELLO]:
(port0= master, port1= psw1, port2= null, port3= 200-210)
Transmitted (src= master, dest= psw2) [HELLO_ACK]
Received (src= psw2, dest= master) [ASK]: header= (srcIP= 200, destIP= 300)
Transmitted (src= master, dest= psw2) [ADD]:
(srcIP= 0-1000, destIP= 300-300, action= DROP:0, pktCount= 0)
Received (src= psw2, dest= master) [ASK]: header= (srcIP= 200, destIP= 100)
Transmitted (src= master, dest= psw2) [ADD]:
(srcIP= 0-1000, destIP= 100-110, action= FORWARD:1, pktCount= 0)
Received (src= psw1, dest= master) [ASK]: header= (srcIP= 100, destIP= 200)

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.
Transmitted (src= master, dest= psw1) [ADD]:
(srcIP= 0-1000, destIP= 200-210, action= FORWARD:2, pktCount= 0)
• Packet switch 1 output:
Transmitted (src= psw1, dest= master) [HELLO]:
(port0= master, port1= null, port2= psw2, port3= 100-110)
Received (src= master, dest= psw1) [HELLO_ACK]
** Entering a delay period of 5000 msec
Received (src= psw2, dest= psw1) [RELAY]: header= (srcIP= 200, destIP= 100)
Received (src= psw2, dest= psw1) [RELAY]: header= (srcIP= 200, destIP= 100)
** Delay period ended
Transmitted (src= psw1, dest= master) [ASK]: header= (srcIP= 100, destIP= 200)
Received (src= master, dest= psw1) [ADD]:
(srcIP= 0-1000, destIP= 200-210, action= FORWARD:2, pktCount= 0)
• Packet switch 2 output:
Transmitted (src= psw2, dest= master) [HELLO]:
(port0= master, port1= psw1, port2= null, port3= 200-210)
Received (src= master, dest= psw2) [HELLO_ACK]
Transmitted (src= psw2, dest= master) [ASK]: header= (srcIP= 200, destIP= 300)
Received (src= master, dest= psw2) [ADD]:
(srcIP= 0-1000, destIP= 300-300, action= DROP:0, pktCount= 0)
Transmitted (src= psw2, dest= master) [ASK]: header= (srcIP= 200, destIP= 100)
Received (src= master, dest= psw2) [ADD]:
(srcIP= 0-1000, destIP= 100-110, action= FORWARD:1, pktCount= 0)

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