FlowForwarding / LINC-Switch

OpenFlow Software Switch written in Erlang
http://flowforwarding.org
Other
213 stars 80 forks source link

how to create tap interfaces #57

Closed rpt closed 11 years ago

rpt commented 11 years ago

gandhi mathi wrote:

I am new to LINC switch.I tried the testbed set up and ping .I didn't understand the tap interfaces creation explained in testbed setup. When I run the switch after editing sys.config in rel folder , it is giving me error as " no function clause matching linc_us4_port:init([{ofs_port_no,1},{interface,"tap0"},{ip,"fe80::216:3eff:fe39:c3fe"}]) line 247 in gen_server:init_it/6 line 328" . Do I need to assign the ip addresses manually or shall I use the IPV6 address.

Please paste your sys.config file and provide us with some basic informations:

mathiyuva commented 11 years ago

1.The LINC version is:LINC openflow1.2 2.OS:Ubuntu 12.04.1 LTS precise

  1. I tried to create the testbed set up given in the URL,https://github.com/FlowForwarding/LINC-Switch/blob/master/docs/testbed-setup.md , but I didn't understand the tap interfaces creation explained in the bottom of the page. 4.Yes. I am using Xen-hypervisor-4.1-amd64 on my laptop having 8GB RAM .I am using external hard drive for guest VMs. In my set up, I have two guest images vm2 and vm3. I just tried whatever explained in the testbed setup. Thanks gandhi
rpt commented 11 years ago

It looks like a mistake in LINC configuration. Maybe you're using old syntax. Please paste your sys.config file.

mathiyuva commented 11 years ago

The following is the sys.config file [ {linc, [ %% Following setting enables or disables OF-Config subsystem which consists %% of three applications: ssh, enetconf and of_config. %% Allowed values: 'enabled' | 'disabled' {of_config, disabled},

%% Configuration of the controllers switch will connect to. Ideally this list %% should be empty and assignement should be handled by an OF-Config client. %% Default OFP controller port is 6633. {controllers, [ {"localhost", 6633, [{auxiliary_connections, [{tcp, 0}]}]} ]},

%% Configuration of switch backend implementation used by ofs_logic process. %% By default an Erlang userspace 1.3.1 implementation is selected. %% Allowed values: 'linc_us3' | 'linc_us4' {backend, linc_us4},

{backends_opts, [ %% Options for userspace backend v4 - OpenFlow 1.3.1 {linc_us4, [ %% Configure ports available to the switch when using the %% userspace backend according to your system setup. %% * Under Linux all TAP interfaces must be set up beforehand %% as persistent. %% * Under MacOSX TAP interfaces are created during node %% startup (which requires setting an ip parameter). {ports, [ %% {1, [{interface, "eth0"}]}, %% {2, [{interface, "tap0"}]}, %% {3, [{interface, "tap1"}, {ip, "10.0.0.1"}]} ]}, %% Enable or disbale queues subsystem %% Allowed values: 'enabled' | 'disabled' {queues_status, disabled}, %% If queues are enabled, assign them to ports and set appropriate rates {queues, [ {port, 1, [{port_rate, {100, kbps}}, {port_queues, [ {1, [{min_rate, 100}, {max_rate, 100}]}, {2, [{min_rate, 100}, {max_rate, 100}]} ]}]}, {port, 2, [{port_rate, {100, kbps}}, {port_queues, [ {1, [{min_rate, 100}, {max_rate, 100}]}, {2, [{min_rate, 100}, {max_rate, 100}]} ]}]} ]} ]}, %% Options for userspace backend v3 - OpenFlow 1.2 {linc_us3, [ %% Configure ports available to the switch when using the %% userspace backend according to your system setup. %% * Under Linux all TAP interfaces must be set up beforehand %% as persistent. %% * Under MacOSX TAP interfaces are created during node %% startup (which requires setting an ip parameter). {ports, [ %% {1, [{interface, "eth0"}]}, %% {2, [{interface, "tap0"}]}, %% {3, [{interface, "tap1"}, {ip, "10.0.0.1"}]} ]}, %% Enable or disbale queues subsystem %% Allowed values: 'enabled' | 'disabled' {queues_status, disabled}, %% If queues are enabled, assign them to ports and set appropriate rates {queues, [ {port, 1, [{port_rate, {100, kbps}}, {port_queues, [ {1, [{min_rate, 100}, {max_rate, 100}]}, {2, [{min_rate, 100}, {max_rate, 100}]} ]}]}, {port, 2, [{port_rate, {100, kbps}}, {port_queues, [ {1, [{min_rate, 100}, {max_rate, 100}]}, {2, [{min_rate, 100}, {max_rate, 100}]} ]}]} ]} ]} ]} ]},

{enetconf, [ {capabilities, [{base, {1, 1}}]}, {callback_module, linc_ofconfig}, {sshd_ip, any}, {sshd_port, 1830}, {sshd_user_passwords, [ {"linc", "linc"} ]} ]},

{lager, [ {handlers, [ {lager_console_backend, info}, {lager_file_backend, [ {"log/error.log", error, 10485760, "$D0", 5}, {"log/console.log", info, 10485760, "$D0", 5} ]} ]} ]},

{sasl, [ {sasl_error_logger, {file, "log/sasl-error.log"}}, {errlog_type, error}, {error_logger_mf_dir, "log/sasl"}, % Log directory {error_logger_mf_maxbytes, 10485760}, % 10 MB max file size {error_logger_mf_maxfiles, 5} % 5 files max ]} ]. This is my xm list: root@roadrunner:/home/flow# xm list

Name ID Mem VCPUs State Time(s) Domain-0 0 6776 8 r----- 1025.6 vm2 5 500 1 -b---- 2.9 vm3 6 500 1 -b---- 2.9

Actually after starting the two guest OS es, the ifconfig shows a tmpbridge and eth0, vif5.0,vif6.0 interfaces and brctl show shows that these interfaces are added with tmpbridge. As per the testbed setup if I added newbridge br-linc1 and tried to connect tap-linc-port1 and an interface eth0, it showing message as "the device tap-linc-port1 is already a member of the bridge, it can not be added to br-linc1". My question is how to connect virtual machines vm2 and vm3 with LINC switch. I want to know the basic network configuration between virtual machines and LINC switch. So that I can edit the sys.config file accordingly.

Thanks gandhi

mathiyuva commented 11 years ago

Hi, Do you mean the sys.config file under the folder /LINC-Switch/rel/linc/releases/1.0/sys.config?

Actually after starting the two guest OS es, the ifconfig shows a tmpbridge and eth0, vif5.0,vif6.0 interfaces and brctl show shows that these interfaces are added with tmpbridge. As per the testbed setup if I added newbridge br-linc1 and tried to connect tap-linc-port1 and an interface eth0, it showing message as "the device tap-linc-port1 is already a member of the bridge, it can not be added to br-linc1". My question is how to connect virtual machines vm2 and vm3 with LINC switch. I want to know the basic network configuration between virtual machines and LINC switch. So that I can edit the sys.config file accordingly. I am sorry if I am asking very basic details. I am new to networking area.

Thanks gandhi

On 11 January 2013 04:02, Krzysztof Rutka notifications@github.com wrote:

It looks like a mistake in LINC configuration. Maybe you're using old syntax. Please paste your sys.config file.

— Reply to this email directly or view it on GitHubhttps://github.com/FlowForwarding/LINC-Switch/issues/57#issuecomment-12138079.

rpt commented 11 years ago

The sys.config file you pasted looks like a default one - there are no ports configured.

If vif5.0 and vif6.0 are VMs virtual interfaces and tap-linc-port1 and tap-linc-port2 are TAP interfaces on the host all you have to do it bridge them together - vif5.0 with tap-linc-port1 using one bridge (br-linc1), vif6.0 and tap-linc-port2 using another bridge (e.g. br-linc2) - and edit the sys.config file as follows:

