1

I've been struggling with the RYU SDN controller working on OpenFlow13 for quite a while now. And I don't understand what we need a buffer_id for.

I am trying to write a proxy application, so when I receive 192.168.2.2 as a ipv4.dst I modify it to 172.10.2.2.

I do this using the command

actions = [parser.OFPActionSetField(eth_dst=pkt_ethernet.dst),parser.OFPActionSetField(ipv4_dst=pkt_ipv4.dst),parser.OFPActionOutput(2)]
out = parser.OFPPacketOut(datapath=datapath, buffer_id=msg.buffer_id,
 in_port=in_port, actions=actions, data=data)
 datapath.send_msg(out)

pkt_ipv4.dst has the new IP.

I get a bad request, OFPBRC_BUFFER_EMPTY(7)

I am trying to send the packet out without adding flows to the controller for now. But I plan to add flows later.

asked Apr 28, 2018 at 20:55

1 Answer 1

3

"In most cases, switches and routers are configured for "best-effort" packet forwarding."

https://fasterdata.es.net/network-tuning/router-switch-buffer-size-issues/

If the switch can't forward on the packet immediately then it needs to be queued and stored in a buffer to prevent it being dropped.

The buffer_id is simply to uniquely identify and track the packet if it is in a buffer. If it isn't in a buffer then buffer ID is not specified, and is set to OFP_NO_BUFFER

You are trying to send an OFPacketOut that contains a buffer_id referencing an empty buffer. You need to only specify the buffer once for any incoming OFPacketIn, and otherwise set the buffer_id to OFPacketOut.BUFFER_ID_NONE.

answered Jan 23, 2019 at 21:07
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.