anastop / latte

Latency & packet loss measuring tool for SDN controllers
12 stars 4 forks source link

Enhance packet walking #3

Open anastop opened 8 years ago

anastop commented 8 years ago

The idea is to replace the offset arithmetic used to walk through a packet and extract specific fields, with a more structured and comprehensive approach.

That is, it would be convenient if we could convert (i.e., "deserialize", "unmarshall", "unpack", ...) a byte slice corresponding to a certain OF packet region (e.g. ofp_match) to a well defined struct. Then accessing the desired packet fields would be as simple as accessing the corresponding struct fields.

This approach can potentially enhance code simplicity and readability, but may hurt performance, especially if the inspected packets contain many variable-sized fields that need many "jump-to-offset"-"read-length"-"jump-to-offset"-... operations.