Network programming POX

SoccerBoss
Category:
Programming
Price: $30 USD

Question description

My assignment is to just modify a given code to build a simple IPV4 router using switches in POX environment and then run it on mininet. I already wrote the code and just need help debugging that is there anyone here that can help me with that?

my final out put should look like this:


pingall:

h1 ->  h2 h3 h4  X  X  h7  X  X

h2 -> h1  h3 h4  X  h6  X  h8  X

h3 -> h1 h2  h4 h5  X  X  X  X

h4 -> h1 h2 h3  h5  X  X  X  X

h5 -> X  X  h3 h4  h6  h7  X  X

h6 -> X  h2  X  X  h5  h7 h8  X

h7 -> h1 X  X  X  h5 h6  X  X

h8 -> X  h2  X  X  X  h6  X  X

h9 -> X  X  X  X  X  X  X  X 


 but i get different output :

I copy paste part of the code that I modified and it looks like below. let me know if your are fimilar:

f dst_ip.inNetwork("10.0.0.0/8") or \
dst_ip.inNetwork("192.168.0.0/16") or \
dst_ip.inNetwork("172.16.0.0/12"):
## Switch 4: Handle traffic specific to switch 4
if (event.dpid == 4):
msg1 = of.ofp_packet_in()
event.connection.send(msg1)

## Switch 3: Handle traffic specific to switch 3
if (event.dpid == 3):
msg2 = of.ofp_packet_in()
event.connection.send(msg2)

## Switch 2: Handle traffic specific to switch 2
if (event.dpid == 2):
msg3 = of.ofp_packet_in()
if(event.port != 1 and event.port != 2):
msg3.actions.append(of.ofp_action_output(port = 3))
msg3.actions.append(of.ofp_action_output(port = 4))
msg3.actions.append(of.ofp_action_output(port = 5))
if(event.port == 1):
if src_ip.inNetwork("10.0.1.1"):
msg3.actions.append(of.ofp_action_output(port = 5))
if src_ip.inNetwork("12.0.2.2"):
msg3.actions.append(of.ofp_action_output(port = 4))
if src_ip.inNetwork("192.168.0.3"):
msg3.actions.append(of.ofp_action_output(port = 3))
if src_ip.inNetwork("192.168.0.4"):
msg3.actions.append(of.ofp_action_output(port = 3))
if(event.port == 2):
if src_ip.inNetwork("128.114.59.8"):
msg3.actions.append(of.ofp_action_output(port = 4))
event.connection.send(msg3)
## Switch 1: Handle traffic specific to switch 1
if (event.dpid == 1):
msg4 = of.ofp_packet_in()
if(event.port != 1):
msg4.actions.append(of.ofp_action_output(port = 2))
msg4.actions.append(of.ofp_action_output(port = 3))
msg4.actions.append(of.ofp_action_output(port = 4))
msg4.actions.append(of.ofp_action_output(port = 5))
if(event.port == 1):
if src_ip.inNetwork("192.168.0.5"):
msg4.actions.append(of.ofp_action_output(port = 4))
msg4.actions.append(of.ofp_action_output(port = 5))
if src_ip.inNetwrok("172.0.0.6"):
msg4.actions.append(of.ofp_action_output(port = 3))
if src_ip.inNetwork("10.0.12.24"):
msg4.actions.append(of.ofp_action_output(port = 2))
if src_ip.inNetwork("128.114.59.8"):
msg4.actions.append(of.ofp_action_output(port = 3))
event.connection.send(msg4)
## because we handled the logic, we should send false
## so that the l2_learning switch does not add rules
## overriding our rules
return False
***********************************************************************************************************I

I ALSO ATTACHED lab manual so you can see the detail.


finalprojectsimpleipv4router.pdf

Studypool has helped 1,244,100 students
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1825 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors