retrohackers.org
https://www.retrohackers.org/

MAC address handling
https://www.retrohackers.org/viewtopic.php?f=5&t=181
Page 1 of 3

Author:  MagerValp [ Thu Oct 19, 2006 8:08 am ]
Post subject:  MAC address handling

As those of you who use more than one RR-Net tool has noticed, we need some way of handling MAC addresses. I often have to flush the ARP table inbetween apps, as each app sets its own address. I think the best way would be to let the cartridge that the RR-Net is attached to handle the setting. TFR already does this, and I'll make sure the Snappy Gonzalez does as well. Someone should add it to the RR ROM (together with netmon).

When apps start, they should check and see if the first three bytes of the MAC address are set to 00:80:10 (Commodores reserved space). If not, set a new random address starting with 00:80:10, but leave the address that's there if it's already set.

I think it was Graham that suggested this first.

Comments?

Author:  Devia [ Thu Oct 19, 2006 5:52 pm ]
Post subject: 

I'd suggest to simply always set the MAC to 00:80:10:xx:yy:zz where:
xx = 2nd octet of the current IP
yy = 3rd octet of the current IP
zz = 4th octet of the current IP

Octets counted as 1st.2nd.3rd.4th

So with an IP of 10.0.1.64 you'd get 00:80:10:00:01:40

Since you're probably always using the same IP for all your different roms, this would result in the same MAC for all of them, if implemented of course.
It would also make that MAC unique (nearly always) to any network, since you'd have to align IP's within the network and thus automatically align the MACs at the same time.

EDIT: It would also make the MAC predictable in case you need to know it and it would be a lot easier to implement. ...depending on how easy/fast you can render three random bytes, that is ;-)

comments?

Author:  MagerValp [ Thu Oct 19, 2006 10:15 pm ]
Post subject: 

Not a bad idea - at least better than generating one randomly every time the app starts, or having one MAC for all users. However, I still think we should check if the IP is set first by the cartridge, and set by IP if nothing's found.

Author:  RaveGuru [ Thu Oct 19, 2006 10:41 pm ]
Post subject: 

I like this approach. Although it means I'd have to abandon my leet GuruTerm MAC: 000C64031337 :cry:

There is one problem though, how is this handled in case of DHCP ? I'm not sure if changing MAC address once the IP is aquired is a graceful thing to do, or even allowed... It sure would confuse a lot of stacks out there... or at least temporary render a lot of invalid ARP caches, lest it's allowed to activly announce ARP updates. Hmm.. maybe you can... :?: :?: :?:

Author:  MagerValp [ Fri Oct 20, 2006 8:07 am ]
Post subject: 

No, this is what I'm trying to get at. The MAC address should never change, or at least as rarely as possible. Ideally we'd have a config rom on the RR-Net module, but since we don't, we should let the RR, TFR, or SS set it and have applications leave.

Author:  Devia [ Fri Oct 20, 2006 5:30 pm ]
Post subject: 

whoops... didn't think about DHCP hmmmmmm... back to the thinking box ;-)

Author:  RaveGuru [ Sat Oct 21, 2006 6:14 pm ]
Post subject: 

What about introducing a De facto standard, for instance using the highest 256 bytes page of RR/SS ROM as config register? That area must be used very rarely. It would require a little tool for ROM patching, that's all.

Author:  MagerValp [ Sun Oct 22, 2006 12:34 pm ]
Post subject: 

It won't work when more than one RR user is on the network.

Someone needs to take over the RetroReplay rom development anyway...

Author:  RaveGuru [ Sun Oct 22, 2006 6:23 pm ]
Post subject: 

What about creating a community driven Rom development where we could just specify some basic guidelines (like config format and how to access/handle different hardware and registers) .. basically we need to create a document and keep updating it :)

Author:  Schema [ Tue Oct 24, 2006 2:45 pm ]
Post subject: 

RaveGuru wrote:
What about introducing a De facto standard, for instance using the highest 256 bytes page of RR/SS ROM as config register?


What about us IDE64 users? Actually, having it configurable in the IDE64 BIOS would be nifty, but I'm not sure if the saved settings are readable by user code.

Author:  MagerValp [ Wed Oct 25, 2006 12:27 pm ]
Post subject: 

As long as the MAC address is set in the RR-Net, no problem. Apps would check the packetpage for 00:80:10, and it doesn't matter where it's set.

Author:  RaveGuru [ Mon Oct 30, 2006 3:36 am ]
Post subject: 

But doesn't the CS8900 forget the MAC address when being reset? I.e. when you hit the reset button, as we all do between loading applications?

Author:  MagerValp [ Mon Oct 30, 2006 9:29 am ]
Post subject: 

Good question...

Author:  Devia [ Wed Nov 08, 2006 6:13 pm ]
Post subject: 

See http://rrforum.ath.cx/viewtopic.php?t=187&start=21

The MAC stays

Author:  Devia [ Wed Nov 08, 2006 6:22 pm ]
Post subject: 

So I was thinking...

What if my RR-Net code upon init crafted an ARP Reply packet with broadcast MAC and broadcast IP in the destination fields and with the new MAC and the new or old IP in the source fields? Wouldn't that trigger an update of the ARP cache tables of the other hosts on the same subnet?
..or is the average linux/windoze IP stack too paranoid to accept unsolicited ARP Replies?
If this would work, you could do whatever you want to the MAC and IP. The hosts communicating with your RR-Net would instantly know the right IP/MAC combo of your RR-Net.

...wondering

Page 1 of 3 All times are UTC [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/