Redes definidas por Software com Mininet e POX - Criando meu primeiro Controlador
A proposta deste estudo é servir como guia básico para iniciantes com redes SDN. O propósito não é esgotar o assunto, e sim traçar um passo a passo na arte de redes de computadores e de sensores utilizando controladores. Para desenvolvimento deste estudo foi considerado que o leitor tem conhecimento básico em protocolos de rede e sistemas operacionais.
[ Hits: 2.509 ]
Por: cristofe coelho lopes da rocha em 01/01/2024
#importando as bibliotecas import pox.openflow.libopenflow_01 as of from pox.core import core from pox.lib.revent import * #chamando o modulo para log log = core.getLogger() class mycontroller(EventMixin): switches = {} def __init__(self): self.listenTo(core.openflow) def _handle_ConnectionUp(self, event): log.debug("Connection UP from %s", event.dpid) mycontroller.switches[event.dpid] = event.connection def _handle_PacketIn(self, event): # Implemente a lógica para lidar com pacotes aqui pass def launch(): core.openflow.miss_send_len = 1024 core.registerNew(mycontroller)
import pox.openflow.libopenflow_01 as of from pox.core import core from pox.lib.revent import * from pox.lib.addresses import EthAddr, IPAddr from pox.lib.util import dpidToStr log = core.getLogger() class mycontroller(EventMixin): switches = {} def __init__(self): self.listenTo(core.openflow) def _handle_ConnectionUp(self, event): log.debug("Connection UP from %s", event.dpid) mycontroller.switches[event.dpid] = event.connection def _handle_PacketIn(self, event): packet = event.parsed #Drop packetpass msg = of.ofp_flow_mod() msg.match.in_port = event.port msg.match.dl_src = packet.src msg.match.dl_dst = packet.dst event.connection.send(msg) log.debug(" Drop packet sw=%s in_port=%s src=%s dst=%s" % (event.dpid, event.port, packet.src, packet.dst)) def launch(): core.openflow.miss_send_len = 1024 core.registerNew(mycontroller)
Melhorando o nível de segurança com chflags
Robótica com Android e Arduino
Como baixar fotos e vídeos do Instagram com Python
Arduino com Bluetooth e pySerial
Aprenda a Gerenciar Permissões de Arquivos no Linux
Como transformar um áudio em vídeo com efeito de forma de onda (wave form)
Como aprovar Pull Requests em seu repositório Github via linha de comando
Dando - teoricamente - um gás no Gnome-Shell do Arch Linux
Como instalar o Google Cloud CLI no Ubuntu/Debian
Mantenha seu Sistema Leve e Rápido com a Limpeza do APT!
Procurando vídeos de YouTube pelo terminal e assistindo via mpv (2025)