Login  •  Register


The time is now: Wed Jul 26, 2017 4:41 pm

Emaculation wiki  •  Delete all board cookies



Post new topic  Reply to topic Page 2 of 3 [ 60 posts ]    Go to page Previous  1, 2, 3  Next
Print view Previous topic  |  Next topic
Author Message
PostPosted: Wed Aug 17, 2016 9:51 am 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
Hi rickyzhang,

Building your last sheep-net-bug-fix-debug branch fails :

Makefile:190: recipe for target 'obj/newcpu.o' failed
make: *** [obj/newcpu.o] Error 1
./../SDL/video_sdl.cpp: In function ‘void update_display_static(driver_base*)’:
./../SDL/video_sdl.cpp:1868:26: warning: comparison between ‘const enum video_depth’ and ‘enum<anonymous>’ [-Wenum-compare]
if (VIDEO_MODE_DEPTH < VIDEO_DEPTH_8BIT) {

So I can't test with it :/

But, I've managed to sniff packets with Wireshark.
this is the saved capt of ping to 8.8.8.8 from 192.168.0.64 :
http://galgot.com/transit/wireshark/Ping_to_8.8.8.8.pcapng
then this is saved capt of ping to www.nytimes.com :
http://galgot.com/transit/wireshark/Ping_to_www.nytimes.com.pcapng
and this is capt of icab trying to reach http://74.125232.241, I had to stop it cause it would "turn " forever :
http://galgot.com/transit/wireshark/iCab_to_http-74.125.232.241.pcapng

Hope this can help...


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

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 73
1. Do you have sdl 1.2 library in host PC? My build script require SDL 1.2 and GTK2

2. I have python script to capture and dump BasiliskII ether_unix.cpp receive and send packet from sheep_net. These packets are more relevant than capturing by wireshark in host.

Please try to compile it again and upload hex dump. Basically, the python script will parse Basilisk II output log from ether_unix.cpp and convert it to wireshark hex dump format.

I found several interesting things from that hex dump in wireshark. (Note that there are differences between packets captured by wireshark in host PC and packets from Basilisk II output log.)

1. modern firewall in host pc may mess up sheep_net. It kept on sent to router saying that guest IP is not reachable. So disable firewall in host PC or if have time, figure it out make a specific rule for guest IP in iptables.

2. When receiving packets from outsides in guest IP, I found duplicate packets with different source ethernet address but same source IP. One from my router and one from my host PC. I believe that may be the main reason why it mess up connection from time to time. But 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 11:17 am 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 73
Update after reading your packets capture.

1. ICMP to 8.8.8.8 looks good
2. DNS works
3. http to IP address got stuck. It is the similar situation it got stuck in TCP 3 way handshake between guest IP and remote IP. I saw first and second step. But guest OS never response in 3rd step.

From 1 and 2, you don't have the issues as I did. Have you disabled your firewall yet?

Please disable your firewall and run python script to generate hex dump. TBH, sheep_net magically work on my box again.

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


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

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 73
I found reason why there is duplicate packet. It is because Fedora enable IP forwarding by default. After disable it, I don't see duplicate any more.
Code:
echo 0 > /proc/sys/net/ipv4//ip_foward


In any case, sheep_net module works again at least for now. But I need to at least
1. Disable firewall so that disable ICMP host unreachable error message.
2. Disable IPv4 forwarding.

Please make sure we have the same setting.

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


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 1:05 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
Ok ,
disabled ip fowarding :
# sysctl -w net.ipv4.ip_forward=0
net.ipv4.ip_forward = 0

disabled firewall :
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

Still not working.

Yes I have sdl 1.2 lib , tried again but still can't build your sheep-net-bug-fix-debug branch.
Tried with :
NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --enable-jit-compiler
make

here result :
In file included from compemu.cpp:7:0:
./../uae_cpu/compiler/compemu.h:36:2: error: #error "Unsupported JIT compiler for this architecture"
#error "Unsupported JIT compiler for this architecture"
^
Makefile:266: recipe for target 'obj/compemu1.o' failed
make: *** [obj/compemu1.o] Error 1

or if I try without specifying jit compiler :
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf
make

I get :
/home/galgot/macemu-sheep-net-bug-fix-debug/BasiliskII/src/Unix/main_unix.cpp:929: undefined reference to `UseJIT'
/home/galgot/macemu-sheep-net-bug-fix-debug/BasiliskII/src/Unix/main_unix.cpp:929: undefined reference to `UseJIT'
/home/galgot/macemu-sheep-net-bug-fix-debug/BasiliskII/src/Unix/main_unix.cpp:930: undefined reference to `flush_icache_range(unsigned char*, unsigned int)'
collect2: error: ld returned 1 exit status
Makefile:111: recipe for target 'BasiliskII' failed
make: *** [BasiliskII] Error 1


...


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 2:38 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 73
You may need to run the whole thing again to remove JIT:
NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf
make

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


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 3:24 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
both

NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf
make


and

NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --disable-jit-compiler
make


fails :

obj/main_unix.o: In function `FlushCodeCache(void*, unsigned int)':
/home/galgot/macemu-sheep-net-bug-fix-debug/BasiliskII/src/Unix/main_unix.cpp:929: undefined reference to `UseJIT'
/home/galgot/macemu-sheep-net-bug-fix-debug/BasiliskII/src/Unix/main_unix.cpp:929: undefined reference to `UseJIT'
/home/galgot/macemu-sheep-net-bug-fix-debug/BasiliskII/src/Unix/main_unix.cpp:930: undefined reference to `flush_icache_range(unsigned char*, unsigned int)'
collect2: error: ld returned 1 exit status
Makefile:111: recipe for target 'BasiliskII' failed
make: *** [BasiliskII] Error 1


even with a reboot between the two tries...


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 3:34 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 73
make clean
to remove *.o

You are using the old object! I'd suggest to modify build.sh. Remove JIT in configure. I don't like typing too much.

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


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 4:44 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
OK...
Finally managed to build it , thks for your patience.

Here is the hexbump.log after saved from Wireshark :
http://galgot.com/transit/wireshark/hexbump.log_1.pcapng

And here are the packets sniffed while pinging with your latest BII build :
http://galgot.com/transit/wireshark/Pings_with_your_last_Commit.pcapng
there a ping to 8.8.8.8 and a icab connection atempt to nytimes in there.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 4:54 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 73
Which one is python script converted from BII output log?

Could you do the following test:
1. Bring up wireshark on host
2. Bring up guest OS with redirect output to the log
3. Ping 8.8.8.8
3. Ping www.google.com
4. http www.google.com

Especially for hex dump from 2. It is essentially one that BII communicate with sheep_net. You can run python script or I can do it for you.

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


Last edited by rickyzhang on Wed Aug 17, 2016 4:58 pm, edited 1 time in total.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 4:57 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
first one


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 5:11 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 73
I found the issue in hex dump log(HDL). BII didn't receive DNS response from sheep_net module, while your host wireshark capture (HWC) suggest that DNS did send response.

Since you have filter HWC, do you see anything fishy around that without filtering?

One more thing, you can add in test I updated above, when http
1. Open local web server, http with IP address
2. http with IP address like nytimes IP 170.149.161.130

-----
PS: Your test is quite messy. I believe at some point time you change DNS from 8.8.8.8 to 212.27.40.240. Could you have a control test setting that we both agree? That would be more helpful.

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


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 5:20 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
rickyzhang wrote:
Which one is python script converted from BII output log?

Could you do the following test:
1. Bring up wireshark on host
2. Bring up guest OS with redirect output to the log
3. Ping 8.8.8.8
3. Ping http://www.google.com
4. http http://www.google.com

Especially for hex dump from 2. It is essentially one that BII communicate with sheep_net. You can run python script or I can do it for you.


Here,
Packets from Wireshark while Ping fron guest to 8.8.8.8, http://www.google.com and http to google:
http://galgot.com/transit/wireshark/Pings_with_your_last_Commit-2.pcapng

and the hex dumps of the same session from python script, raw one from /temp :
http://galgot.com/transit/wireshark/hexdump.log
and the same imported into Wireshark and saved :
http://galgot.com/transit/wireshark/hexbump.log_2.pcapng

Mmmh... what is HWC please ? You know, I don't really know what I'm doing, just trying to do what you tell me :)

Edit: yes my guest have dns 8.8.8.8 and 212.27.40.240/241 , these last two are my provider's one. should I remove it ?

Re-edit : done...


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 5:26 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 73
Just use one. 8.8.8.8
HWC means host PC wireshark capture packets.

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


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 5:35 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 73
From HWC, I saw DNS did response to request. But in HDL, BII didn't receive it.

Can you unfilter HWC, see if anything different color around DNS protocol that from 192.168.0.64 ==> 8.8.8.8?

Please use only *one* DNS 8.8.8.8 for testing. I guess guest OS switch different one if it can't get response. It make our lives harder. But you guest OS is able to connect to 8.8.8.8. It seems something fish there between BII and sheep_net.

We are close!

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


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 6:07 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
Ok,
but how should I unfilter the host (HWC) please ?
If I uncheck "eth0 192.168.0.4" the start button is greyed, so can't snif anything...
Shall I use "Loopback: lo 127.0.0.1 ethernet" ?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 6:15 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 73
First of all, you should stop sniffing and shutdown guest OS when you are done with test. Otherwise, HWC will be jammed with noise. Not fun!
Secondly, filter with ip.addr == 192.168.0.64.
Then, find the one with DNS request to 8.8.8.8, click it.
In then end, clear filter. eye ball any suspicious color after 8.8.8.8 send reply to 192.168.0.64.

By using this method, I found that Fedora enable IP forwarding to mess with guest OS connection and ICMP error due to the firewall. Debian may have something to prevent BII get DNS response from sheep_net.

--
Edit
1. sniffing and filter is different thing. You can sniff first, which sniff all packet. Then do whatever filter later.
2. you should sniff your host PC interface. Not 127.0.0.1. run ifconfig, find the name of interface binding to the host IP.

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


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 6:46 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1683
To explain what's going on a bit more: wireshark sets your ethernet packet capture to promiscuous mode, which means it captures all packets on the wire. It then saves all packets that go to/from the ethernet adapter in a pcap file. Wireshark then has a number of filtering and visualization features that let you filter out data you aren't interested in. You can set inclusive or exclusive filters so that only specific subsets of packets are displayed.

Ricky wants you to filter out everything that doesn't reference IP address 192.168.0.4 to make it easy to find the DNS request, and then remove the filter to see if there's any related activity surrounding the DNS request that doesn't reference that IP. It's possible that the firewall is inserting itself between the hardware device and the virtual device, causing some types of packets to get dropped.

If this is the problem, it should be fixable by adding a rule to the firewall that allows for all traffic between the two interfaces with no filtering. Make it the last rule to run, and it should prevent the kind of blocking you're seeing... IF this is the actual cause of the problem.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 7:40 pm 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
Ok, thks for explanations Adespoton.
Now I understand I can filter the snifed packets to 192.168.0.64 only , then only save the wireshark file...
Anyway, was doing another test while you posted. so didn't do the filtering...
this time shuting down host and stoping capture after each test, then saving python hexdump.log and the wireshark capture for each. only with 8.8.8.8 DNS.
here :
http://galgot.com/transit/wireshark/Ping_to_8.8.8.8-2.pcapng
http://galgot.com/transit/wireshark/hexdump.log-ping_to_8.8.8.8

http://galgot.com/transit/wireshark/Ping_to_wwwGoogleCom.pcapng
http://galgot.com/transit/wireshark/hexdump.log_ping_to_wwwGoogleCom

http://galgot.com/transit/wireshark/http_to_wwwGoogleCom.pcapng
http://galgot.com/transit/wireshark/hexdump.log_http_to_wwwGoogleCom

Hope this can help

Will continue tomorrow, good night.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Aug 17, 2016 8:27 pm 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 73
@adespoton Thanks for your explanation.
@galgot, I didn't explain it well what I want.

After guest OS send DNS query on what "www.google.com"'s IP is to 8.8.8.8 (google DNS server), it (google DNS server) responses correctly to host OS. This has been confirmed from HWC.

However from HDL sheep_net module didn't relay this module to guest OS. Thus, it got stuck.

What I want you was: (assuming you can do analysis by yourself) eyeball unfiltered HWC and see if any suspicious packet around DNS response. If you do, tell me what packets are.

But since you may not be able to do that, what I want from you now is to post the whole unfiltered HWC for a very short time period. Because it sniff all packet from your host, if you have any privacy concerns, you don't have to do that. But we will end the whole analysis. I will have to wait for the moment I can replicate the issues.

Good night!

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


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Aug 18, 2016 2:28 am 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 73
I fix a couple issue in sheep_net.

I believe the culprit may be here: https://github.com/rickyzhang82/macemu/commit/3bc95ecfd48d0765eaf97a119542214e685fc01e#diff-1f71d2ec5a6fd33f4701d42a7e37e520L749

It use transport layer to get destination address, instead of network layer. I tested it with/without my fix and also use dmesg to printk. You can do that as well and see how sheep_net keep and drop IP packet.

Please get the fix from https://github.com/rickyzhang82/macemu/ ... -fix-debug

Make sure commit is 61b04a892815273911f448601e45fbbfed1e5da8

It is US eastern time 10PM. I haven't eaten anything yet. Hope this resolve the intermittent problem.

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


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Aug 18, 2016 9:15 am 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
Hi Rickyzhang,

Tried your latest, (not sure shat you mean by "Make sure commit is 61b04a892815273911f448601e45fbbfed1e5da8" btw, I just downloaded it from the page...).
Doesn't work, sorry :/

Tried what you asked, sniffed the all trafic for a while , host and guest, to see anything suspicious , found this strange :

Image

checked my LAN, there are no other machine using 192.168.0.64... so don't know why "duplicate use..."

anyway, I send you by PM the saved .pcapng from Wireshark so you can see. Two sessions.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Aug 18, 2016 9:34 am 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 73
You haven't used my latest branch! My fix on ARP should address the ARP duplicate problem.

In your local repo, run git log to check if commit hash. Another way to check is to see if file BasiliskII/src/Unix/Linux/NetDriver/README.md exists or not.

If it does, you are on the right track and commit. Rebuild the sheep_net module by runing

Code:
sh build.sh [your account]


-- Edit
You ** must ** rebuild and reload sheep_net module. One way to check it is to run dmesg after you ping from guest OS.

Code:
dmesg | grep sheep_net

Show what IP packet is dropped/kept by sheep_net module.

BTW, I also arp duplicate issues last night. It is because sheep_net broadcast its ARP back to host. It should be eliminated, otherwise it spoof ARP.
Code:
https://github.com/rickyzhang82/macemu/commit/3bc95ecfd48d0765eaf97a119542214e685fc01e#diff-1f71d2ec5a6fd33f4701d42a7e37e520L503

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


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Aug 18, 2016 10:12 am 
Offline
Tinkerer

Joined: Thu Feb 13, 2014 3:59 pm
Posts: 67
README.md file is there. So I have the latest.
Rebuilded sheep_net twice, and reload.
Still no joy :/ sorry

Many thanks for your patience and work Rickyzhang, but if this takes too much of your time, just leave it. No prob.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Aug 18, 2016 10:19 am 
Offline
Tinkerer
User avatar

Joined: Mon Sep 15, 2014 7:59 pm
Posts: 73
No problem. Be patient! ;-)

I really want to fix this and send pull request.

Do you see anything dmesg | grep sheep_net? If it doesn't show drop and keep, you still use the old sheep_net.

You need to close BII to reload it.

--edit
Here is dmesg that show iCab http to www.google.com (IP 74.125.141.147) with my guest OS IP 192.168.2.111

Code:
[  325.172791] sheep_net: got incoming unicast IP packet 74.125.141.147
[  325.201229] sheep_net: got incoming unicast IP packet 74.125.141.147
[  325.201496] sheep_net: got incoming unicast IP packet 74.125.141.147
[  325.201808] sheep_net: got incoming unicast IP packet 74.125.141.147
[  325.202475] sheep_net: got incoming unicast IP packet 74.125.141.147
[  325.228236] sheep_net: got incoming unicast IP packet 74.125.141.147
[  325.228510] sheep_net: got incoming unicast IP packet 74.125.141.147
[  325.236382] sheep_net: got incoming unicast IP packet 74.125.141.147
[  326.211811] sheep_net: filter out incoming IP packet 162.125.18.133 for keep filter 192.168.2.111
[  326.241937] sheep_net: filter out incoming IP packet 162.125.18.133 for keep filter 192.168.2.111


If you still want to debug it, copy dmesg | grep sheep_net to the post

_________________
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 2 of 3 [ 60 posts ]    Go to page Previous  1, 2, 3  Next


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
 

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