Software Defined Networking
1748080 Members
5370 Online
108758 Solutions
New Discussion

replying ARP message

 
low2215
Visitor

replying ARP message

Hi

 

I have intercept a ARP request  packet from a director packet handler.

 

I wish to create an ARP reply  message.

 

I have created a packetout message and fill in the ARP reply packet data.

 

I can see the OFP+ARP packet out message in wireshark with ARP reply message embedded .

 

But there is no ARP reply packet .

 

I have done the following :

   OfmMutablePacketOut packetout =  (OfmMutablePacketOut)MessageFactory.create(version, MessageType.PACKET_OUT);

    ActOutput act = (ActOutput)ActionFactory.createAction(version,
                                ActionType.OUTPUT,context.getPacketIn().getInPort(),ActOutput.CONTROLLER_NO_BUFFER);
    packetout.inPort(context.getPacketIn().getInPort());           
    packetout.addAction(act);
    packetout.bufferId(BufferId.NO_BUFFER);
    packetout.data(<arp reply data byte>);

    controllerService.send(packetout.toImmutable(), context.srcEvent().dpid()); // where context is the MessageContext

 

 

Anyone has any tips how i should solve this ?

 

Thanks

   

 

 

3 REPLIES 3
low2215
Visitor

Re: replying ARP message

I have change the ActOutput Port to Port.IN_PORT, this seems to solve the problem .

 

ActOutput act = (ActOutput)ActionFactory.createAction(version,
                                ActionType.OUTPUT,Port.IN_PORT,ActOutput.CONTROLLER_NO_BUFFER);
                        packetout.inPort(context.getPacketIn().getInPort());

sdnindia
Trusted Contributor

Re: replying ARP message

Hi,

Please let us know if your problem is solved.

Please feel free to reply incase you have more questions around the same topic or open a new thread if new topic.

 

If you feel your question has been answered, please do let us know by marking this response as an  accepted solution.

Thanks
HP SDN Team

ShaunWackerly
HPE Pro

Re: replying ARP message

Just so you're clear on why this difference made things work:

 

- context.getPacketIn().getInPort() will be the ingress port for THIS packet

 

- Port.IN_PORT will be the ingress port for whatever packet MATCHED the rule which uses the ActOutput object

Chances are that the first ARP reply worked (because THIS packet is the MATCHED packet), and subsequent ARP replies didn't work because they came in on different ingress ports and matched the same rule.

I am an HPE Employee