Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Digital Archaeology » Computer Arcana » Apple » Apple II » Announcing the Marina IP stack for Apple II
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Announcing the Marina IP stack for Apple II [message #287094] Thu, 02 April 2015 21:24 Go to next message
D Finnigan is currently offline  D Finnigan
Messages: 1082
Registered: October 2012
Karma: 0
Senior Member
Because I wanted to learn more about ethernet and TCP/IP networking, and
because I was dissatisfied with existing TCP/IP implementations for the
Apple, I decided to write my own implementation. It is called Marina.

I started on February 1st of this year, taking a Uthernet/CS8900A driver
that I'd written about 2 years ago, and in 2 months' time I have written
decent implementations of IP, ARP, UDP, DHCP, with little bits of ICMP, and
the start of a DNS resolver.

As far as I know, Marina is the first IP stack for Apple II to include a
Link-Local addressing implementation. It has several other unique features
too, but that was the one feature that I really wanted to have in a TCP/IP
stack for Apple II.

Visit the Marina web site for documentation and downloads:

http://marina.a2hq.com/

--
]DF$
The Marina IP stack for Apple II--
http://marina.a2hq.com/
Re: Announcing the Marina IP stack for Apple II [message #287096 is a reply to message #287094] Thu, 02 April 2015 22:22 Go to previous messageGo to next message
Steven Hirsch is currently offline  Steven Hirsch
Messages: 789
Registered: October 2012
Karma: 0
Senior Member
On 04/02/2015 09:24 PM, D Finnigan wrote:

> As far as I know, Marina is the first IP stack for Apple II to include a
> Link-Local addressing implementation. It has several other unique features
> too, but that was the one feature that I really wanted to have in a TCP/IP
> stack for Apple II.

Cool! Nice work.
Re: Announcing the Marina IP stack for Apple II [message #287097 is a reply to message #287096] Thu, 02 April 2015 22:38 Go to previous messageGo to next message
D Finnigan is currently offline  D Finnigan
Messages: 1082
Registered: October 2012
Karma: 0
Senior Member
Steven Hirsch wrote:
> On 04/02/2015 09:24 PM, D Finnigan wrote:
>
>> As far as I know, Marina is the first IP stack for Apple II to include a
>> Link-Local addressing implementation. It has several other unique
>> features
>> too, but that was the one feature that I really wanted to have in a
>> TCP/IP
>> stack for Apple II.
>
> Cool! Nice work.
>

Thanks. I have a homogenous Mac OS environment at home, so I'm interested to
see how Marina works when connected to other types of networks.

One thing I forgot to mention in the documentation is that the + sign
printed after the IP length means that the IP checksum was correct. The +
sign after PROTOCOL: UDP means that the UDP checksum is correct. If you see
an @ instead, that means the checksum was bad.

Otherwise, I think the rest of it is pretty much no-brainer...

--
]DF$
The Marina IP stack for Apple II--
http://marina.a2hq.com/
Re: Announcing the Marina IP stack for Apple II [message #287126 is a reply to message #287094] Fri, 03 April 2015 10:12 Go to previous messageGo to next message
Anton Treuenfels is currently offline  Anton Treuenfels
Messages: 105
Registered: December 2011
Karma: 0
Senior Member
"D Finnigan" <dog_cow@macgui.com> wrote in message
news:dog_cow-1428024311@macgui.com...
> Because I wanted to learn more about ethernet and TCP/IP networking, and
> because I was dissatisfied with existing TCP/IP implementations for the
> Apple, I decided to write my own implementation. It is called Marina.
>
> I started on February 1st of this year, taking a Uthernet/CS8900A driver
> that I'd written about 2 years ago, and in 2 months' time I have written
> decent implementations of IP, ARP, UDP, DHCP, with little bits of ICMP,
> and
> the start of a DNS resolver.
>
> As far as I know, Marina is the first IP stack for Apple II to include a
> Link-Local addressing implementation. It has several other unique features
> too, but that was the one feature that I really wanted to have in a TCP/IP
> stack for Apple II.
>
> Visit the Marina web site for documentation and downloads:
>
> http://marina.a2hq.com/
>
> --
> ]DF$
> The Marina IP stack for Apple II--
> http://marina.a2hq.com/
>

I look forward to the promised assembler source!

- Anton Treuenfels
Announcing the Marina IP stack for Apple II [message #287163 is a reply to message #287094] Fri, 03 April 2015 19:41 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: xennex

Kudos for full RFC 3514 support. Magnificent! If I also may be so bold to ask, is RFC 2549 (or at the very least RFC 1149) compliance on the roadmap?
Re: Announcing the Marina IP stack for Apple II [message #287175 is a reply to message #287163] Fri, 03 April 2015 22:47 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: awanderin

xennex <lalonghorn@gmail.com> writes:

> Kudos for full RFC 3514 support. Magnificent! If I also may be so bold
> to ask, is RFC 2549 (or at the very least RFC 1149) compliance on the
> roadmap?

It would have been if you'd asked two days ago. :)

--
Jerry awanderin at gmail dot com
Re: Announcing the Marina IP stack for Apple II [message #287421 is a reply to message #287163] Wed, 08 April 2015 16:32 Go to previous messageGo to next message
D Finnigan is currently offline  D Finnigan
Messages: 1082
Registered: October 2012
Karma: 0
Senior Member
xennex wrote:
> Kudos for full RFC 3514 support. Magnificent! If I also may be so bold to
> ask, is RFC 2549 (or at the very least RFC 1149) compliance on the
> roadmap?
>

No, I want to focus on improving my compliance with existing RFCs, then get
the TCP module going. I've got a real application in mind, something that
will do file transfers.

I understand that people aren't taking this project very seriously right now
because it has no real applications yet. But it does exist and it does UDP.
Just try the demo and disassemble the code. And I'll continue making
improvements.

--
]DF$
The Marina IP stack for Apple II--
http://marina.a2hq.com/
Re: Announcing the Marina IP stack for Apple II [message #287422 is a reply to message #287421] Wed, 08 April 2015 16:55 Go to previous messageGo to next message
Payton Byrd is currently offline  Payton Byrd
Messages: 1198
Registered: December 2011
Karma: 0
Senior Member
On Wednesday, April 8, 2015 at 3:33:11 PM UTC-5, D Finnigan wrote:
> No, I want to focus on improving my compliance with existing RFCs, then get
> the TCP module going. I've got a real application in mind, something that
> will do file transfers.
>
> I understand that people aren't taking this project very seriously right now
> because it has no real applications yet. But it does exist and it does UDP.
> Just try the demo and disassemble the code. And I'll continue making
> improvements.
>
> --
> ]DF$
> The Marina IP stack for Apple II--
> http://marina.a2hq.com/

UDP is enough to write a game.
Re: Announcing the Marina IP stack for Apple II [message #287423 is a reply to message #287422] Wed, 08 April 2015 17:09 Go to previous messageGo to next message
D Finnigan is currently offline  D Finnigan
Messages: 1082
Registered: October 2012
Karma: 0
Senior Member
Payton Byrd wrote:
>
> UDP is enough to write a game.
>

That's the spirit! You could write a turn-based game on UDP. I'd hesitate to
plan any live-action game right now, though. ;-) Especially with no
interrupts from the Uthernet!

--
]DF$
The Marina IP stack for Apple II--
http://marina.a2hq.com/
Re: Announcing the Marina IP stack for Apple II [message #287424 is a reply to message #287423] Wed, 08 April 2015 18:58 Go to previous messageGo to next message
aiiadict is currently offline  aiiadict
Messages: 134
Registered: May 2012
Karma: 0
Senior Member
Cribbage? I'll write the game logic and graphics routines.. you make it talk over the net
Re: Announcing the Marina IP stack for Apple II [message #287437 is a reply to message #287423] Wed, 08 April 2015 20:57 Go to previous messageGo to next message
mdj is currently offline  mdj
Messages: 301
Registered: December 2012
Karma: 0
Senior Member
On Thursday, 9 April 2015 07:10:25 UTC+10, D Finnigan wrote:

> That's the spirit! You could write a turn-based game on UDP. I'd hesitate to
> plan any live-action game right now, though. ;-) Especially with no
> interrupts from the Uthernet!

Lawless Legends Online ?

:-)
Re: Announcing the Marina IP stack for Apple II [message #287472 is a reply to message #287423] Thu, 09 April 2015 17:49 Go to previous messageGo to next message
ol.sc is currently offline  ol.sc
Messages: 201
Registered: January 2013
Karma: 0
Senior Member
Hi David,

> I'd hesitate to
> plan any live-action game right now, though. ;-) Especially with no
> interrupts from the Uthernet!

I'm pretty sure that CS8900A interrupts wouldn't be beneficial -
especially for ganes. Imagine some interrupt routine reading the
CS8900A and placing received data in some buffer. Whenever the main
program polls that buffer for new data it can as well with only few
more instructions poll the CS8900A itself.

In general You usually want interrupts to get data as quickly as
possible from devices with limited buffers to avoid buffer overflows.
However the CS8900A has buffers much likely larger than a game would
be willing to spend in Apple II RAM. So it's actually best to keep
data there until the main program is ready to process them - without
any additional buffering.

Additionally interrupts would disturb Apple II sound generation.

Regards,
Oliver
Re: Announcing the Marina IP stack for Apple II [message #287477 is a reply to message #287424] Thu, 09 April 2015 19:44 Go to previous messageGo to next message
D Finnigan is currently offline  D Finnigan
Messages: 1082
Registered: October 2012
Karma: 0
Senior Member
aiiadict wrote:
> Cribbage? I'll write the game logic and graphics routines.. you make it
> talk over the net
>

If you're serious, give me a couple of weeks to get the API sorted out, and
I'll see what I can do. :-)
Re: Announcing the Marina IP stack for Apple II [message #287478 is a reply to message #287472] Thu, 09 April 2015 19:49 Go to previous messageGo to next message
D Finnigan is currently offline  D Finnigan
Messages: 1082
Registered: October 2012
Karma: 0
Senior Member
Oliver Schmidt wrote:
> Hi David,
>
>> I'd hesitate to
>> plan any live-action game right now, though. ;-) Especially with no
>> interrupts from the Uthernet!
>
> I'm pretty sure that CS8900A interrupts wouldn't be beneficial -
> especially for ganes. Imagine some interrupt routine reading the
> CS8900A and placing received data in some buffer. Whenever the main
> program polls that buffer for new data it can as well with only few
> more instructions poll the CS8900A itself.
>
> In general You usually want interrupts to get data as quickly as
> possible from devices with limited buffers to avoid buffer overflows.
> However the CS8900A has buffers much likely larger than a game would
> be willing to spend in Apple II RAM. So it's actually best to keep
> data there until the main program is ready to process them - without
> any additional buffering.
>
> Additionally interrupts would disturb Apple II sound generation.

Those are all good points and I appreciate your input on this subject.

I am considering using the Language Card or a multi-bank Language card (like
Saturn or Legend) on the II and II Plus, and Aux RAM or multi-bank Aux RAM
on IIe to buffer packets.

Also, Marina uses separate send buffers for ARP and DHCP. That was another
feature I wanted from the start: sending an ARP request will not overwrite
the IP packet, as it seems to do in IP65 and Contiki!

Marina's output buffer can be located anywhere in RAM, so adding support for
multiple send buffers should be simple.

--
]DF$
The Marina IP stack for Apple II--
http://marina.a2hq.com/
Re: Announcing the Marina IP stack for Apple II [message #287537 is a reply to message #287477] Fri, 10 April 2015 20:29 Go to previous messageGo to next message
aiiadict is currently offline  aiiadict
Messages: 134
Registered: May 2012
Karma: 0
Senior Member
Yup. I will start today. Game logic in basic. Graphics routines in assembly.

Need over the net: find player. Exchange names. Send value of last card played. Send claimed points. Send stolen points
Re: Announcing the Marina IP stack for Apple II [message #287592 is a reply to message #287537] Sat, 11 April 2015 17:44 Go to previous messageGo to next message
D Finnigan is currently offline  D Finnigan
Messages: 1082
Registered: October 2012
Karma: 0
Senior Member
aiiadict wrote:
> Yup. I will start today. Game logic in basic. Graphics routines in
> assembly.
>
> Need over the net: find player. Exchange names. Send value of last card
> played. Send claimed points. Send stolen points
>

A BASIC interface to Marina should be possible. I can't think of anything
right now that would require bit manipulation or things like that. I suppose
the data sent between computers will be very small.

When I get some more features added to Marina, I'll release the source.
Right now, the code is constantly moving around. I don't have any fixed
entry points like in the ProDOS MLI.

--
]DF$
The Marina IP stack for Apple II--
http://marina.a2hq.com/
Re: Announcing the Marina IP stack for Apple II [message #287597 is a reply to message #287592] Sat, 11 April 2015 19:45 Go to previous messageGo to next message
Michael J. Mahon is currently offline  Michael J. Mahon
Messages: 1752
Registered: October 2012
Karma: 0
Senior Member
D Finnigan <dog_cow@macgui.com> wrote:
> aiiadict wrote:
>> Yup. I will start today. Game logic in basic. Graphics routines in
>> assembly.
>>
>> Need over the net: find player. Exchange names. Send value of last card
>> played. Send claimed points. Send stolen points
>>
>
> A BASIC interface to Marina should be possible. I can't think of anything
> right now that would require bit manipulation or things like that. I suppose
> the data sent between computers will be very small.
>
> When I get some more features added to Marina, I'll release the source.
> Right now, the code is constantly moving around. I don't have any fixed
> entry points like in the ProDOS MLI.


It's worth putting a branch vector at the beginning of the code so that
past entry points don't change when changes are made. Years have taught me
that there's always a version n+1. ;-)

Don't rule out an ampersand extension to Applesoft--it can take a lot of
pain out of parameter passing and return values. (See my AmperNada for a
very compact way of doing this.)

Of course, the key is presenting sufficiently high level functions that
using Applesoft for "glue" is not a performance issue when doing something
real.
--
-michael - NadaNet 3.1 and AppleCrate II: http://home.comcast.net/~mjmahon
Re: Announcing the Marina IP stack for Apple II [message #287599 is a reply to message #287597] Sat, 11 April 2015 20:13 Go to previous messageGo to next message
D Finnigan is currently offline  D Finnigan
Messages: 1082
Registered: October 2012
Karma: 0
Senior Member
Michael J. Mahon wrote:
>
>
> It's worth putting a branch vector at the beginning of the code so that
> past entry points don't change when changes are made. Years have taught
> me
> that there's always a version n+1. ;-)

That's probably what I'll do for now. I haven't made any standardized API or
jump table because I'm considering writing a ProDOS MLI-style interface,
where you have a parameter block and always JSR to a common entry point.

That's probably over the top for an Applesoft interface, though.

>
> Don't rule out an ampersand extension to Applesoft--it can take a lot of
> pain out of parameter passing and return values. (See my AmperNada for a
> very compact way of doing this.)
>
> Of course, the key is presenting sufficiently high level functions that
> using Applesoft for "glue" is not a performance issue when doing something
> real.

Thanks. I'll look at your AmperNada.

--
]DF$
The Marina IP stack for Apple II--
http://marina.a2hq.com/
Re: Announcing the Marina IP stack for Apple II [message #287603 is a reply to message #287599] Sat, 11 April 2015 22:28 Go to previous messageGo to next message
gids.rs is currently offline  gids.rs
Messages: 1325
Registered: October 2012
Karma: 0
Senior Member
On Saturday, April 11, 2015 at 6:14:52 PM UTC-6, D Finnigan wrote:
> Michael J. Mahon wrote:
>>
>>
>> It's worth putting a branch vector at the beginning of the code so that
>> past entry points don't change when changes are made. Years have taught
>> me
>> that there's always a version n+1. ;-)
>
> That's probably what I'll do for now. I haven't made any standardized API or
> jump table because I'm considering writing a ProDOS MLI-style interface,
> where you have a parameter block and always JSR to a common entry point.
>
> That's probably over the top for an Applesoft interface, though.
>
>>
>> Don't rule out an ampersand extension to Applesoft--it can take a lot of
>> pain out of parameter passing and return values. (See my AmperNada for a
>> very compact way of doing this.)
>>
>> Of course, the key is presenting sufficiently high level functions that
>> using Applesoft for "glue" is not a performance issue when doing something
>> real.
>
> Thanks. I'll look at your AmperNada.
>


Don't rule out the USR function either. One of my favorite methods of passing parameters.

X=USR(0-255)[,Y][,Z] - where the o-255 is the call to a table with up to 256 subroutines. Y and Z passes values to the subroutine if needed.

I like to use zero for a 16 bit PEEK; X=USR(0),Y in place of X= PEEK(Y) + 256 * PEEK(Y+1)

Therefore, you wouldn't have to assign a function to an address, just a function to a table entry # and update the address as needed.
Re: Announcing the Marina IP stack for Apple II [message #287617 is a reply to message #287599] Sun, 12 April 2015 02:46 Go to previous messageGo to next message
Michael J. Mahon is currently offline  Michael J. Mahon
Messages: 1752
Registered: October 2012
Karma: 0
Senior Member
D Finnigan <dog_cow@macgui.com> wrote:
> Michael J. Mahon wrote:
>>
>>
>> It's worth putting a branch vector at the beginning of the code so that
>> past entry points don't change when changes are made. Years have taught
>> me
>> that there's always a version n+1. ;-)
>
> That's probably what I'll do for now. I haven't made any standardized API or
> jump table because I'm considering writing a ProDOS MLI-style interface,
> where you have a parameter block and always JSR to a common entry point.
>
> That's probably over the top for an Applesoft interface, though.

Yes--it usually requires a few POKEs prior to each CALL, which is
considerably slower and less readable than a &FUNCTION (A,B,C).

>>
>> Don't rule out an ampersand extension to Applesoft--it can take a lot of
>> pain out of parameter passing and return values. (See my AmperNada for a
>> very compact way of doing this.)
>>
>> Of course, the key is presenting sufficiently high level functions that
>> using Applesoft for "glue" is not a performance issue when doing something
>> real.
>
> Thanks. I'll look at your AmperNada.

--
-michael - NadaNet 3.1 and AppleCrate II: http://home.comcast.net/~mjmahon
Re: Announcing the Marina IP stack for Apple II [message #287621 is a reply to message #287478] Sun, 12 April 2015 07:45 Go to previous messageGo to next message
ol.sc is currently offline  ol.sc
Messages: 201
Registered: January 2013
Karma: 0
Senior Member
Hi David,

> Those are all good points and I appreciate your input on this subject.

:-)

> Also, Marina uses separate send buffers for ARP and DHCP. That was another
> feature I wanted from the start: sending an ARP request will not overwrite
> the IP packet, as it seems to do in IP65 and Contiki!

Explicitly not discussing if the design decision fits well a certain
usecase or not I'd like to mention that it was an explicit design
decision to have Contiki (or rather uIP) work with a single buffer
(both for receiving and sending). The design was primarily driven to
allow old-school micro controllers to do TCP/IP. Those controllers
tend to have quite some ROM for storing code but only 1kB RAM.

The primary two - from my perspective - innovative concepts to allow
for a single buffer are...

- to consider the TCP/IP stack as part of the unreliable network. Any
IP packet sent might get lost so there always needs to be a mechanism
to compensate for packet loss. Given that these mechanisms already
exist anyway one can as well repurpose them for free by losing a
packet now and then in the TCP/IP stack.

- to consider the application as part of the TCP/IP stack. The
application doesn't "push" data to be sent into the TCP/IP stack.
Rather it notifies the stack of the wish to send and the stack calls
back into the application and "pulls" the data from the application.
This makes the data arrive in the single buffer at the right time (and
has other implementation benefits). But much more importantly it
allows the stack to re-pull the data again (i.e. as part of TCP
retransmission) from the application if the original data was lost.
Many applications use just the same code path for "original pulls" and
re-pulls: I.e. for some temperature sensor it doesn't hurt if the
re-pull contains a slightly different value. Other applications need
only negligible additional logic for re-pulls: Some file sending
application just needs some lseek() support to reposition the file
pointer backwards for re-pulls. And the few applications really
needing "double-buffering" do so on application level. All this can be
pretty well compared the the way screen drawing is handled in GUIs:
The framework calls the application to (re-)draw a rect and in most
cases there's no difference between the original draw triggered by the
application logic and the re-draw triggered by the framework because
i.e. a window gets uncovered.

Regards,
Oliver
Re: Announcing the Marina IP stack for Apple II [message #288131 is a reply to message #287537] Sat, 18 April 2015 15:00 Go to previous message
D Finnigan is currently offline  D Finnigan
Messages: 1082
Registered: October 2012
Karma: 0
Senior Member
<aiiadict@gmail.com> wrote:
> Yup. I will start today. Game logic in basic. Graphics routines in assembly.
>
> Need over the net: find player. Exchange names. Send value of last
> card played. Send claimed points. Send stolen points

Let's synchronize our watches: how many zero page locations do you need,
and what will be the load address for your machine code?

Right now, Marina loads at $7000 and is about $1C00 bytes long.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: New beginner programmer tutorial using AppleSoft BASIC
Next Topic: New Apple II Project - New accelerator card for Apple II's (not GS)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Tue Sep 27 23:49:23 EDT 2022

Total time taken to generate the page: 0.01398 seconds