当前位置:网站首页>Practice of openvswitch VLAN network
Practice of openvswitch VLAN network
2022-04-23 06:59:00 【Wei Yanhua】
1. establish ovs The interface connects two namespace Form a two-layer network
br0 +--------------------------------------+ +--+ +--+ +---+ | tap1 tap2| +---+ | +--+ +--+ | | | | | | +--------------------------------------+ | | | | | | | | | +------------------+ +-------------------+ | tap1 | | tap2 | |192.168.1.102/24 | | 192.168.1.102/24 | | | | | | | | | | | | | | namespace ns1 | | namespace ns1 | | | | | +------------------+ +-------------------+
ip netns add ns1
ip netns add ns2
ovs-vsctl add-br br0
ovs-vsctl add-port br0 tap1 -- set Interface tap1 type=internal
ip link set tap1 netns ns1
ip netns exec ns1 ip link set dev tap1 up
ovs-vsctl add-port br0 tap2 -- set Interface tap2 type=internal
ip link set tap2 netns ns2
ip netns exec ns2 ip link set dev tap2 up
ip netns exec ns1 ip addr add 192.168.1.102/24 dev tap1
ip netns exec ns2 ip addr add 192.168.1.101/24 dev tap2
ip netns exec ns1 ip link set lo up
ip netns exec ns2 ip link set lo up
ip netns exec ns1 ping -c 4 192.168.1.101
ip netns exec ns1 ping -c 4 192.168.1.102
The verification results :OK
2 vlan Layer 2 network
ip netns add ns1
ip netns add ns2
ovs-vsctl add-br br0
ovs-vsctl add-port br0 tap1 -- set Interface tap1 type=internal
ovs-vsctl set Port tap1 tag=10
ip link set tap1 netns ns1
ip netns exec ns1 ip link set dev tap1 up
ovs-vsctl add-port br0 tap2 -- set Interface tap2 type=internal
ovs-vsctl set Port tap2 tag=11
ip link set tap2 netns ns2
ip netns exec ns2 ip link set dev tap2 up
ip netns exec ns1 ip addr add 192.168.1.101/24 dev tap1
ip netns exec ns2 ip addr add 192.168.1.102/24 dev tap2
ip netns exec ns1 ip link set lo up
ip netns exec ns2 ip link set lo up
-------------------------------------------------------------------------------
The above is the first test configuration
-------------------------------------------------------------------------------
Take two. tap Add different vlan in
ovs-vsctl set Port tap1 tag=10
ovs-vsctl set Port tap2 tag=11
--------------------------------------------------------------------------------
Test again
ip netns exec ns1 ping -c 4 192.168.1.102 Find no way , In line with expectations , Because the two mouths belong to different vlan
newly added br1, Then create namesapce ns3, And create tap3,vlan Belong to tag10
ovs-vsctl add-br br1
ovs-vsctl add-port br1 tap3 -- set Interface tap3 type=internal
ovs-vsctl add-port br0 trunk_br0 trunks=10,11 -- set Interface trunk_br0 type=patch options:peer=trunk_br1
ovs-vsctl add-port br1 trunk_br1 trunks=10,11 -- set Interface trunk_br1 type=patch options:peer=trunk_br0
ip netns add ns3
ip link set tap3 netns ns3
ip netns exec ns3 ip addr add 192.168.1.103/24 dev tap3
ip netns exec ns3 ip link set dev tap3 up
ovs-vsctl set Port tap3 tag=10
---------------------------------------------------------------------------------
Discovery and tap1 Mouth can pass , Follow tap2 Mouth obstruction
In line with expectations
---------------------------------------------------------------------------------
3 test vlan principle
Conclusion :
1. second_br and thrid_br To communicate with each other
2.first_br And tap1 To communicate with each other
3.port 1 and port 4 Belong to turnk mouth , Add all by default vlan in
4. Created interal Port of type , Default join vlan 0 in
[root@slb1 weiyanhua]# ovs-appctl fdb/show br0
port VLAN MAC Age
1 10 de:6a:2a:72:9c:a1 230
4 10 fa:dd:15:95:04:d8 158
4 0 3a:a8:43:c2:1e:88 12
2 0 66:ae:6a:f5:56:8e 12
[root@slb1 weiyanhua]#
[root@slb1 weiyanhua]#
[root@slb1 weiyanhua]# ovs-appctl fdb/show br1
port VLAN MAC Age
1 10 de:6a:2a:72:9c:a1 232
2 10 fa:dd:15:95:04:d8 160
3 0 3a:a8:43:c2:1e:88 14
1 0 66:ae:6a:f5:56:8e 14
[root@slb1 weiyanhua]# ovs-ofctl dump-ports-desc br0
OFPST_PORT_DESC reply (xid=0x2):
1(first_br): addr:00:00:00:00:00:00
config: PORT_DOWN
state: LINK_DOWN
speed: 0 Mbps now, 0 Mbps max
2(second_br): addr:00:00:00:00:00:00
config: PORT_DOWN
state: LINK_DOWN
speed: 0 Mbps now, 0 Mbps max
4(trunk_br0): addr:9a:ff:ff:71:5e:ab
config: 0
state: 0
speed: 0 Mbps now, 0 Mbps max
LOCAL(br0): addr:6e:e4:dd:55:1a:4b
config: PORT_DOWN
state: LINK_DOWN
speed: 0 Mbps now, 0 Mbps max
[root@slb1 weiyanhua]#
[root@slb1 weiyanhua]# ovs-ofctl dump-ports-desc br1
OFPST_PORT_DESC reply (xid=0x2):
1(trunk_br1): addr:b6:bf:f7:6b:15:67
config: 0
state: 0
speed: 0 Mbps now, 0 Mbps max
2(tap1): addr:00:00:00:00:00:00
config: PORT_DOWN
state: LINK_DOWN
speed: 0 Mbps now, 0 Mbps max
3(third_br): addr:00:00:00:00:00:00
config: PORT_DOWN
state: LINK_DOWN
speed: 0 Mbps now, 0 Mbps max
LOCAL(br1): addr:16:64:c6:1c:e0:4b
config: PORT_DOWN
state: LINK_DOWN
speed: 0 Mbps now, 0 Mbps max
[root@slb1 weiyanhua]#
4 ovs bonding Link redundancy
ovs-vsctl add-br br0
ovs-vsctl add-br br1
ip link add br0_tap0 type veth peer name br1_tap0
ip link add br0_tap1 type veth peer name br1_tap1
ip link set br0_tap0 up
ip link set br0_tap1 up
ip link set br1_tap0 up
ip link set br1_tap1 up
ovs-vsctl add-bond br0 bond0 br0_tap0 br0_tap1
ovs-vsctl add-bond br1 bond1 br1_tap0 br1_tap1
ip netns add ns1
ip netns add ns2
ovs-vsctl add-port br0 tap1 -- set Interface tap1 type=internal
ip link set tap1 netns ns1
ip netns exec ns1 ip link set dev tap1 up
ip netns exec ns1 ip addr add 192.168.1.101/24 dev tap1
ovs-vsctl add-port br1 tap2 -- set Interface tap2 type=internal
ip link set tap2 netns ns2
ip netns exec ns2 ip link set dev tap2 up
ip netns exec ns2 ip addr add 192.168.1.102/24 dev tap2
[root@slb1 weiyanhua]# ovs-appctl bond/show
---- bond1 ----
bond_mode: active-backup
bond may use recirculation: no, Recirc-ID : -1
bond-hash-basis: 0
updelay: 0 ms
downdelay: 0 ms
lacp_status: off
lacp_fallback_ab: false
active slave mac: 12:da:b4:4f:d3:aa(br1_tap0)slave br1_tap0: enabled
active slave
may_enable: trueslave br1_tap1: enabled
may_enable: true---- bond0 ----
bond_mode: active-backup
bond may use recirculation: no, Recirc-ID : -1
bond-hash-basis: 0
updelay: 0 ms
downdelay: 0 ms
lacp_status: off
lacp_fallback_ab: false
active slave mac: f6:ab:b8:a1:4d:c2(br0_tap0)slave br0_tap0: enabled
active slave
may_enable: trueslave br0_tap1: enabled
may_enable: true[root@slb1 weiyanhua]#
Created by default bond Active standby mode (bond_mode: active-backup)
br1_tap0 and br0_tap0 Flow goes through this pair
Turn on lacp
[root@slb1 weiyanhua]# ovs-appctl bond/show
---- bond1 ----
bond_mode: active-backup
bond may use recirculation: no, Recirc-ID : -1
bond-hash-basis: 0
updelay: 0 ms
downdelay: 0 ms
lacp_status: negotiated
lacp_fallback_ab: false
active slave mac: 12:da:b4:4f:d3:aa(br1_tap0)slave br1_tap0: enabled
active slave
may_enable: trueslave br1_tap1: enabled
may_enable: true---- bond0 ----
bond_mode: active-backup
bond may use recirculation: no, Recirc-ID : -1
bond-hash-basis: 0
updelay: 0 ms
downdelay: 0 ms
lacp_status: negotiated
lacp_fallback_ab: false
active slave mac: f6:ab:b8:a1:4d:c2(br0_tap0)slave br0_tap0: enabled
active slave
may_enable: trueslave br0_tap1: enabled
may_enable: true[root@slb1 weiyanhua]#
Can catch lacp message :
see lacp Information
[root@slb1 weiyanhua]# ovs-appctl lacp/show
---- bond0 ----
status: active negotiated
sys_id: 2e:70:0d:3f:10:4f
sys_priority: 65534
aggregation key: 1
lacp_time: slowslave: br0_tap0: current attached
port_id: 2
port_priority: 65535
may_enable: trueactor sys_id: 2e:70:0d:3f:10:4f
actor sys_priority: 65534
actor port_id: 2
actor port_priority: 65535
actor key: 1
actor state: activity aggregation synchronized collecting distributingpartner sys_id: 06:ca:c4:5c:ce:47
partner sys_priority: 65534
partner port_id: 1
partner port_priority: 65535
partner key: 1
partner state: activity aggregation synchronized collecting distributingslave: br0_tap1: current attached
port_id: 1
port_priority: 65535
may_enable: trueactor sys_id: 2e:70:0d:3f:10:4f
actor sys_priority: 65534
actor port_id: 1
actor port_priority: 65535
actor key: 1
actor state: activity aggregation synchronized collecting distributingpartner sys_id: 06:ca:c4:5c:ce:47
partner sys_priority: 65534
partner port_id: 2
partner port_priority: 65535
partner key: 1
partner state: activity aggregation synchronized collecting distributing
---- bond1 ----
status: active negotiated
sys_id: 06:ca:c4:5c:ce:47
sys_priority: 65534
aggregation key: 1
lacp_time: slowslave: br1_tap0: current attached
port_id: 1
port_priority: 65535
may_enable: trueactor sys_id: 06:ca:c4:5c:ce:47
actor sys_priority: 65534
actor port_id: 1
actor port_priority: 65535
actor key: 1
actor state: activity aggregation synchronized collecting distributingpartner sys_id: 2e:70:0d:3f:10:4f
partner sys_priority: 65534
partner port_id: 2
partner port_priority: 65535
partner key: 1
partner state: activity aggregation synchronized collecting distributingslave: br1_tap1: current attached
port_id: 2
port_priority: 65535
may_enable: trueactor sys_id: 06:ca:c4:5c:ce:47
actor sys_priority: 65534
actor port_id: 2
actor port_priority: 65535
actor key: 1
actor state: activity aggregation synchronized collecting distributingpartner sys_id: 2e:70:0d:3f:10:4f
partner sys_priority: 65534
partner port_id: 1
partner port_priority: 65535
partner key: 1
partner state: activity aggregation synchronized collecting distributing
[root@slb1 weiyanhua]#
[root@slb1 weiyanhua]#
-
active-backup Lord - To prepare Unable to improve throughput
-
balance-slb, According to the package source MAC + vlan tag To balance traffic
-
banlnce-tcp, According to the package L2/L3/L4 header To balance traffic
banlance-tcp The hardware switch must be set 802.3ad,balance-slb It can be set or not , It is set that the flow increase is relatively large .
-
ovs-vsctl set Port bond0 bond_mode=balance-slb
-
Observe the flow command cat /proc/net/dev
modify hash Pattern
[root@slb1 weiyanhua]# ovs-vsctl set Port bond0 bond_mode=balance-slb
[root@slb1 weiyanhua]#
[root@slb1 weiyanhua]#
[root@slb1 weiyanhua]# ovs-vsctl set Port bond1 bond_mode=balance-slb
[root@slb1 weiyanhua]#
[root@slb1 weiyanhua]#
[root@slb1 weiyanhua]# ovs-appctl bond/show
---- bond1 ----
bond_mode: balance-slb
bond may use recirculation: no, Recirc-ID : -1
bond-hash-basis: 0
updelay: 0 ms
downdelay: 0 ms
next rebalance: 1024 ms
lacp_status: negotiated
lacp_fallback_ab: false
active slave mac: 12:da:b4:4f:d3:aa(br1_tap0)slave br1_tap0: enabled
active slave
may_enable: trueslave br1_tap1: enabled
may_enable: true---- bond0 ----
bond_mode: balance-slb
bond may use recirculation: no, Recirc-ID : -1
bond-hash-basis: 0
updelay: 0 ms
downdelay: 0 ms
next rebalance: 7531 ms
lacp_status: negotiated
lacp_fallback_ab: false
active slave mac: f6:ab:b8:a1:4d:c2(br0_tap0)slave br0_tap0: enabled
active slave
may_enable: trueslave br0_tap1: enabled
may_enable: true[root@slb1 weiyanhua]#
Configure layer display interface and port
[root@slb1 weiyanhua]# ovs-vsctl show
1015cc09-a996-41e6-9c77-b2259e969a49
Bridge "br0"
Port "tap1"
Interface "tap1"
type: internal
Port "br0"
Interface "br0"
type: internal
Port "bond0"
Interface "br0_tap1"
Interface "br0_tap0"
Bridge "br1"
Port "tap2"
Interface "tap2"
type: internal
Port "br1"
Interface "br1"
type: internal
Port "bond1"
Interface "br1_tap0"
Interface "br1_tap1"
ovs_version: "2.11.0"
[root@slb1 weiyanhua]#
openflow The layer shows only interface Will not show port
[root@slb1 weiyanhua]# ovs-ofctl show br0
OFPT_FEATURES_REPLY (xid=0x2): dpid:00002e700d3f104f
n_tables:254, n_buffers:0
capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
1(br0_tap1): addr:3a:66:82:56:6a:68
config: 0
state: 0
current: 10GB-FD COPPER
speed: 10000 Mbps now, 0 Mbps max
2(br0_tap0): addr:f6:ab:b8:a1:4d:c2
config: 0
state: 0
current: 10GB-FD COPPER
speed: 10000 Mbps now, 0 Mbps max
4(tap1): addr:00:00:00:00:00:00
config: PORT_DOWN
state: LINK_DOWN
speed: 0 Mbps now, 0 Mbps max
LOCAL(br0): addr:2e:70:0d:3f:10:4f
config: PORT_DOWN
state: LINK_DOWN
speed: 0 Mbps now, 0 Mbps max
OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0
[root@slb1 weiyanhua]#
datapath The layer also shows only interface, No display port
[root@slb1 weiyanhua]# ovs-dpctl show
2021-09-10T01:23:10Z|00001|dpif_netlink|INFO|The kernel module does not support meters.
system@ovs-system:
lookups: hit:42 missed:12002 lost:0
flows: 0
masks: hit:10098 total:0 hit/pkt:0.84
port 0: ovs-system (internal)
port 1: br0 (internal)
port 2: br1 (internal)
port 3: br0_tap1
port 4: br0_tap0
port 5: br1_tap0
port 6: br1_tap1
port 7: tap1 (internal)
port 8: tap2 (internal)
[root@slb1 weiyanhua]#
ovs In the code structure , It can be roughly divided into the following three levels : Configuration layer ,openflow Layer and conversion layer
Configuration layer openflow layer xlate Conversion layer bridge -> ofproto -> xbridge port -> ofproto_dpif->bundles: ofbundle -> xbundle iface -> ofproto->ports: ofport -> xport
a. adopt ovs-vsctl Configured bridge , Information such as ports and interfaces are considered to be in the configuration layer , have access to ovs-vsctl show Look at all the configurations .
b. stay bridge_reconfigure Function , The configuration layer information will be passed to openflow layer , Every iface Distribute openflow Port number , have access to ovs-ofctl show br1 see .
c. stay type_run Function , take openflow Transfer layer information to xlate layer .
It should be noted that , stay openflow Layer and the datapath You can only see iface, Out of sight port Information . So for bond mouth , When adding flow table information , You can only specify the out port as slave mouth .
Show me datapatch Next message path , After the port mouth
[root@slb1 weiyanhua]# ovs-dpctl show
2021-09-10T01:44:29Z|00001|dpif_netlink|INFO|The kernel module does not support meters.
system@ovs-system:
lookups: hit:1085 missed:12395 lost:0
flows: 12
masks: hit:12776 total:2 hit/pkt:0.95
port 0: ovs-system (internal)
port 1: br0 (internal)
port 2: br1 (internal)
port 3: br0_tap1
port 4: br0_tap0
port 5: br1_tap0
port 6: br1_tap1
port 7: tap1 (internal)
port 8: tap2 (internal)
[root@slb1 weiyanhua]#
[root@slb1 weiyanhua]# ovs-dpctl dump-flows
2021-09-10T01:44:36Z|00001|dpif_netlink|INFO|The kernel module does not support meters.
recirc_id(0),in_port(8),eth(src=c6:18:15:7f:86:05,dst=f2:ce:eb:63:45:e4),eth_type(0x0800),ipv4(frag=no), packets:262, bytes:25676, used:0.303s, actions:5
recirc_id(0),in_port(7),eth(src=f2:ce:eb:63:45:e4,dst=c6:18:15:7f:86:05),eth_type(0x0800),ipv4(frag=no), packets:262, bytes:25676, used:0.303s, actions:4
recirc_id(0),in_port(4),eth(src=c6:18:15:7f:86:05,dst=f2:ce:eb:63:45:e4),eth_type(0x0800),ipv4(frag=no), packets:262, bytes:25676, used:0.303s, actions:7
recirc_id(0),in_port(5),eth(src=f2:ce:eb:63:45:e4,dst=c6:18:15:7f:86:05),eth_type(0x0800),ipv4(frag=no), packets:262, bytes:25676, used:0.303s, actions:8
[root@slb1 weiyanhua]#
Show... In the flow table port Of name, Convenient for observation
[root@slb1 weiyanhua]# ovs-dpctl dump-flows --names
2021-09-10T04:57:47Z|00001|dpif_netlink|INFO|The kernel module does not support meters.
recirc_id(0),in_port(br0_tap0),eth(),eth_type(0x8809), packets:0, bytes:0, used:never, actions:userspace(pid=4294962660,slow_path(lacp))
recirc_id(0),in_port(br1_tap1),eth(),eth_type(0x8809), packets:0, bytes:0, used:never, actions:userspace(pid=4294962660,slow_path(lacp))
recirc_id(0),in_port(tap1),eth(src=f2:ce:eb:63:45:e4,dst=c6:18:15:7f:86:05),eth_type(0x0800),ipv4(frag=no), packets:11853, bytes:1161594, used:0.913s, actions:br0_tap0
recirc_id(0),in_port(br1_tap0),eth(src=f2:ce:eb:63:45:e4,dst=c6:18:15:7f:86:05),eth_type(0x0800),ipv4(frag=no), packets:11853, bytes:1161594, used:0.913s, actions:tap2
recirc_id(0),in_port(tap2),eth(src=c6:18:15:7f:86:05,dst=f2:ce:eb:63:45:e4),eth_type(0x0800),ipv4(frag=no), packets:11853, bytes:1161594, used:0.913s, actions:br1_tap0
recirc_id(0),in_port(br0_tap1),eth(),eth_type(0x8809), packets:0, bytes:0, used:never, actions:userspace(pid=4294962660,slow_path(lacp))
recirc_id(0),in_port(br0_tap0),eth(src=c6:18:15:7f:86:05,dst=f2:ce:eb:63:45:e4),eth_type(0x0800),ipv4(frag=no), packets:11853, bytes:1161594, used:0.913s, actions:tap1
recirc_id(0),in_port(br1_tap0),eth(),eth_type(0x8809), packets:0, bytes:0, used:never, actions:userspace(pid=4294962660,slow_path(lacp))
[root@slb1 weiyanhua]#
4.1 bond Implementation notes
4.1.1 bond Export direction message processing
If the outgoing port is bond Of slave mouth , How to choose slave What about the mouth ?
There are two cases , If the flow table directly specifies that the outbound port is slave mouth , Then the message will only be sent from slave To utter , Another case is that the flow table does not specify slave mouth , But through normal Action forward , This situation bond Forwarding will take effect
static void
output_normal(struct xlate_ctx *ctx, const struct xbundle *out_xbundle,
const struct xvlan *xvlan)
{
uint16_t vid;
union flow_vlan_hdr old_vlans[FLOW_MAX_VLAN_HEADERS];
struct xport *xport;
struct xlate_bond_recirc xr;
bool use_recirc = false;
struct xvlan out_xvlan;
check_and_set_cvlan_mask(ctx->wc, out_xbundle);
xvlan_output_translate(out_xbundle, xvlan, &out_xvlan);
if (out_xbundle->use_priority_tags) {
out_xvlan.v[0].pcp = ntohs(ctx->xin->flow.vlans[0].tci) &
VLAN_PCP_MASK;
}
vid = out_xvlan.v[0].vid;
if (ovs_list_is_empty(&out_xbundle->xports)) {
/* Partially configured bundle with no slaves. Drop the packet. */
return;
} else if (!out_xbundle->bond) {
xport = CONTAINER_OF(ovs_list_front(&out_xbundle->xports), struct xport,
bundle_node);
} else {
struct flow_wildcards *wc = ctx->wc;
struct ofport_dpif *ofport;
if (ctx->xbridge->support.odp.recirc) {
/* In case recirculation is not actually in use, 'xr.recirc_id'
* will be set to '0', since a valid 'recirc_id' can
* not be zero. */
bond_update_post_recirc_rules(out_xbundle->bond,
&xr.recirc_id,
&xr.hash_basis);
if (xr.recirc_id) {
/* Use recirculation instead of output. */
use_recirc = true;
xr.hash_alg = OVS_HASH_ALG_L4;
/* Recirculation does not require unmasking hash fields. */
wc = NULL;
}
}
ofport = bond_choose_output_slave(out_xbundle->bond,
&ctx->xin->flow, wc, vid);
xport = xport_lookup(ctx->xcfg, ofport);
if (!xport) {
/* No slaves enabled, so drop packet. */
return;
}
/* If use_recirc is set, the main thread will handle stats
* accounting for this bond. */
if (!use_recirc) {
if (ctx->xin->resubmit_stats) {
bond_account(out_xbundle->bond, &ctx->xin->flow, vid,
ctx->xin->resubmit_stats->n_bytes);
}
if (ctx->xin->xcache) {
struct xc_entry *entry;
struct flow *flow;
flow = &ctx->xin->flow;
entry = xlate_cache_add_entry(ctx->xin->xcache, XC_BOND);
entry->bond.bond = bond_ref(out_xbundle->bond);
entry->bond.flow = xmemdup(flow, sizeof *flow);
entry->bond.vid = vid;
}
}
}
memcpy(&old_vlans, &ctx->xin->flow.vlans, sizeof(old_vlans));
xvlan_put(&ctx->xin->flow, &out_xvlan);
compose_output_action(ctx, xport->ofp_port, use_recirc ? &xr : NULL,
false, false);
memcpy(&ctx->xin->flow.vlans, &old_vlans, sizeof(old_vlans));
}
Judgment is bond mouth , stay bond Of slave Select the port according to the load algorithm ,bond_choose_output_slave
static struct bond_slave *
choose_output_slave(const struct bond *bond, const struct flow *flow,
struct flow_wildcards *wc, uint16_t vlan)
{
struct bond_entry *e;
int balance;
balance = bond->balance;
if (bond->lacp_status == LACP_CONFIGURED) {
/* LACP has been configured on this bond but negotiations were
* unsuccussful. If lacp_fallback_ab is enabled use active-
* backup mode else drop all traffic. */
if (!bond->lacp_fallback_ab) {
return NULL;
}
balance = BM_AB;
}
switch (balance) {
case BM_AB:
return bond->active_slave;
case BM_TCP:
if (bond->lacp_status != LACP_NEGOTIATED) {
/* Must have LACP negotiations for TCP balanced bonds. */
return NULL;
}
if (wc) {
flow_mask_hash_fields(flow, wc, NX_HASH_FIELDS_SYMMETRIC_L3L4_UDP);
}
/* Fall Through. */
case BM_SLB:
if (wc && balance == BM_SLB) {
flow_mask_hash_fields(flow, wc, NX_HASH_FIELDS_ETH_SRC);
}
e = lookup_bond_entry(bond, flow, vlan);
if (!e->slave || !e->slave->enabled) {
e->slave = get_enabled_slave(CONST_CAST(struct bond*, bond));
}
return e->slave;
default:
OVS_NOT_REACHED();
}
}
4.1.2 bond Incoming direction message processing
stay active-backup In mode , If inactive slave Received multicast / Broadcast message , And it was normal Flow meter , Will be drop, The code flow is as follows .
do_xlate_actions->xlate_output_action->xlate_normal->is_admissible->bond_check_admissibility
enum bond_verdict
bond_check_admissibility(struct bond *bond, const void *slave_,
const struct eth_addr eth_dst)
{
...
/* Drop all multicast packets on inactive slaves. */
if (eth_addr_is_multicast(eth_dst)) {
if (bond->active_slave != slave) {
goto out;
}
}
...
}
版权声明
本文为[Wei Yanhua]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230557208239.html
边栏推荐
- SQL学习|复杂查询
- 阅读笔记:Meta Matrix Factorization for Federated Rating Predictions
- 压力测试工具 Jmeter
- Offset et client pour obtenir des informations sur l'emplacement des éléments Dom
- Leak detection and vacancy filling (II)
- [MySQL basics] startup options, system variables and status variables
- TP6 的 each 遍历用法
- DNA reveals surprise ancestry of mysterious Chinese mummies
- Leak detection and vacancy filling (III)
- Web登录小案例(含验证码登录)
猜你喜欢
随机推荐
Curry realization of function continuous call calculation and accumulation
[MySQL basics] startup options, system variables and status variables
【不积跬步无以至千里】Oracle应用导数Ora-01455报错处理
虚拟环境中使用jupyter notebook
【代码解析(5)】Communication-Efficient Learning of Deep Networks from Decentralized Data
【代码解析(2)】Communication-Efficient Learning of Deep Networks from Decentralized Data
JS实现网页轮播图
阅读笔记:Secure Federated Matrix Factorization
阅读笔记:Meta Matrix Factorization for Federated Rating Predictions
How to use tiup to deploy a tidb V5 0 cluster
TypeScript(下)
rdma 介绍
MySQL server standalone deployment manual
【MySQL基础篇】启动选项与配置文件
Baidu map coordinates, Google coordinates and Tencent coordinates are mutually transformed
【不积跬步无以至千里】MySQL报大量unauthenticated user连接错误
Centos8 builds php8 0.3 operating environment
Number of stair climbing methods of leetcode
virtio 与vhost_net介绍
Oracle性能分析工具:OSWatcher