Ryu flow installation

At the top of the code, you will notice we have a few more imports that we need further down the file:

from ryu.base import app_managerfrom ryu.controller import ofp_eventfrom ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHERfrom ryu.controller.handler import set_ev_clsfrom ryu.ofproto import ofproto_v1_3from ryu.lib.packet import packetfrom ryu.lib.packet import ethernetfrom ryu.lib.packet import ether_types#new importfrom ryu.ofproto import etherfrom ryu.lib.packet import ipv4, arp

During the class initialization, we will determine what MAC addresses we will use for s1 and s2:

class MySimpleStaticRouter(app_manager.RyuApp):    OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]    def __init__(self, *args, **kwargs): ...

Get Mastering Python Networking now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.