Login  •  Register


The time is now: Sun Apr 30, 2017 8:58 am

Emaculation wiki  •  Delete all board cookies



Post new topic  Reply to topic Page 1 of 3 [ 60 posts ]    Go to page 1, 2, 3  Next
Print view Previous topic  |  Next topic
Author Message
PostPosted: Sun Aug 07, 2016 8:03 am 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
something strange :
I managed to compile sheep_net.ko ethernet driver on Debian 8 PPC (on a PowerBook G4), it loads and all fine.
But , even though I set TCP-IP manually, it doesn't want to get on the internet, only Appletalk works, I can see other macs on the network via the the selector.
Does someone knows of something on Debian 8 preventing BasiliskII from having his own IP address ?
Or does it came from the sheep_net.ko being incompatible ?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Aug 14, 2016 11:22 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 72
Do you assign unique IP address to emulated Mac? I confirm that http (TCP) and ping (ICMP) works in latest Fedora 24.

_________________
There is an App for that!
https://github.com/rickyzhang82


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 2:45 am 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
Yes , I assign 192.168.0.64 to the emulated Mac.
And Debian 8 host use 192.168.0.4.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 11:37 am 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 72
Since, you confirm AppleTalk work. It imply that ethernet layer, aka layer 2 works.

I'd suggest to try two things:
1. Run MacTCP Ping. confirm if ICMP works. Ping to your router with IP address.
2. If 1st step work, confirm if DNS and gate way set correctly. Ping to any URL www.nytimes.com.
3. If 2nd step work , test TCP. Use web browser to test TCP.

At any time, you can download wireshark to sniff packet. I'm writing some doc on how sheep_net work. If you are interested in details, I'd share with your.

_________________
There is an App for that!
https://github.com/rickyzhang82


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 2:34 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
Thanks for your help rickyzhang,

find here a screenshot showing the TCP/IP configuration :
Image

you can see result of ping to the router (192.168.0.254) , I suppose it's a success...
But if I try a connection with icab, I get that error "-23045". Connections also fails with other browsers,or if I try connecting through IP with Timbuktu to another Mac.
And indeed , AppleTalk works, my R-pi running BasiliskII appears in the Chooser and I can mount it. Timbuktu also connects to it through Appletalk.

But Ping to http://www.nytimes.com fails :
Image

Funny thing, the same configuration on my R-pi BasiliskII's (IP 192.168.0.43) works perfectly...


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 2:51 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 72
1. ICMP works.
2. But DNS doesn't work. So I would suggest that use icab with IP address, instead of URL: eg, google in US IP http://74.125.232.241

One more thing, please make sure virtual Mac OS IP, ie 192.168.0.64 has no conflicts with other in you subnet. Supposedly you can ping from other box to this virtual Mac OS IP but it show the same Ethernet address as your host.

_________________
There is an App for that!
https://github.com/rickyzhang82


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 3:25 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1559
If you add 8.8.8.8 to the top of your name server list, does that fix the problem?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 3:30 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
Trying to connect to http://74.125.232.241 from icab fails too, no error mesg though, it just "check" forever... a MacTCP ping to the same address gives the same "Host not responding (Cannot resolve name)" result.

I've checked my router configuration, no problem with that 192.168.0.64 address I've assigned, it's free and available.

I've also tried using a free DNS server server (209.244.0.3) in TCP/IP instead of my providers ones,
though they work fine on the R-Pi BasiliskII... Still no success.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 3:30 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 72
Try ping 8.8.8.8. It is possible that you can't even ICMP to outside.

_________________
There is an App for that!
https://github.com/rickyzhang82


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 4:01 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
ping to 8.8.8.8 works :
Image

So I've set up a local http server at 192.168.0.14 and tried pinging http://192.168.0.14 :
Image
Fail !

