How to design communication protocols in OO way?

How to design communication protocols in OO way?

Post by Roal Zanazz » Sat, 26 Jul 2003 04:48:20



Hi all,

I want to design a flexible communication protocol framework in a fine
OO way;
I've thought about that and I've identified some sub-systems (layers),
mainly the low-level communication sub-system (sockets, serial port,
...) and the protocol sub-system (TCP, HTTP, my own, ...), eventually with.
The problem is that I really don't know how to go to a finer detail
(single classes involved, their relationships and collaborations) and
put all together; and I don't know design patterns well enough to
recognize them or to use them in the right places.

My question is: is there some whitepaper, documentation, UML diagram, or
simple source code of a well-OO-designed communication protocol framework?
I don't want something ready to use, I want to think with my own brain,
I just need something to clear up my confusion.
Anything that could kick me on the right way (on the long way of OOD) is
greatly appreciated.

Thanks in advance.
--
Roal Zanazzi

 
 
 

How to design communication protocols in OO way?

Post by Phli » Sat, 26 Jul 2003 11:37:54



> My question is: is there some whitepaper, documentation, UML diagram, or
> simple source code of a well-OO-designed communication protocol framework?



>Curious... I've always thought that OOP doesn't map very well to the real
>world. The major piece of evidence for this is that almsot every text
>book example of an OO system from the 'real world' was rather stupid.
>Things like animals with rather unobvious relationships.

   I got good use of the inheritance feature in one project.
A client had a MIDI-driven musical instrument with a ton of
internal state and I was writing a program to allow people
to update the state interactively via the MIDI Interface.
The MIDI spec reserves a few message types so that
manufacturers can work their unique magic.  The so-called
'System Exclusive' messages are examples; a few forms of
system exclusive are standardized so you can identify a
devices manufacturer, etc.

   The OOP program was a Turbo Pascal 6 app that ran on a
PC and handled the UI of the reconfiguration task.  It
generated Sys.Exc. messages of the right format for the
embedded computer in the product.  The classes described
below implemented device drivers generating messages to
control a device sitting on the other side of a MIDI
interface.

My inheritance hierarchy went:

- a device on a standard MIDI interface, including the
  transport layer and handling of standard Sys.Exc. forms

  - The client's MIDI device, including the client's chosen
    Sys.Exc. format and some particular formats, e.g. to
    identify the product.

    - One of the client's products, including formats to
      report on and to change configuration settings.
      Commonly, a method was defined to return a list of the
      features that could be edited.

      - for each of the products, a model of that product,
        using the interfaces defined above, but imposing
        particular limits, such as table sizes, specific
        locations for config data, etc.

   Along with a factory function to make an instance
appropriate to the model of the product that was connected,
it all worked quite elegantly.  The rest of the application
code was amazingly general..  GUI, text-edit boxes, and so
on; nothing to do with MIDI at all.

        Regards.        Mel.

 
 
 

How to design communication protocols in OO way?

Post by S Perryma » Sat, 26 Jul 2003 18:58:46



Quote:> I want to design a flexible communication protocol framework in a fine
> OO way;
> I've thought about that and I've identified some sub-systems (layers),
> mainly the low-level communication sub-system (sockets, serial port,
> ...) and the protocol sub-system (TCP, HTTP, my own, ...), eventually
with.
> The problem is that I really don't know how to go to a finer detail
> (single classes involved, their relationships and collaborations) and
> put all together; and I don't know design patterns well enough to
> recognize them or to use them in the right places.

The only "flexible" things that you will get is :

- open/close connection
- send/receive data
- re-establish connection (possibly)

Beyond that, comms protocols tend to be so specific that there is no
advantage in attempting to factor common behaviour.

I suggest your first visit is the OSI standards.
A prevailing common concept is the Service Access Point (SAP) , through
which communication is achieved (transferring data etc) . The Transport
layer (layer 4) is probably quite relevant to you.

Quote:> My question is: is there some whitepaper, documentation, UML diagram, or
> simple source code of a well-OO-designed communication protocol framework?
> I don't want something ready to use, I want to think with my own brain,
> I just need something to clear up my confusion.
> Anything that could kick me on the right way (on the long way of OOD) is
> greatly appreciated.

If you search on the net, you should find suitable info on OO-based impls of
various comms protocols.

Regards,
Steven Perryman

 
 
 

How to design communication protocols in OO way?

Post by Daniel T » Sat, 26 Jul 2003 22:22:54



