Assigning Switches L3 Addresses

67 views
Skip to first unread message

Stefan Jevtic

unread,
Jun 14, 2017, 7:06:05 PM6/14/17
to ofswitch13-users
Hi Everyone,

I'd like to build a network containing multiple subnets, but I'm having trouble assigning the OF switches IP addresses that will not violate the hierarchical nature of IP.

To be more specific, I'd like to create 4 switches under a single controller, with each switch having its own CSMA subnetwork of hosts underneath it.

So, I think the first real hurdle i have to clear is assigning IP addresses to the switches. In the following image, I'm thinking they'd be 

10.100.1.1   Controller
10.100.2.1   Switch 0
10.100.3.1   Switch 1
10.100.4.1   Switch 2
10.100.5.1   Switch 3
10.100.2.2   Host 1
etc...

I can use the of13Helper->SetAddressBase() to offset the start of the address scheme, but I end up with the switches being 10.100.1.2, 10.100.1.3 etc...

Is there a method I've overlooked or should I jump into the helper and make something work?

Thanks,
Stefan


Stefan Jevtic

unread,
Jun 14, 2017, 9:02:09 PM6/14/17
to ofswitch13-users
Update:
Using the normal Ipv4AddressHelper I can assign host L3 addresses as I would like. This is done using:
Ipv4AddressHelper ipv4helpr;
ipv4helpr.SetBase ("10.100.2.0","255.255.255.0","0.0.0.2");
  for (i = 0; i<nHostSwitches; ++i){
    hostIpIfaces[i] = ipv4helpr.Assign(hostDevices[i]);
    ipv4helpr.NewNetwork();
  } 

But, as of yet, assigning the switches their L3 addresses according to the above scheme is proving elusive.

My best attempt so far is to modify OFSwitch13ExternalHelper::CreateOpenFlowChannels (void) away from its normal behavior of:
m_ipv4helper.Assign (switchDevices);

to assigning addresses to each switchDevice individually, and calling NewNetwork() to advance to the next subnet address.

I don't see why this wouldn't work. And I believe it does assign the addresses I intend it to assign, but now the controller isn't able to make communication and I'm stuck.

Thanks,
Stefan

Stefan Jevtic

unread,
Jun 16, 2017, 10:17:00 AM6/16/17
to ofswitch13-users
Yeah, so that was foolish. I'll blame sleep deprivation.

Resolved by remembering that the control and data planes are logically separate. Sorry about that.

Hessam Alizadeh

unread,
Aug 30, 2020, 7:31:29 PM8/30/20
to ofswitch13-users
Hi,
Could you please share your code?
Thanks,

Stefan Jevtic

unread,
Aug 31, 2020, 10:37:32 AM8/31/20
to ofswitch13-users
Hi Hessam,

I believe you have all of the code I wrote for this project. You might consider asking Dr. Kim for it if you don't have it handy. I don't know if i can dig it up, it's been a few years now. Feel free to ping me directly if you're still having trouble.

Thanks,
Stefan
Reply all
Reply to author
Forward
0 new messages