but ping to just 192.168.0.14 works :
Image


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 4:27 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 72
1. Ping 8.8.8.8 works with some time out means that you can ICMP to outside network, ie internet. Your sheep_net module works for ICMP.
2. I'd suggest that set DNS as 8.8.8.8 and ping with url "www.nytimes.com" (no http) and see if it can resolve name.
3. If not, that mean UDP doesn't work either. So it may be IP layer issues. You need wireshark or any packet sniffer to run in your host for further debug.

I think somehow it is IP protocol doesn't work in BII. The sheep_net module use so called IP aliasing old technique. It use different IP address for the same ethernet MAC address. In theory, it should be still OK. Because Linux hasn't dropped support this feature yet.

I experienced the similar thing like you did when I'm patching sheep_net module for 4.5 kernel. But somehow it works again for no reason. But I can't replicate the issue any more. So I can't debug it any more (see link https://sourceforge.net/p/basilisk/mailman/basilisk-devel/thread/4C053ABB-1F8C-4913-A626-0C3BB17AA996%40gmail.com/#msg35274819)

I suspect that sheep_net module may drop IP packet from time to time. Thus, it time out when ping to 8.8.8.8

_________________
There is an App for that!
https://github.com/rickyzhang82


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 4:43 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
Tried 8.8.8.8 as DNS and ping to http://www.nytimes.com. no success.

yes I'll try sniffing packet with Wireshark, will have to learn how to use it :)

Note : I have this problem only when building sheep_net on debian 8 Jessie PPC, I have another PB G4 with Jessie and it's the same trouble.
On other machines running Debian 7 Wheezy PPC it works fine.
Also sheep_net works fine on the R-Pi with Rhaspian 8 jessie , but only if I don't update the R-Pi firmware and don't do upgrades. So I've left the R-Pi Jessie at a certain state.
if I upgrade, no more sheep_net.

Thks again for help.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 5:04 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 72
Even you know how to use it, there is still some obstacles. To me, I have no idea how BII inside working after tracing Ethernet interrupt part. There are knowledge gap here and there to prevent me.

I forgot to ask -- Which commit you tried? Recently I patched it for 4.2 kernel. It worth a try for this magic line:

I vaguely remember that after explicitly adding this line -- https://github.com/cebix/macemu/commit/ ... 37e520R721

It seems to make it work. But I'm not so sure if that's the trick.

_________________
There is an App for that!
https://github.com/rickyzhang82


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 5:13 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
I just did a "git clone https://github.com/cebix/macemu.git" to get the all thing.
But that was some weeks ago.

Shall I try that lastest commit dc11229 from 3 days ago ?

Edit: just trying now... :)

Re-edit : re-build sheep_net from that commit, nope, no success :/


Last edited by galgot on Tue Aug 16, 2016 5:28 pm, edited 1 time in total.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 5:18 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1559
Just for clarification: you can't ping http:// -- ping is icmp:// and http:// is a different protocol. The ping client you're using doesn't understand URIs at all, and can only take a domain or IPv4 value.

You can ping the domain, which starts after the //, or you can use a web browser to attempt to access http:// URIs. Ping tests whether the connection to the server is up, and browsing to the domain checks if the connection to the web service is working on that server

8.8.8.8 is Google's domain name server, which often works significantly better than the one provided by your ISP. It does mean, however, that Google is tracking the domains you look up (instead of your ISP tracking them). Using 8.8.8.8 also means that if your ISP is doing traffic shaping based on domain lookups, you've just routed around that.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 5:33 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
Ah ok thanks adespoton.
just tried accessing http://192.168.0.14 (local web server) with iCab, and it's fails too.
No error mesg , but keeps checking forever.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 5:46 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 72
I suspect that from sheep_net module mess up ethernet packet size.

It hard coded ethernet packet size 1514 byte in BII read
https://github.com/cebix/macemu/blob/ma ... x.cpp#L931

But it is only copy up to count.
https://github.com/cebix/macemu/blob/ma ... net.c#L420

You can try a dirty fix to bump up L931 to 1518 as google show the maximum ethernet packet size. Give a try and let me know.

