Switch Prio | Match | Action --- | --- | --- 0 | * | out controller 1 | eth_dst=MAC3 | out 3 2 | eth_type=IPv4 ip_dst=IP 3 | out
Packets
Hyp: tabelle ARP giá piene
Topologia h2,h1 - s1 - s2 - h3,h4
Event OFP Switch Features
match su *
actions = [output su controller]
priority = 0
FLOW MOD(datapath, priority, match, ...)
Datapath é sinonimo di switch, anche se uno switch puó contenere piú datapath e agire come piú switch in uno solo. Questo é un table miss perché fa match su ogni cosa e ha prioritá 0
match su eth_dst="FF:FF:....:FF"
actions = [output su flood]
FLOW MOD(datapath, priority=1, ...)
Event OFP Packet In
Questa funzione serve a recuperare i metadati come la porta in ingresso.
Se il match non venisse trovato, alla variabile viene assegnato none
in_port = msg.match ['in_port']
pkt = packet.Packet(data = msg data)
if len(pkt.protocols)>=2 and is instance (pkt.protocols[1], IPv4):
if datapath.id == 1 and pkt_ipv4.dst == '10.0.0.3':
match = OFPMatch(eth_src = eth.src, eth_dst=eth.dst,
eth_type = IPv4, ip_dst = '10.0.0.3')
actions = [ OFPAction.SetField(ip_dst='10.0.0.2'),
OFPAction Output(2) ]
FLOWMOD(match, priority=1, ...)
else packet_out(FLOOD)
La porta in ingresso serve per effettuare il flooding di un pacchetto proveniente dal controllore, senza rimandarlo nella porta di ingresso.
Tabella s1 0 | * | controller --- | --- | --- 1 | eth_dst=FF:FF...:FF | output FLOOD Tabella s2 0 | * | controller --- | --- | --- 1 | eth_dst=FF:FF...:FF | output FLOOD
ARP prepopolata