From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,23c6847871d5deb4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-28 03:13:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada Subject: Re: Example of OSI package/data structure? Date: Wed, 28 Nov 2001 05:15:41 -0600 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: <3C04A024.DEAFCE6@meppen.sema.slb.com> Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1006946024 22305 137.194.161.2 (28 Nov 2001 11:13:44 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 28 Nov 2001 11:13:44 +0000 (UTC) To: Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.6 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:17094 Date: 2001-11-28T05:15:41-06:00 I know of no implementation (Ada or otherwise) that strictly follows the OSI model. However, there is an implementation of IP version 4 worth looking at here: https://www.iks-jena.de/mitarb/lutz/ada/net/ In general, though I would not think it wise to derive one layer from the other (going in either direction) because the layers are distinct in their function and purpose. The only thing that they should have in common is that each layer should have a clean interface with each of its neighbors in the stack. Just off the top of my head, I would start with an organization plan something like this: Net; Net.Physical; Net.Link; Net.Network; Net.Transport; Net.Session; Net.Presentation; Net.Application; Each of the above would define abstract interfaces from which specific implementations would be derived. For example, you might have: Net.Physical.Serial; Net.Physical.Ethernet; Net.Physical.MIL_STD_188_220; Net.Link.Arp; Net.Link.Rarp; Net.Network.IP; Net.Network.ICMP; Net.Network.IGMP; Net.Transport.TCP; Net.Transport.UDP; etc., etc. Also, in practice the session, presentation and application layers are often collapsed into one. You will note that I have named no package OSI. It just seems to me that Net is a better name for the root package, since this is what it's all about. As a general implementation scheme I have a task that does a blocking read on the physical device, and delivers received packets to a handler that has been registered with that task. Such registrations could be for all packets, or only for packets of a certain kind. In this way, the same handler can receive packets from its choice of lower-level packet sources. In the send direction, each layer simply calls a Send procedure for the next lower layer of its choice. Since the programs I write usually have multiple threads of execution wishing to send to the network, I protect the lowest layer with a semaphore implemented in Ada95; I hope these ramblings provide you with some food for thought. ----- Original Message ----- From: "Vincent Smeets" Newsgroups: comp.lang.ada To: Sent: Wednesday, November 28, 2001 2:28 AM Subject: Example of OSI package/data structure? > Hallo, > > Can someone point me to an example of an implementation for the ISO/OSI > protocol stack? > > I have a description of a protocol that has to be coded in Ada95. I it > now coded (hacked) in a bad form in Ada83 and I want to redesign it for > Ada95. > > First I need a package structure. I want to decopple every layer as much > as possible and was thinking of a tagged type for the device and extend > it in every next layer. I have three ideas from which I think the first > is the best (your opinion please?): > > OSI > OSI.Physical > OSI.Physical.Data_Link > OSI.Physical.Data_Link.Network > OSI.Physical.Data_Link.Network.Transport > OSI.Physical.Data_Link.Network.Transport.Session > OSI.Physical.Data_Link.Network.Transport.Session.Presentation > OSI.Physical.Data_Link.Network.Transport.Session.Presentation.Application > > OSI > OSI.Application > OSI.Application.Presentation > OSI.Application.Presentation.Session > OSI.Application.Presentation.Session.Transport > OSI.Application.Presentation.Session.Transport.Network > OSI.Application.Presentation.Session.Transport.Network.Data_Link > OSI.Application.Presentation.Session.Transport.Network.Data_Link.Physical > > OSI > OSI.Physical > OSI.Data_Link > OSI.Network > OSI.Transport > OSI.Session > OSI.Presentation > OSI.Application > > Next; what type definition can I use for my device. As I only have two > physical devices, I would like to define only two variables in the > package Physical that has to be used for the operations and not allow > the user to define extra variables. Something like: > type Device (<>) is tagged limited private; > Device_1 : Device; > Device_2 : Device; > The problem is that this doesn't work and if the type is extended, the > variables has to be redefined to contain the extension. > > I hope you have enough information. Can you give me some help or point > me to an example? > > Thanks, > Vincent > > -- > Vincent Smeets > SchlumbergerSema - > Competence Center Informatik GmbH > Lohberg 10 - 49716 Meppen - Germany > tel: +49 5931-805-461 > fax: +49 5931-805-175 > mail: VSmeets@slb.com > web: www.cci.de > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada >