Book a Demo

Author Topic: How to model protocol packet structure?  (Read 13419 times)

AndreasB

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
How to model protocol packet structure?
« on: September 07, 2011, 09:55:38 pm »
Hello!

I'm quite new with UML and EA.
For a project I have to model a communication protocol or at least the structure of the protocol packets.

Inside a packet there are data fields like source address, destination address, packet control etc.
I use class diagram to model this in UML. The packet data fields are attributes of the class.

Now my problem:
While the packet header always has the same structure and length, the structure and length of the following data payload varies with a given data field of the header, the packet control byte. How would you model this?

By the way, can you suggest good UML 2.x books (german or english)?
I feel like I need some real life UML model examples to learn more than just the basics, notations and diagrams...

fwoolz

  • EA User
  • **
  • Posts: 435
  • Karma: +0/-0
  • We have met the enemy, and he is us.<Pogo, 1970>
    • View Profile
Re: How to model protocol packet structure?
« Reply #1 on: September 13, 2011, 05:56:20 pm »
You could model it as a simple C struct using bitfields as required. Variable-length fields would be pointers (e.g. char*).
Fred Woolsey
Interfleet Technology Inc.

Always be ready to laugh at yourself; that way, you beat everyone else to the punch.