> I want to design a flexible communication protocol framework in a fine
> OO way;
> I've thought about that and I've identified some sub-systems (layers),
> mainly the low-level communication sub-system (sockets, serial port,
> ...) and the protocol sub-system (TCP, HTTP, my own, ...), eventually with.
> The problem is that I really don't know how to go to a finer detail
> (single classes involved, their relationships and collaborations) and
> put all together; and I don't know design patterns well enough to
> recognize them or to use them in the right places.

> My question is: is there some whitepaper, documentation, UML diagram, or
> simple source code of a well-OO-designed communication protocol framework?
> I don't want something ready to use, I want to think with my own brain,
> I just need something to clear up my confusion.
> Anything that could kick me on the right way (on the long way of OOD) is
> greatly appreciated.

Two protocol frameworks that immediately come to mind are are ACE and
OpenTransport.
 
 
 

How to design communication protocols in OO way?

Post by Alan Ch » Sun, 27 Jul 2003 01:19:11



> My question is: is there some whitepaper, documentation, UML diagram, or
> simple source code of a well-OO-designed communication protocol framework?

I'm not sure about simple, but you might take a look at the design of
the ACE Networking toolkit at
http://www.cs.wustl.edu/~schmidt/ACE.html. Its well established and
has several books documenting the design of the library.

Cheers,
-alan

 
 
 

How to design communication protocols in OO way?

Post by H. S. Lahma » Sun, 27 Jul 2003 07:49:47


Responding to Zanazzi...

Quote:> I want to design a flexible communication protocol framework in a fine
> OO way;
> I've thought about that and I've identified some sub-systems (layers),
> mainly the low-level communication sub-system (sockets, serial port,
> ...) and the protocol sub-system (TCP, HTTP, my own, ...), eventually with.
> The problem is that I really don't know how to go to a finer detail
> (single classes involved, their relationships and collaborations) and
> put all together; and I don't know design patterns well enough to
> recognize them or to use them in the right places.

Others have suggested specifics like ACE.  I would only add that I think
the key is to think about invariants that can be extracted for each
subject matter.  That is, the subject matter of each subsystem can
probably be extracted with classes that are largely unique to that
subject matter.  For your low-level system things like Socket and Port
are probably pretty easy to identify, as you already indicate.

The protocol subsystem, however, offers significant challenges but
should be do-able.  The last time I looked at a display of networking
protocols it was on a wall chart about 12' long and 4' high where each
protocol occupied about six square inches.  The trick is going to be
abstracting that to eliminate a gazillion classes and a mind-boggling
is-a relation.

Since all protocols serve pretty much the same objectives, the challenge
is to figure out how to describe their differences in terms of data.
That is, one needs a generic view of Protocol behavior that can be
modified parametrically by data that defines a specific protocol.  Then
one can describe the individual protocols in specification objects and
dynamically instantiate relationships between an instance of the
specification and instances of the generic behavi*Protocol.

While some degree of subclassing will probably be necessary, I would
strive to minimize it.  That's not because I dislike is-a relationships;
rather it is because I think that mindset will facilitate recognizing
invariants.  I think the approach one needs for protocols is parametric
polymorphism rather than inclusion polymorphism.

*************
There is nothing wrong with me that could
not be cured by a capful of Drano.

H. S. Lahman

Pathfinder Solutions  -- We Make UML Work
http://www.veryComputer.com/
(888)-OOA-PATH

 
 
 

1. OO Approach to Comms. Protocol Analysis and Design

Hello Netlanders,

I am a newcomer to OO and have been tasked to undertake a comms. protocol
implementation using OO techniques.

I will very much appreciate if any kind soul can provide me with any
references to papers or published reports (ftp access) on the above. Most
books only discuss tangible object imeplementations (e.g. windows, ATM,
etc)

Are there any good references for the application of OO to real-time
systems ?

Thank you for your time.

regards,
Sree
--------------------------------------------------------------------------
Sreedharan Bhaskaran                    | Tel: (65)-772-0409
Multimedia Communications               | Fax: (65)-779-4210
Information Technology Institute        |

71 Science Park Drive                   |
NCB Building                            |
Singapore 0511                          |
Republic Of Singapore                   |
--------------------------------------------------------------------------

2. Printers Disappearing

3. two-ways communication

4. FTP Server Log?

5. Getting a communication both ways in OLE

6. Cable in Canada

7. Design question: Which pattern to use with a Form - or - 101 ways to skin a Form...

8. Help! Ideas for old 386???

9. Designing for Plug-ins

10. info on application design with plug-ins

11. OO Design vs Functional Design - PLEASE HELP!!!

12. OO Modelling vs. OO Design? Literature?