_________________
There is an App for that!
https://github.com/rickyzhang82


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 6:04 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
Ok,
I've changed l931, from :
length = read(fd, Mac2HostAddr(packet), net_if_type == NET_IF_ETHERTAP ? 1516 : 1514);
to :
length = read(fd, Mac2HostAddr(packet), net_if_type == NET_IF_ETHERTAP ? 1516 : 1518);

And rebuild, install,
then sudo modprobe sheep_net and sudo chown galgot /dev/sheep_net
...but still no joy in BasiliskII.

or is it "1516" that I should change to "1518" ?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 6:20 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 72
No, first one is for tap. Yours is otherwise, ie NET_IF_SHEEPNET.

Try:
https://github.com/cebix/macemu/blob/ma ... net.c#L127
Bump up max queue to 128

_________________
There is an App for that!
https://github.com/rickyzhang82


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 6:36 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
Nope, same thing :/


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 7:09 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 72
Use wireshark on your host and sniff the IP packet to/from your guest Mac OS with filter ip.addr == 192.168.0.64

Test 1: ping to outside, ie 8.8.8.8
Test 2: ping to outside with URL, ie www.nytimes
Test 2: ical http to outside with IP

One capture per test with filter and post it here.

_________________
There is an App for that!
https://github.com/rickyzhang82


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 8:25 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
Ok, I've installed Wireshark. But as i said, have to learn how to use it, it's very new to me .
Will see that tomorrow . Good night :)


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 16, 2016 10:11 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 72
Today, I could replicate that sheep_net module didn't work, either.

When ping to my gateway IP from guest OS, I found that host PC sent out ICMP with type 3 error code 10 to inform gateway/router that guest OS IP is not reachable.

I can disable ICMP by iptables in host OS.
Code:
iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP


But it doesn't work, either. Interesting?

_________________
There is an App for that!
https://github.com/rickyzhang82


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 12:55 am 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 72
To help debug, I wrote a python script to extract and convert BII sending/receiving packet from ether_unix.cpp debug log

You can pull it from my repo branch 'sheep-net-bug-fix-debug' https://github.com/rickyzhang82/macemu/ ... -fix-debug

Code:
cd macemu/BasiliskII/src/Unix
sh build.sh
./BasiliskII > /tmp/debug.log
# You should ping/DNS/http in guest OS to generate packet output from log
python extract_eth_hex.py -i /tmp/debug.log -o /tmp/hexdump.log


In wireshark, import from hex dump -->/tmp/hexdump.log

Because sheep_net module take in multicast packet, you will see a lot of noises in wireshark.

I kind of figure it out that. BII didn't receive DNS response packet from sheep_net module.

BII <== sheep_net <== Linux host

Now I need to figure it out why.

_________________
There is an App for that!
https://github.com/rickyzhang82


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 9:28 am 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 72
This early morning, I analyzed and compared the BII hex dump packets from wireshark and packets captured in host.

I found that the host PC kept on sending ICMP to my router and saying that guest OS IP is not reachable.
I looked into iptables chain rule. It does specify this rule. So I disabled firewall completely
Code:
sudo systemctl disable firewalld.service


Now, I can't replicate the issues any more. I'm not sure if I feel happy or not.

But next time if whoever encounters this, please do the followings:

1. Keep using BII from my sheep-net-bug-fix-debug branch
Code:
./BasiliskII > /tmp/debug.log
# You should ping/DNS/http in guest OS to generate packet output from log
python extract_eth_hex.py -i /tmp/debug.log -o /tmp/hexdump.log


2. Open wireshark on host PC and capture packet.

Keep /tmp/hexdump.log from 1 and packet from 2. Notify me by opening issues in my macemu git repo.

This is most painful thing if it can't replicate every time.

_________________
There is an App for that!
https://github.com/rickyzhang82


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


Who is online

Users browsing this forum: No registered users and 2 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
 

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