I have a UNIX client/server program I need to write for school and I am pretty clueless when it comes to forming and sending/receiving packets.

Our teacher gave us a hint, but not much real direction. He suggested we use the following structure, which kind of clears up how to form the packets, but I am still confused how they are transmitted from the client and how they are received by the server.

He also gave us a simple echo server/client, but unfortunately it really does not help because it is just sending text back and forth instead of packets. If anyone has an example that sends and receives packets or knows a site with one I would greatly appreciate any help I can get. Thanks, purple
Code:
typedef struct packet
{
    unsigned int opcode:3;
    unsigned int reply:5;
    unsigned int number_1:10;
    unsigned int number_2:10;
    unsigned int number_3:10;
    unsigned int number_4:10;
}  __attribute__ ((packed)) packet;