I would like to transmit a stream of bits formatted to my liking, between two PCs, i already have a serial conection betwen them which will allow me to transmit data; an array with a string ("hello world") for example.

My problem is i don't have any idea as to how to go about defining the format, so that both PCs can parse it and pick out relevant information.

I think need to know how to create and send a binary frame, example:

start_bit + character + stop_bit; where the character will inclued the parity bit

I also need to know how to implement data identification, as i am sendng different types of information:

example; at one point i may need to send, say, user_information;
which may include user_name, user_password etc.

and at another time i may want to send somthing else, like, say,
system_info; which may include system_status, number_of_users, ect.

basically, the recieving PC must be able to tell:

1) what data is being sent: user or system info

2) if its user info, where does user_name stop, and user_password begin, and where does the whole user_info stop.

Does anyone know how i can implement this?

I am using MS visual studio .NET 2003 and programmng in C++. Along wit the qt VS .NET 2003 integration.

If you can give some suggstions or direct me to some resource that covers this kind of thing, i would be most greatful.

Thanks very much for your attention

You are invited to be as generous as possible with your sugestions.
All suggestions welcomed.