It is currently Thu Jan 22, 2026 12:16 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: MAC address handling
PostPosted: Thu Oct 19, 2006 8:08 am 
Offline

Joined: Sat Oct 14, 2006 8:30 am
Posts: 140
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?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 19, 2006 5:52 pm 
Offline
User avatar

Joined: Thu Jan 12, 2006 12:52 am
Posts: 203
Location: Denmark
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?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 19, 2006 10:15 pm 
Offline

Joined: Sat Oct 14, 2006 8:30 am
Posts: 140
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 19, 2006 10:41 pm 
Offline
Site Admin

Joined: Wed Jan 11, 2006 11:22 am
Posts: 874
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... :?: :?: :?:


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Oct 20, 2006 8:07 am 
Offline

Joined: Sat Oct 14, 2006 8:30 am
Posts: 140
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Oct 20, 2006 5:30 pm 
Offline
User avatar

Joined: Thu Jan 12, 2006 12:52 am
Posts: 203
Location: Denmark
whoops... didn't think about DHCP hmmmmmm... back to the thinking box ;-)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Oct 21, 2006 6:14 pm 
Offline
Site Admin

Joined: Wed Jan 11, 2006 11:22 am
Posts: 874
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Oct 22, 2006 12:34 pm 
Offline

Joined: Sat Oct 14, 2006 8:30 am
Posts: 140
It won't work when more than one RR user is on the network.

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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Oct 22, 2006 6:23 pm 
Offline
Site Admin

Joined: Wed Jan 11, 2006 11:22 am
Posts: 874
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 :)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 24, 2006 2:45 pm 
Offline
User avatar

Joined: Mon Feb 13, 2006 6:44 pm
Posts: 215
Location: Toronto, Canada
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 25, 2006 12:27 pm 
Offline

Joined: Sat Oct 14, 2006 8:30 am
Posts: 140
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 30, 2006 3:36 am 
Offline
Site Admin

Joined: Wed Jan 11, 2006 11:22 am
Posts: 874
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?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 30, 2006 9:29 am 
Offline

Joined: Sat Oct 14, 2006 8:30 am
Posts: 140
Good question...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 08, 2006 6:13 pm 
Offline
User avatar

Joined: Thu Jan 12, 2006 12:52 am
Posts: 203
Location: Denmark
See http://rrforum.ath.cx/viewtopic.php?t=187&start=21

The MAC stays


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 08, 2006 6:22 pm 
Offline
User avatar

Joined: Thu Jan 12, 2006 12:52 am
Posts: 203
Location: Denmark
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group