Hello,
As part of my project, I am working on a load balancer with 2 switches in the topology (JSON file). I followed the tutorials, and I found hosts broadcasting to send a packet from one host to another via the ports on the switch.
I’m using bmv2 just like in the tutorials.
In my implementation, however, I want to send the packets on switch 1 when I initiate a packet. Is it possible to have static IP and MAC addresses for the switches in the topology json the way hosts have them? I want to use the static MAC address of the switch when sending a packet.
I’m not sure if this will disrupt the setup in the tutorials exercise folder because in the run_exercie.py , I see for link in host_links:
host_name = link[‘node1’]
sw_name, sw_port = self.parse_switch_node(link[‘node2’])
host_ip = hosts[host_name][‘ip’]
host_mac = hosts[host_name][‘mac’]
self.addHost(host_name, ip=host_ip, mac=host_mac)
self.addLink(host_name, sw_name,
delay=link[‘latency’], bw=link[‘bandwidth’],
port2=sw_port)
for link in switch_links:
sw1_name, sw1_port = self.parse_switch_node(link['node1'])
sw2_name, sw2_port = self.parse_switch_node(link['node2'])
self.addLink(sw1_name, sw2_name,
port1=sw1_port, port2=sw2_port,
delay=link['latency'], bw=link['bandwidth']).
Thanks a lot in advance!