...
{backends_opts,
 [
  {linc_us4,
   [
    ...
    {ports,
     [
      {1, [{interface, "tap-linc-port1"}]},
      {2, [{interface, "tap-linc-port2"}]}
     ]},
...

When you edit sys.config in rel/files/ you have to rebuild LINC with make. If you're editing it in rel/linc/releases/x.x/ you can just restart the switch, but remember that running make will override your changes with the defaults from rel/files/sys.config.

mathiyuva commented 11 years ago

Hi Rutka, Thank you very much for your reply. As you told I created interfaces and edited the sys.config file. After that I started the controller in one window and started the switch in another window it worked well. sys.config file: [ {linc, [ %% Following setting enables or disables OF-Config subsystem which consists %% of three applications: ssh, enetconf and of_config. %% Allowed values: 'enabled' | 'disabled' {of_config, disabled},

%% Configuration of the controllers switch will connect to. Ideally this list %% should be empty and assignement should be handled by an OF-Config client. %% Default OFP controller port is 6633. {controllers, [ {"localhost", 6633} ]},

%% Configuration of switch backend implementation used by ofs_logic process. %% By default an Erlang userspace 1.3.1 implementation is selected. %% Allowed values: 'linc_us3' | 'linc_us4' {backend, linc_us4},

{backends_opts, [ %% Options for userspace backend v4 - OpenFlow 1.3.1 {linc_us4, [ %% Configure ports available to the switch when using the %% userspace backend according to your system setup. %% * Under Linux all TAP interfaces must be set up beforehand %% as persistent. %% * Under MacOSX TAP interfaces are created during node %% startup (which requires setting an ip parameter). {ports, [ {1, [{interface, "tap-linc-port1"},{ip, "10.0.0.1"}]}, {2, [{interface, "tap-linc-port2"},{ip, "10.0.0.2"}]}

    ]},
   %% Enable or disbale queues subsystem
   %% Allowed values: 'enabled' | 'disabled'
   {queues_status, disabled},
   %% If queues are enabled, assign them to ports and set appropriate

rates {queues, [ {port, 1, [{port_rate, {100, kbps}}, {port_queues, [ {1, [{min_rate, 100}, {max_rate, 100}]}, {2, [{min_rate, 100}, {max_rate, 100}]} ]}]}, {port, 2, [{port_rate, {100, kbps}}, {port_queues, [ {1, [{min_rate, 100}, {max_rate, 100}]}, {2, [{min_rate, 100}, {max_rate, 100}]} ]}]} ]} ]}, %% Options for userspace backend v3 - OpenFlow 1.2 {linc_us3, [ %% Configure ports available to the switch when using the %% userspace backend according to your system setup. %% * Under Linux all TAP interfaces must be set up beforehand %% as persistent. %% * Under MacOSX TAP interfaces are created during node %% startup (which requires setting an ip parameter). {ports, [ %% {1, [{interface, "eth0"}]}, %% {2, [{interface, "tap0"}]}, %% {3, [{interface, "tap1"}, {ip, "10.0.0.1"}]} ]}, %% Enable or disbale queues subsystem %% Allowed values: 'enabled' | 'disabled' {queues_status, disabled}, %% If queues are enabled, assign them to ports and set appropriate rates {queues, [ {port, 1, [{port_rate, {100, kbps}}, {port_queues, [ {1, [{min_rate, 100}, {max_rate, 100}]}, {2, [{min_rate, 100}, {max_rate, 100}]} ]}]}, {port, 2, [{port_rate, {100, kbps}}, {port_queues, [ {1, [{min_rate, 100}, {max_rate, 100}]}, {2, [{min_rate, 100}, {max_rate, 100}]} ]}]} ]} ]} ]} ]},

{enetconf, [ {capabilities, [{base, {1, 1}}]}, {callback_module, linc_ofconfig}, {sshd_ip, any}, {sshd_port, 1830}, {sshd_user_passwords, [ {"linc", "linc"} ]} ]},

{lager, [ {handlers, [ {lager_console_backend, info}, {lager_file_backend, [ {"log/error.log", error, 10485760, "$D0", 5}, {"log/console.log", info, 10485760, "$D0", 5} ]} ]} ]},

{sasl, [ {sasl_error_logger, {file, "log/sasl-error.log"}}, {errlog_type, error}, {error_logger_mf_dir, "log/sasl"}, % Log directory {error_logger_mf_maxbytes, 10485760}, % 10 MB max file size {error_logger_mf_maxfiles, 5} % 5 files max ]} ].

Now I have to try the Ping setup.

Thanks gandhi

On 16 January 2013 04:10, Krzysztof Rutka notifications@github.com wrote:

The sys.config file you pasted looks like a default one - there are no ports configured.

If vif5.0 and vif6.0 are VMs virtual interfaces and tap-linc-port1 and tap-linc-port2 are TAP interfaces on the host all you have to do it bridge them together - vif5.0 with tap-linc-port1 using one bridge ( br-linc1), vif6.0 and tap-linc-port2 using another bridge (e.g. br-linc2)

  • and edit the sys.config file as follows:

...{backends_opts, [ {linc_us4, [ ... {ports, [ {1, [{interface, "tap-linc-port1"}]}, {2, [{interface, "tap-linc-port2"}]} ]},...

When you edit sys.config in rel/files/ you have to rebuild LINC with make. If you're editing it in rel/linc/releases/x.x/ you can just restart the switch, but remember that running make will override your changes with the defaults from rel/files/sys.config.

— Reply to this email directly or view it on GitHubhttps://github.com/FlowForwarding/LINC-Switch/issues/57#issuecomment-12311875.

rpt commented 11 years ago

The description in the 'Ping setup' wiki is a little outdated and I wouldn't recommend following it.

What I would recommend is to run the ./of_controller_v4.sh (or ./of_controller.sh for the v3 backend) script from the scripts directory. It's a simple controller logic implementing basic layer 2 mac-learning switch functionality. It will make the Ping between the VMs work automatically, without manually inserting flows.

If you know Python you can take a look at Ryu and write some custom controller logic yourself.

mathiyuva commented 11 years ago

Hi, Yes. I tried several times the Ping procedure given in the wiki, but It didn't work for me. Thank you very much for the information. I will try Ryu.

Thanks gandhi

On 17 January 2013 02:40, Krzysztof Rutka notifications@github.com wrote:

The description in the 'Ping setup' wiki is a little outdated and I wouldn't recommend following it.

What I would recommend is to run the ./of_controller_v4.sh (or ./of_controller.sh for the v3 backend) script from the scripts directory. It's a simple controller logic implementing basic layer 2 mac-learning switch functionality. It will make the Ping between the VMs work automatically, without manually inserting flows.

If you know Python you can take a look at Ryuhttps://github.com/osrg/ryuand write some custom controller logic yourself.

— Reply to this email directly or view it on GitHubhttps://github.com/FlowForwarding/LINC-Switch/issues/57#issuecomment-12358915.