We come across different types of layering requirement for different protocols. Basic ones are as follows.
- One to one mapping -- One higher level protocol frame is mapped to the payload of one lower level protocol frame.
- One to many mapping -- One higher level protocol frame is mapped to the payload of many lower level protocol frames.
- Many to one mapping -- Many higher level protocol frames are mapped to the payload of single lower level protocol frame.
- Many to many mapping -- Many higher level protocol frames are mapped to the payload of many lower level protocol frames.
What ever be the layering scenario , the basic principle to generate a layering transaction is to randomize the higher level sequence and use byte_pack to convert it to a byte stream and package the bytes in the lower level sequence.