Thank you Ben for your answer, but I figured out what was wrong, I just had
add_protocol(icmp) to construct my packet.

Takashi,
the reason why I put : pkt.payload = f was to make my timestamp as payload
of my echo packet so I can extract it at arrival ( and then calculate the
total time) but I don't need it anymore because I'm doing it in a different
way now.

Thanks again

On Wed, Sep 24, 2014 at 3:50 AM, YAMAMOTO Takashi <[email protected]>
wrote:

> > Dear Ryu Experts,
> >
> > I'm trying to inject an "echo" mpls packet using ryu, so I created an
> MPLS
> > packet using this code :
> >
> >         f = EchoRyu()
> >         f.timestamp = int(time.time()*1000 - start_time)
> >         eth_MPLS = ether.ETH_TYPE_MPLS
> >         parser = datapath.ofproto_parser
> >         ofproto = datapath.ofproto
> >         actions = [parser.OFPActionPushMpls(eth_MPLS)]
> >         src = "00:00:00:00:00:01"
> >         dst = "00:01:00:00:00:01"
> >         in_port = ofproto.OFPP_CONTROLLER
> >         pkt = packet.Packet()
> >         pkt.add_protocol(ethernet.ethernet(ethertype=ether.ETH_TYPE_MPLS,
> > dst=dst, src=src))
> >         pkt.add_protocol(mpls.mpls(label=50, exp=0, bsb=1, ttl=255))
> >         pkt.payload = f
>
> what's EchoRyu()?
> whatever it is, i don't suppose "pkt.payload = f" works, though.
>
> YAMAMOTO Takashi
>
> >         pkt.serialize()
> >         out = parser.OFPPacketOut(datapath=datapath,
> buffer_id=0xffffffff,
> > in_port=in_port, actions=actions, data=pkt.data)
> >         datapath.send_msg(out)
> >
> > but my packet seems to be malformed accordind to wireshark trace:
> >
> > No.     Time           Source                Destination
>  Protocol
> > Length Info
> >      64 7.006662000    192.168.1.200         192.168.1.200
>  OpenFlow
> > 118    51241
> >
> > Frame 64: 118 bytes on wire (944 bits), 118 bytes captured (944 bits) on
> > interface 0
> > Linux cooked capture
> > Internet Protocol Version 4, Src: 192.168.1.200 (192.168.1.200), Dst:
> > 192.168.1.200 (192.168.1.200)
> > Transmission Control Protocol, Src Port: 6633 (6633), Dst Port: 51241
> > (51241), Seq: 99, Ack: 705, Len: 50
> > OpenFlow 1.3
> >     Version: 1.3 (0x04)
> >     Type: OFPT_PACKET_OUT (13)
> >     Length: 50
> >     Transaction ID: 2770032434
> >     Buffer ID: OFP_NO_BUFFER (0xffffffff)
> >     In port: OFPP_CONTROLLER (0xfffffffd)
> >     Actions length: 8
> >     Pad: 000000000000
> >     Action
> >         Type: OFPAT_PUSH_MPLS (19)
> >         Length: 8
> >         Ethertype: MPLS label switched packet (0x8847)
> >         Pad: 0000
> >     Data
> >         Ethernet II, Src: 00:00:00_00:00:01 (00:00:00:00:00:01), Dst:
> > EquipTra_00:00:01 (00:01:00:00:00:01)
> >             Destination: EquipTra_00:00:01 (00:01:00:00:00:01)
> >             Source: 00:00:00_00:00:01 (00:00:00:00:00:01)
> >             Type: MPLS label switched packet (0x8847)
> >         MultiProtocol Label Switching Header, Label: 50, Exp: 0, S: 1,
> TTL:
> > 255
> >         [Malformed Packet: MPLS]
> >             [Expert Info (Error/Malformed): Malformed Packet (Exception
> > occurred)]
> >                 [Malformed Packet (Exception occurred)]
> >                 [Severity level: Error]
> >                 [Group: Malformed]
> >
> > Can someone please firgure out if I'm missing something here ?
> >
> > Thanks,
> >
> > Mounir
>
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to