faucet.valve_route module

Valve IPv4/IPv6 routing implementation.

class faucet.valve_route.AnonVLAN(vid)[source]

Bases: object

The anonymous VLAN for global routing

class faucet.valve_route.NextHop(eth_src, port, now)[source]

Bases: object

Describes a directly connected (at layer 2) nexthop.

age(now)[source]

Return age of this nexthop.

cache_time
dead(max_fib_retries)[source]

Return True if this nexthop is considered dead.

eth_src
last_retry_time
next_retry(now, max_resolve_backoff_time)[source]

Increment state for next retry.

next_retry_time
port
resolution_due(now, max_age)[source]

Return True if this nexthop is due to be re resolved/retried.

resolve_retries
class faucet.valve_route.ValveIPv4RouteManager(logger, notify, global_vlan, neighbor_timeout, max_hosts_per_resolve_cycle, max_host_fib_retry_count, max_resolve_backoff_time, proactive_learn, dec_ttl, multi_out, fib_table, vip_table, pipeline, routers, stack_manager)[source]

Bases: faucet.valve_route.ValveRouteManager

Implement IPv4 RIB/FIB.

CONTROL_ETH_TYPES = (2048, 2054)
ETH_TYPE = 2048
ICMP_SIZE = 174
ICMP_TYPE = 1
IPV = 4
IP_PKT

alias of ryu.lib.packet.ipv4.ipv4

active
advertise(_vlan)[source]
control_plane_handler(now, pkt_meta)[source]

Handle packets destined for router otherwise proactively learn host information

dec_ttl
fib_table
global_routing
global_vlan
logger
max_host_fib_retry_count
max_hosts_per_resolve_cycle
max_resolve_backoff_time
multi_out
neighbor_timeout
notify
pipeline
proactive_learn
route_priority
routers
switch_manager
vip_table
class faucet.valve_route.ValveIPv6RouteManager(logger, notify, global_vlan, neighbor_timeout, max_hosts_per_resolve_cycle, max_host_fib_retry_count, max_resolve_backoff_time, proactive_learn, dec_ttl, multi_out, fib_table, vip_table, pipeline, routers, stack_manager)[source]

Bases: faucet.valve_route.ValveRouteManager

Implement IPv6 FIB.

CONTROL_ETH_TYPES = (34525,)
ETH_TYPE = 34525
ICMP_SIZE = 194
ICMP_TYPE = 58
IPV = 6
IP_PKT

alias of ryu.lib.packet.ipv6.ipv6

active
advertise(vlan)[source]
control_plane_handler(now, pkt_meta)[source]

Resolve packets destined for router or proactively learn host information

dec_ttl
fib_table
global_routing
global_vlan
logger
max_host_fib_retry_count
max_hosts_per_resolve_cycle
max_resolve_backoff_time
multi_out
neighbor_timeout
notify
pipeline
proactive_learn
route_priority
routers
switch_manager
vip_table
class faucet.valve_route.ValveRouteManager(logger, notify, global_vlan, neighbor_timeout, max_hosts_per_resolve_cycle, max_host_fib_retry_count, max_resolve_backoff_time, proactive_learn, dec_ttl, multi_out, fib_table, vip_table, pipeline, routers, stack_manager)[source]

Bases: faucet.valve_manager_base.ValveManagerBase

Base class to implement RIB/FIB.

CONTROL_ETH_TYPES = ()
ETH_TYPE = None
ICMP_SIZE = None
ICMP_TYPE = None
IPV = 0
IP_PKT = None
MAX_PACKET_IN_SIZE = 194
active
add_host_fib_route_from_pkt(now, pkt_meta)[source]

Add a host FIB route given packet from host.

Parameters
  • now (float) – seconds since epoch.

  • pkt_meta (PacketMeta) – received packet.

Returns

OpenFlow messages.

Return type

list

add_route(vlan, ip_gw, ip_dst)[source]

Add a route to the RIB.

Parameters
  • vlan (vlan) – VLAN containing this RIB.

  • ip_gw (ipaddress.ip_address) – IP address of nexthop.

  • ip_dst (ipaddress.ip_network) – destination IP network.

Returns

OpenFlow messages.

Return type

list

add_vlan(vlan, cold_start)[source]

Add a VLAN.

advertise(vlan)[source]
control_plane_handler(now, pkt_meta)[source]
dec_ttl
del_route(vlan, ip_dst)[source]

Delete a route from the RIB.

Only one route with this exact destination is supported.

Parameters
  • vlan (vlan) – VLAN containing this RIB.

  • ip_dst (ipaddress.ip_network) – destination IP network.

Returns

OpenFlow messages.

Return type

list

del_vlan(vlan)[source]

Delete a VLAN.

expire_port_nexthops(port)[source]

Expire all hosts on a port

fib_table
global_routing
global_vlan
logger
max_host_fib_retry_count
max_hosts_per_resolve_cycle
max_resolve_backoff_time
multi_out
neighbor_timeout
nexthop_dead(nexthop_cache_entry)[source]

Returns true if the nexthop_cache_entry is considered dead

notify
notify_learn(pkt_meta)[source]
pipeline
proactive_learn
resolve_expire_hosts(vlan, now, resolve_all=True)[source]

Re/resolve hosts.

Parameters
  • vlan (vlan) – VLAN containing this RIB/FIB.

  • now (float) – seconds since epoch.

  • resolve_all (bool) – attempt to resolve all unresolved gateways.

Returns

OpenFlow messages.

Return type

list

resolve_gateways(vlan, now, resolve_all=True)[source]

Re/resolve gateways.

Parameters
  • vlan (vlan) – VLAN containing this RIB/FIB.

  • now (float) – seconds since epoch.

  • resolve_all (bool) – attempt to resolve all unresolved gateways.

Returns

OpenFlow messages.

Return type

list

route_priority
router_vlan_for_ip_gw(vlan, ip_gw)[source]

Return router VLAN for IP gateway (or None).

Parameters
  • vlan (vlan) – VLAN containing this RIB.

  • ip_gw (ipaddress.ip_address) – IP address of nexthop.

Returns

VLAN for this gateway or None.

routers
switch_manager
vip_table