<s>
Construct	O
is	O
a	O
Python	O
library	O
for	O
the	O
construction	O
and	O
deconstruction	O
of	O
data	B-General_Concept
structures	I-General_Concept
in	O
a	O
declarative	B-Language
fashion	O
.	O
</s>
<s>
In	O
this	O
context	O
,	O
construction	O
,	O
or	O
building	O
,	O
refers	O
to	O
the	O
process	O
of	O
converting	O
(	O
serializing	B-Application
)	O
a	O
programmatic	O
object	O
into	O
a	O
binary	O
representation	O
.	O
</s>
<s>
Being	O
declarative	B-Language
means	O
that	O
user	O
code	O
defines	O
the	O
data	B-General_Concept
structure	I-General_Concept
,	O
instead	O
of	O
the	O
convention	O
of	O
writing	O
procedural	B-Application
code	I-Application
to	O
accomplish	O
the	O
goal	O
.	O
</s>
<s>
Construct	O
can	O
work	O
seamlessly	O
with	O
bit	O
-	O
and	O
byte-level	O
data	O
granularity	O
and	O
various	O
byte-ordering	O
.	O
</s>
<s>
Using	O
declarative	B-Language
code	O
has	O
many	O
benefits	O
.	O
</s>
<s>
If	O
one	O
is	O
familiar	O
with	O
the	O
C	B-Language
(	O
programming	O
language	O
)	O
,	O
one	O
can	O
think	O
of	O
constructs	O
as	O
casting	O
from	O
char	O
*	O
to	O
struct	O
foo	O
*	O
and	O
vice	O
versa	O
,	O
rather	O
than	O
writing	O
code	O
that	O
unpacks	O
the	O
data	O
.	O
</s>
<s>
The	O
following	O
example	O
show	O
how	O
a	O
TCP/IP	B-Protocol
protocol	I-Protocol
stack	I-Protocol
might	O
be	O
defined	O
using	O
Construct	O
.	O
</s>
<s>
And	O
finally	O
,	O
the	O
TCP	B-Protocol
header	I-Protocol
(	O
layer	O
4	O
)	O
:	O
</s>
<s>
Now	O
define	O
the	O
hierarchy	O
of	O
the	O
protocol	B-Protocol
stack	I-Protocol
.	O
</s>
<s>
At	O
this	O
point	O
,	O
the	O
code	O
can	O
parse	O
captured	O
TCP/IP	B-Protocol
frames	O
into	O
"	O
packet	O
"	O
objects	O
and	O
build	O
these	O
packet	O
objects	O
back	O
into	O
binary	O
representation	O
.	O
</s>
<s>
is	O
a	O
CPAN	B-Language
module	O
that	O
originated	O
as	O
a	O
port	O
of	O
Construct	O
to	O
the	O
Perl	B-Language
programming	I-Language
language	I-Language
.	O
</s>
