On 2013年05月27日 12:14, huntxu wrote:
On Mon, 27 May 2013 11:08:31 +0800, bill4carson <bill4car...@gmail.com> wrote:

Hi, HuntXu

On 2013年05月27日 10:42, huntxu wrote:
On Mon, 27 May 2013 10:30:28 +0800, bill4carson <bill4car...@gmail.com> wrote:

Hi, All

As we konw, ovs-vsctl add-br br0 ; ovs-vsctl add-port br0 is used to create an 
bridge and add a port into it
While after I creating several such kind bridges, can I specify how those 
bridges are connected to each other
using openvswith to make a simple network topology?


This has been already well documented in the FAQ.

"Q: How do I connect two bridges?" in the Basic Configuration section.


I'm quite new to openvswitch and SDN, so sorry for stupid questions.
Thanks for your info :), I just git pull my tree, found below descriptions:

330 A: First, why do you want to do this? Two connected bridges are not
331 much different from a single bridge, so you might as well just have
332 a single bridge with all your ports on it.
333
334 If you still want to connect two bridges, you can use a pair of
335 patch ports. The following example creates bridges br0 and br1,
336 adds eth0 and tap0 to br0, adds tap1 to br1, and then connects br0
337 and br1 with a pair of patch ports.
338
339 ovs-vsctl add-br br0
340 ovs-vsctl add-port br0 eth0
341 ovs-vsctl add-port br0 tap0
342 ovs-vsctl add-br br1
343 ovs-vsctl add-port br1 tap1
344 ovs-vsctl \
345 -- add-port br0 patch0 \
346 -- set interface patch0 type=patch options:peer=patch1 \
347 -- add-port br1 patch1 \
348 -- set interface patch1 type=patch options:peer=patch0

Actually, I'm afraid this is not what I want, I mean the "patch ports" things.

What do you want exactly? Aren't you going to connect two bridges together,
or I've misunderstood something?

In my understanding, openvswitch provide means to create an virtual bridge, and 
method to add ports into this bridge,
most importantly, virtual machine could use tap interface to attach into this 
bridge, which means a remote controller
will be able to manipulate all the flow coming/leaving this bridge's ports as 
below:

ovs-ofctl add-flow br0 nw_src=220.181.111.147,actions=drop

In short words, this bridge is isolated from other bridges created in the same 
manner, only if we could define how those
bridges are connected to each other, to be more precisely, like connecting 
bridge A port x to bridge B port y to make
a network topology much like the real world.


Patch ports are used for connecting bridges. After you connect two bridges
with a pair of patch ports, you could use 'ovs-ofctl show [bridge]' to get the
respective port number of each of the patch port pair. And that presents a
connection between port x of bridge A to port y of bridge B.

I did take a try using the  patch ports, here is the log I got:

br0 has eth0 tap0 and patch0 as its ports:

ovs-ofctl show br0
OFPT_FEATURES_REPLY (xid=0x2): dpid:0000bc305bacde7f
n_tables:254, n_buffers:256
capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST 
SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
 1(eth0): addr:bc:30:5b:ac:de:7f
     config:     0
     state:      0
     current:    100MB-FD COPPER AUTO_NEG
     advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
     supported:  10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
     speed: 100 Mbps now, 1000 Mbps max
 2(tap0): addr:46:c6:01:a2:eb:b4
     config:     0
     state:      0
     current:    10MB-FD COPPER
     speed: 10 Mbps now, 0 Mbps max
 3(patch0): addr:ca:48:44:23:45:c1
     config:     0
     state:      0
     speed: 0 Mbps now, 0 Mbps max
 LOCAL(br0): addr:bc:30:5b:ac:de:7f
     config:     0
     state:      0
     speed: 0 Mbps now, 0 Mbps max
OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0


br1 has eth1 tap1 and patch1 as its ports:

ovs-ofctl show br1
OFPT_FEATURES_REPLY (xid=0x2): dpid:0000000e0c013015
n_tables:254, n_buffers:256
capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST 
SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
 1(eth1): addr:00:0e:0c:01:30:15
     config:     0
     state:      0
     current:    100MB-FD AUTO_NEG
     advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG
     supported:  10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG
     speed: 100 Mbps now, 100 Mbps max
 2(tap1): addr:02:7c:1e:51:cd:8d
     config:     0
     state:      0
     current:    10MB-FD COPPER
     speed: 10 Mbps now, 0 Mbps max
 3(patch1): addr:ea:90:cf:8b:21:2c
     config:     0
     state:      0
     speed: 0 Mbps now, 0 Mbps max
 LOCAL(br1): addr:00:0e:0c:01:30:15
     config:     0
     state:      0
     speed: 0 Mbps now, 0 Mbps max
OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0

Cannot understand how above logs indicate how br0 connected into br1, am I 
missing something obviously?

I'm not sure I put my thoughts clearly, and appreciate any inputs through.




--
八百里秦川尘土飞扬,三千万老陕齐吼秦腔。

--bill
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to