standard concepts to describe network behavior?
- From: linuxadmin@xxxxxxxxx
- Date: Mon, 30 Jul 2007 17:45:30 -0700
hi everyone!
i try to define (something like) a concept to describe the behavior
(or a protocol) of a p2p network. i tried the following (using pseudo-
code):
================================================
legend:
C->S:[name] client to server message [name]
C<-S:[name] server to client message [name]
every peer is server AND client at the same time, depending on the
current aspect.
================================================
scenario: connection:
C->S:ConnectionRequest();
if(C<-S:ConnectionReject(Reason:enum{...})){
end;
}else if(C<-S:ConnectionAccept(RandomNumber:byte[])){
C-
S:AuthentificationRequest(CryptoHashForRandomNumber:byte[]);if(C<-S:AuthentificationReject()){
end;
}else if(C<-S:AuthentificationAccept(RandomNumbers:byte[][])){
C:enterClientLoop;
S:enterServerLoop;
}
}
C:loop{
C->S:OperationRequest(Operation:SomeType);
if(C<-S:OperationReject(Reason:enum{...})){
C:beVerySad(...);
}else if(C<-S:OperationAccept()){
C->S:SendData(Data:byte[]);
}
}
S:loop{
....
}
================================================
i'm sure, it's going to be complicated to implement this, because it's
surely not the 'usual' technique to define a protocol.
so, allow me few questions concerning this:
1) are there some 'usual' or standardized ways to define a network
protocol?
2) if not, what do you think about my 'concept'?
3) i'm going to use c#. it is better to use just a state-machine
inside a loop, or it is better to define events? what is your
opinion / experience?
thanks in advice!
.
- Prev by Date: Re: Choosing a PL - What you can do or how you do it?
- Next by Date: Re: Choosing a PL - What you can do or how you do it?
- Previous by thread: Xlib and image from file (e.g. .bmp, .jpeg etc.)
- Next by thread: programming seriell port unter windows ?
- Index(es):
Relevant Pages
|