Hi All,
 I need to measure link delay in Ryu controller. I want to send a packet-out 
message for all switches. Then,  the time between the sent packet-out message 
in the source node and received the packet-in message in the destination node 
is calculated. I am a beginner in Ryu and don't know how to send a packet with 
specific EtherType such as 0x8fc to all switches. I have obtained the MAC of 
all switches and build a packet.
How I can send a packet with specific EtherType to all switches?
I don't have datapath (db) of all switches. how to set the datapath parameter 
for every switch?How to insert time.time to the packet?
The adjacency is a matrix of the neighbor of nodes.
The macadrr is a matrix of the MAC address of nodes.
def send_packet(self, dp, port, pkt):
        ofproto = dp.ofproto
        parser = dp.ofproto_parser
        pkt.serialize()
        data = pkt.data
        action = [parser.OFPActionOutput(port=port)]

        out = parser.OFPPacketOut(
            datapath=dp, buffer_id=ofproto.OFP_NO_BUFFER,
            in_port=ofproto.OFPP_CONTROLLER,
            actions=action, data=data)
        dp.send_msg(out)

def create_packet(self):
        i=l=0
        for l in range(1,len(self.adjacency)+1):
            #print("\n")
            for i in self.adjacency[l]:
                ethertype = 0x8fc
                dst = self.macaddr(i)
                src = self.macaddr(l) 
                e = ethernet.ethernet(dst, src, ethertype)                
                p = packet.Packet()
                p.add_protocol(e)
                p.add_protocol(time.time()) ????  It causes an error.
                p.serialize()
                port=self.adjacency[l][i]
                send_packet(self, dp **??????** , port, p)


_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to