๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.oop.powerplant
Article #73

Re: Receiving RawIP with OT

#73
From: Randall R. Schulz
Date: Mon, 19 Jul 1999 00:00
78 lines
4883 bytes
Antoine,

I suggest you rethink your plan to use IP. IP is a host-to-host level
("network layer") protocol, not an application-to-application level
("transport layer") protocol. I don't know much about the internals of Open
Transport, but if it did let you at the IP packets received by the host
running your code, all other Internet services would be usurped by doing so.

On a Unix (-like) system, you would require root / super-user priviledges
to do this, and still it would interfere with normal networking operations.

If it is the case that under Open Transport networking, the IP-level
packets can be *duplicated* for delivery to an application and still get to
their ordinary destination protocol module (IP packets are always
associated with some higher-level protocol, such as TCP or ICMP or one of
very many others), then you might be able to accomplish this (then you'd
have to filter them yourself so as to respond only to those associated with
your application). Likewise, if you can (and do) restrict yourself to a
protocol number not otherwise used and can selectively receive only packets
for that protocol, then again you might be able to get away with this.

However... You probably want to use UDP, which, although a proper transport
layer protocol, is a very "thin" layer (low overhead) over IP and is
compatible with all other networking operations, being multiplexed by a
port number of which there are many. This allows the co-existence of many
applications that also use UDP (RealAudio, for example, uses UDP as well as
TCP--based on some internal algorithms presumably designed to maximize
performance). Aside from the protocol header that provides for multiplexing
based on port number, UDP's properties are virtually the same as IP's
(unreliable, and unsequenced being the key ones).

Using UDP will present you with no priviledge problems, providing you avoid
a certain range of port numbers that are reserved to the IANA for
assignment to new Internet protocols. If you do try that, some transport
layer APIs--Unix's, certainly, Open Transport, I don't know--will prevent
you from the attempt.


To other Internet-savvy programmers reading this--I'm doing this without
reference to any of the specifications, so if there's any significant
errors or oversimplifications, please point them out without chastising me!

Good luck. (And sorry, I parlais no Fran๏ฟฝais.)

Randy Schulz
Mountain View, CA USA


Antoine Bruguier wrote:
> 
>     I'm using CW PowerPlant to build an application which would receive
> every IP packet. But because PowerPlant does not provide the righ
> classes to do this, I resolved to use directly the OpenTransport API. I
> wrote the piece of code just below.
>     But it does not work, or at least, I do not receive anything. At
> each new loop, the flags are equal to zero, which mean, there's nothing
> received. Is there a bug in this code?
>     Maybe I'm ACTUALLY receiving nothing. In instance, if I ping myself,
> am I supposed to receive something or not? And will I receive all IP
> packets, even the one who are not addressed to me but also to other
> hosts?
> 
> Thanks , Antoine
> ==================================
>     J'utilise CW PowerPlant pour ecrire une application qui doit
> recevoir tout les packets IP. Mais comme PowerPlant ne permet pas cela,
> j'ai decide d'ecrire moi meme le code en utilisant directement les APIs
> de OpenTransport. J'ai ecrit le code ci dessous.
>     Mais il ne fonctionne pas, ou du moins, je ne recoit rien. A chaque
> boucle, les flags sont a zero, ce qui veut dire que il n'y a rien de
> recu. Y-a-t-il un bug?
>     Peut etre que je ne recoit VRAIMENT rien. Par exemple, si je me ping
> moi meme, est que je suis suppose recevoir quelquechose? Et est ce que
> je peux recevoir les packets IP, meme si ils sont adresses a d'autres
> hotes?
> 
> Merci, Antoine
> ==================================
Technical Details
Message-ID: <3793F8EA.501ACDA7@cris.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3790E8ED.A2B50A4F@soon.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 101ec9,f3c8fd29c5b66a6b
X-Google-Attributes: gid101ec9,public
X-Google-Thread: f635e,f3c8fd29c5b66a6b
X-Google-Attributes: gidf635e,public
X-Google-Thread: f7f77,f3c8fd29c5b66a6b
X-Google-Attributes: gidf7f77,public
X-Google-Thread: 1155bd,f3c8fd29c5b66a6b
X-Google-Attributes: gid1155bd,public
From: "Randall R. Schulz" <rrschulz@cris.com>
Subject: Re: Receiving RawIP with OT
Date: 1999/07/19
Message-ID: <3793F8EA.501ACDA7@cris.com>
X-Deja-AN: 502993778
Content-Transfer-Encoding: 8bit
References: <3790E8ED.A2B50A4F@soon.com>
X-Accept-Language: en
Content-Type: text/plain; charset=iso-8859-1
Organization: Me, Myself & I, Unincorporated
Mime-Version: 1.0
Reply-To: rrschulz@cris.com
Newsgroups: comp.sys.mac.oop.powerplant,comp.sys.mac.programmer.help,fr.comp.sys.mac.programmation,comp.sys.mac.programmer.codewarrior