Hi,

I need some clarification on the data field for ofp_packet_in. The OF 1.1 spec 
contains the following comment:

/* Ethernet frame, halfway through 32-bit word, so the IP header is 32-bit 
aligned. The amount of data is inferred from the length field in the header. 
Because of padding, offsetof(struct ofp_packet_in, data) == sizeof(struct 
ofp_packet_in) - 2. */

Does this supposed to mean that the data field should start with two bytes of 
padding (i.e. junk data), and the datapath packet should only follow after that 
(so that the ethernet header now ends after 16 bytes, so the IP header will 
start at a 32bit boundary)? In other words, the packet format should really be:

...
uint8_t reason; /* Reason packet is being sent (one of OFPR_*) */
uint8_t table_id; /* ID of the table that was looked up */
uint8_t pad[2];
uint8_t data[0];
}

But in essence we are afraid the "implementor" would be dumb enough not to use 
e.g. the packed attribute, and so the compiler would mess things up, we instead 
moved the padding into the comments section?

Also I suppose the equation in the comment should read something like:
data_len = ofp_header.length - sizeof(struct ofp_packet_in) - 2.

What's the case with packet_out; should the data field also contain some 
implicit padding there for IP header alignment?

Thanks,
Zoltan.

_______________________________________________
openflow-discuss mailing list
openflow-discuss@lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss

Reply via email to