Skip to content

Commit

Permalink
Mininet "pingall" problem fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWang0909 committed May 12, 2018
1 parent ea7518b commit 4132d8f
Show file tree
Hide file tree
Showing 5 changed files with 281 additions and 39 deletions.
16 changes: 16 additions & 0 deletions example/mininet/routing_L3.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ def addInterfaceToGateway(name):
"interface-name" : "interface-5",
"interface-ip" : "50.0.0.1",
"interface-mask" : "255.255.255.0"
},
{
"interface-name" : "interface-6",
"interface-ip" : "60.0.0.1",
"interface-mask" : "255.255.255.0"
}
]
}
Expand Down Expand Up @@ -156,6 +161,12 @@ def addSwitchToGateway(name):
},
{
"dpid": "3"
},
{
"dpid": "4"
},
{
"dpid": "5"
}
]
}
Expand Down Expand Up @@ -236,6 +247,11 @@ def startNetworkWithLinearTopo( hostCount ):
defaultGatewayIP5 = "50.0.0.1"
configureDefaultGatewayForHost(host5, defaultGatewayIP5)

host6 = net.getNodeByName('h6')
host6.setIP('60.0.0.10', prefixLen=24)
defaultGatewayIP6 = "60.0.0.1"
configureDefaultGatewayForHost(host6, defaultGatewayIP6)


def clearGatewayInstance(name):
data = {}
Expand Down
28 changes: 28 additions & 0 deletions example/mininet/routing_L3_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ def addInterfaceToGateway(name):
"interface-name" : "interface-8",
"interface-ip" : "80.0.0.1",
"interface-mask" : "255.255.255.0"
},
{
"interface-name" : "interface-9",
"interface-ip" : "90.0.0.1",
"interface-mask" : "255.255.255.0"
}
]
}
Expand All @@ -115,6 +120,18 @@ def addSwitchToGateway(name):
},
{
"dpid": "4"
},
{
"dpid": "5"
},
{
"dpid": "6"
},
{
"dpid": "7"
},
{
"dpid": "8"
}
]
}
Expand Down Expand Up @@ -205,6 +222,17 @@ def startNetworkWithTreeTopo():
defaultGatewayIP7 = "70.0.0.1"
configureDefaultGatewayForHost(host7, defaultGatewayIP7)

host8 = net.getNodeByName('h8')
host8.setIP('80.0.0.10', prefixLen=24)
defaultGatewayIP8 = "80.0.0.1"
configureDefaultGatewayForHost(host8, defaultGatewayIP8)


host9 = net.getNodeByName('h9')
host9.setIP('90.0.0.10', prefixLen=24)
defaultGatewayIP9 = "90.0.0.1"
configureDefaultGatewayForHost(host9, defaultGatewayIP9)

# Set switch to OpenFlow 1.3 (Can change to any OpenFlow version)
# switches = net.switches
# for sw in switches:
Expand Down
Loading

0 comments on commit 4132d8f

Please sign in to comment.