Networking discussion

Discussion of development and patch submission.
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: Networking discussion

Post by neozeed »

I downloaded the latest source, and did a build with networking.


pcem_v11_networking.7z

As always, you'll get a 404 page when trying to download, the username and password are ON the 404 page.

There is NO changes in the networking code from the prior versions, so still no front end to the configuration. Sorry, I know I'm a slacker.

I tested it on my machine with SLiRP & PCAP and I could hit this site fine, and with PCAP I could map drives onto a NT server. I know it's not extensive testing..... I also added DrMinGW, so if this thing crashes there will be a pcem.rpt file to at least give a hint on what went wrong.

Image
jznomoney
Posts: 97
Joined: Sat 06 Dec, 2014 9:11 pm

Re: Networking discussion

Post by jznomoney »

delete
Last edited by jznomoney on Sat 11 Jun, 2016 9:12 pm, edited 1 time in total.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: Networking discussion

Post by omarsis81 »

neozeed wrote:As always, you'll get a 404 page when trying to download, the username and password are ON the 404 page.
User avatar
ender
Posts: 51
Joined: Tue 14 Oct, 2014 12:51 pm

Re: Networking discussion

Post by ender »

neozeed: any ideas why PCem runs much slower when pcap is being used (100% without pcap, 50-60% with pcap while idle; emulated CPU is Mobile Pentium MMX 120).
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: Networking discussion

Post by neozeed »

ender wrote:neozeed: any ideas why PCem runs much slower when pcap is being used (100% without pcap, 50-60% with pcap while idle; emulated CPU is Mobile Pentium MMX 120).
I would have to turn on profiling, but I would suspect that your LAN is very very busy so the more traffic going on, the more pcap has to do. I did open it with a filter, but how much traffic are you doing?

I guess it could be an excuse to turn on the logging & gproff...
User avatar
ender
Posts: 51
Joined: Tue 14 Oct, 2014 12:51 pm

Re: Networking discussion

Post by ender »

There is some network traffic, but it averages around 60kB/s down and 10kB/s up, so nothing special.

I am using win10pcap instead of winpcap, but I hope this doesn't make a difference.
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: Networking discussion

Post by neozeed »

ender wrote:There is some network traffic, but it averages around 60kB/s down and 10kB/s up, so nothing special.

I am using win10pcap instead of winpcap, but I hope this doesn't make a difference.
It may. Or it may not, I'm really unsure of what to say..
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: Networking discussion

Post by omarsis81 »

Can this network adapter be used to connect two computers running PCem and play multiplayer games via TCP protocol? Like Civilization 2 Gold, Starcraft, etc.
Sammy75
Posts: 3
Joined: Wed 17 Feb, 2016 10:33 pm

Re: Networking discussion

Post by Sammy75 »

I don't know.

When games use TCP-protocol, sure.

But if the game use IPX, then i don't know if it is enough to run pcem on 2 pcs with win9x and ipx installed in it.

Maybe you need the ipx protocol on the Host, too.

And both PC with running PC must be on the same LAN.

To play that games over internet it is better to use dosbox ipx-server feature.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: Networking discussion

Post by omarsis81 »

Sammy75 wrote: To play that games over internet it is better to use dosbox ipx-server feature.
Ok Sammy! Thank you
amadama
Posts: 57
Joined: Mon 25 Aug, 2014 9:47 pm

Re: Networking discussion

Post by amadama »

omarsis81 wrote:Can this network adapter be used to connect two computers running PCem and play multiplayer games via TCP protocol? Like Civilization 2 Gold, Starcraft, etc.
You can use IPX on PCEM machine just fine. No need for IPX on host machine. In fact you can use any network protocol that supports ethernet.
You can also play TCP/IP games over internet. I played Civnet with a friend over the internet. I was running on PCEM.
Good luck!
User avatar
ender
Posts: 51
Joined: Tue 14 Oct, 2014 12:51 pm

Re: Networking discussion

Post by ender »

As long as you use pcap (not slirp), any protocol will work (over LAN - not over the Internet, where only IP will work).
IAmJefferson
Posts: 3
Joined: Wed 24 Aug, 2016 9:11 pm

Re: Networking discussion

Post by IAmJefferson »

neozeed wrote:OK, so here is my combined SLiRP and PCAP binary/source.

http://vpsland.superglobalmegacorp.com/ ... p-slirp.7z

Again sorry, you have to deal with the stupid password protection. The 404 page has the username and password.

USING PCAP
If you want to use pcap, you will need to know the interface 'guid' to connect to. YOU CANNOT USE PCAP+WIFI since almost all wifi chips won't send and receive promiscuous packets with a forged address. This is a hardware limitation, and Pcap will never work in this setup. Instead try SLiRP.

PCAP can work with protocols like IPX, DecNET, AppleTalk as the raw Ethernet frames are passed on the wire. It will always work best with a WIRED Ethernet connection.

To find your ethernet GUID names, I've included a program ethlist.exe
D:\temp\pcem>ethlist
Network devices:
Number NAME (Description)
0 \Device\NPF_{0DF68748-A9D1-461A-A3E8-F1E10E495688} (Local Area Connection* 2)
1 \Device\NPF_{0CFA803F-F443-4BB9-A83A-657029A98195} (Ethernet)
2 \Device\NPF_{A3F2C156-9D1C-4442-9766-2D745AB46145} (VMware Network Adapter VMnet8)
3 \Device\NPF_{69E9FFD0-D3D6-4985-8823-CDA5937BB224} (Local Area Connection 3)
4 \Device\NPF_{99C37A8D-040F-4217-A0DE-A3CE88B33F8B} (Bluetooth Network Connection 2)
5 \Device\NPF_{551CFF39-47A8-43FE-8137-598FD60859F1} (Wi-Fi)
6 \Device\NPF_{656B6ADB-13BF-4A58-96AD-BD0B61333E6A} (VMware Network Adapter VMnet13)
7 \Device\NPF_{726F0EB3-CC94-45F5-891F-8A8AE8C7CEEB} (VMware Network Adapter VMnet1)
8 \Device\NPF_{A542548C-1A7F-4C49-8CCC-1F8E890F026C} (tun0)
Press Enter to continue...
In this example my Ethernet device is "\Device\NPF_{0CFA803F-F443-4BB9-A83A-657029A98195}". You may need a lot of trial and error here. Sorry. Open up the pcem.cfg file, and you will need to manually add the following:

Code: Select all

netinterface = 1
netcard = 1
net_type = 0
pcap_device = \Device\NPF_{0CFA803F-F443-4BB9-A83A-657029A98195}

[Novell NE2000]
netcard = 1
addr = 0x300
irq = 10
#EMPTY LINE
net_type = 0 sets this to Pcap. You need a valid pcap_device. It shouldn't error out if you use the wrong interface, it just won't work. It's silent and I don't like that. However I did include a PCem-debug which will output all kinds of good debug data to the file pclog.txt. Look for the ne2000 sections and you can follow what is going on.

For example, a working configuration will have output similar to this:
D:\pcem>grep ne2000 pclog.txt
ne2000 pcap device \Device\NPF_{0CFA803F-F443-4BB9-A83A-657029A98195}
ne2000 reset
ne2000 init 0x300 10 slirp is 0 net_is_pcap is 1
ne2000 initalizing libpcap
ne2000 Pcap version [WinPcap version 4.1.3 (packet.dll version 4.1.0.2980), based on libpcap version 1.0 branch 1_0_rel0b (20091008)]
ne2000 pcap is currently in blocking mode
ne2000 Setting interface to non-blocking mode......!
ne2000 Building packet filter.........!
ne2000 Using filter [( ((ether dst ff:ff:ff:ff:ff:ff) or (ether dst ac:de:48:88:bb:aa)) and not (ether src ac:de:48:88:bb:aa) )]
ne2000 net_is_pcap is 1 and net_pcap is 10ed28f8
ne2000 is_slirp 0 is_pcap 1
ne2000 closing pcap
ne2000 close
ne2000 pcap device \Device\NPF_{0CFA803F-F443-4BB9-A83A-657029A98195}
ne2000 reset
ne2000 init 0x300 10 slirp is 0 net_is_pcap is 1
ne2000 initalizing libpcap
ne2000 Pcap version [WinPcap version 4.1.3 (packet.dll version 4.1.0.2980), based on libpcap version 1.0 branch 1_0_rel0b (20091008)]
ne2000 pcap is currently in blocking mode
ne2000 Setting interface to non-blocking mode......!
ne2000 Building packet filter.........!
ne2000 Using filter [( ((ether dst ff:ff:ff:ff:ff:ff) or (ether dst ac:de:48:88:bb:aa)) and not (ether src ac:de:48:88:bb:aa) )]
ne2000 net_is_pcap is 1 and net_pcap is 11b328f8
ne2000 is_slirp 0 is_pcap 1
ne2000 reset
ne2000 pcap sending packet
ne2000 pcap received a frame 60 bytes
ne2000 pcap sending packet
ne2000 pcap received a frame 60 bytes
ne2000 closing pcap
ne2000 close
While having an incorrect GUID will give you output similar to this:
D:\pcem>grep ne2000 pclog.txt
ne2000 pcap device \Device\NPF_{0CFA803F-F443-4BB9-A83A-657029A98196}
ne2000 reset
ne2000 init 0x300 10 slirp is 0 net_is_pcap is 1
ne2000 initalizing libpcap
ne2000 Pcap version [WinPcap version 4.1.3 (packet.dll version 4.1.0.2980), based on libpcap version 1.0 branch 1_0_rel0b (20091008)]
ne2000 pcap_open_live error on \Device\NPF_{0CFA803F-F443-4BB9-A83A-657029A98196}!
ne2000 close

USING SLiRP

Using SLiRP is far more easier, as it is 100% user mode code.

SLiRP only supports TCP/IP. PPTP doesn't work going through it's NAT. It's best suited to HTTP/HTTPS traffic, and unidrectional traffic, like Quake. The IP address you need to give a SLiRP VM is STATIC. Non Passive (active) mode FTP will not work. Passive mode FTP may or may not work, it really depends on the client. Telnet and SSH work fine.

You *MUST* either use BOOTP/DHCP or the following static IP address:
IP: 10.0.2.15
NETMASK: 255.255.255.0
GATEWAY: 10.0.2.2
DNS: 10.0.2.3
Anything other than this will not work. You can *ONLY* ping the address 10.0.2.2 . If you get a reply this will verify that SLiRP is functioning. You will also need to ensure the following entries are in your pcem.cfg file:

Code: Select all

netinterface = 1
netcard = 1
net_type = 1

[Novell NE2000]
netcard = 1
addr = 0x300
irq = 10
#EMPTY LINE

THE FUTURE
I want to add more network connection options, but I think this is a 'good start' for now. Let me know if it works, what kind of setup, even if it fails.
When I was trying to configuring SLiRP on Windows 98SE Networking settings, it couldn't connect, also when I look at the IP configuration application, it still says "PPP Adapter".
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Networking discussion

Post by Battler »

I think you're confusing SLiRP with SLIP which is something completely different. PPP is fine. You just need to input the correct configuration settings in the TCP/IP configuration.
IAmJefferson
Posts: 3
Joined: Wed 24 Aug, 2016 9:11 pm

Re: Networking discussion

Post by IAmJefferson »

Battler wrote:I think you're confusing SLiRP with SLIP which is something completely different. PPP is fine. You just need to input the correct configuration settings in the TCP/IP configuration.
But how?!
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: Networking discussion

Post by neozeed »

IAmJefferson wrote:When I was trying to configuring SLiRP on Windows 98SE Networking settings, it couldn't connect, also when I look at the IP configuration application, it still says "PPP Adapter".
The networking package is called SLiRP, because in the olden days, you could connect to the UNIX machine via SLIP, it would talk to SLiRP which would then NAT you on the UNIX box. It's been repurposed as a user mode NAT library by the Qemu people, and I took it an integrated it into PCem.

So on the Windows side of things, you need a LAN adapter. You need to setup the NE2000 adapter, and get it talking, SLiRP will provide DHCP so Windows will automatically get an IP address.

I hope this makes some sense.....
IAmJefferson
Posts: 3
Joined: Wed 24 Aug, 2016 9:11 pm

Re: Networking discussion

Post by IAmJefferson »

neozeed wrote:
IAmJefferson wrote:When I was trying to configuring SLiRP on Windows 98SE Networking settings, it couldn't connect, also when I look at the IP configuration application, it still says "PPP Adapter".
The networking package is called SLiRP, because in the olden days, you could connect to the UNIX machine via SLIP, it would talk to SLiRP which would then NAT you on the UNIX box. It's been repurposed as a user mode NAT library by the Qemu people, and I took it an integrated it into PCem.

So on the Windows side of things, you need a LAN adapter. You need to setup the NE2000 adapter, and get it talking, SLiRP will provide DHCP so Windows will automatically get an IP address.

I hope this makes some sense.....
But does SLiRP work on WiFi, because I tried to use it on WiFi.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Networking discussion

Post by Battler »

Yes, it does. I personally tested it and it works just fine.
AnnaWu
Posts: 44
Joined: Mon 12 May, 2014 6:10 pm
Location: Germany
Contact:

Re: Networking discussion

Post by AnnaWu »

neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: Networking discussion

Post by neozeed »

IAmJefferson wrote: But does SLiRP work on WiFi, because I tried to use it on WiFi.
Yes. The whole point of using SLiRP, is that it's 100% user mode, no drivers, no shims on the host side. It just gets ethernet frames from the vm, and opens up top ports like a user program, on its behalf.

I've used this library with SIMH, Vax 11/780, and PDP-11, Basilisk II, for MacOS, Previous, the NeXT emulator and got it also included in WinUAE. It's a fantastically useful library for emulation.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Networking discussion

Post by SarahWalker »

I've rebased the network changes onto rev 587 :
ne2000_r587.patch
(407.77 KiB) Downloaded 605 times
I'm looking at cleaning this up to get it in for v12. Is there any reason at present why it shouldn't be included? I am aware I need to improve some of the config stuff.

Also, who exactly worked on this code? I want to make sure I get the credits right.
User avatar
leilei
Posts: 1039
Joined: Fri 25 Apr, 2014 4:47 pm

Re: Networking discussion

Post by leilei »

SA1988, Fabrice Bellard (QEMU) and neozeed would be my guesses.
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: Networking discussion

Post by ppgrainbow »

I'm unable to test the latest build of PCem v11 with networking support on my Windows Vista host machine as is that it broke compatibility in the first place.

I'm planning to move to Windows 7 in a couple of weeks, because Windows Vista will lose all support in April 2017 and vendors are already or have ended support for that OS.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Networking discussion

Post by Battler »

leilei wrote:SA1988, Fabrice Bellard (QEMU) and neozeed would be my guesses.
Also TheGreatCodeholio (of DOSBox-X, from where the NE2000 emulation was ported in the first place.
Is there any reason at present why it shouldn't be included? I am aware I need to improve some of the config stuff.
The code from neozeed's patches is terribly outdated, it missed out on like a year of networking development, though even the far more developed code in 86Box is still incomplete - right now, it uses a hack to hardwire the IP for the RTL8029AS, otherwise it doesn't get an IRQ on the Award 430VX PCI - I think it's supposed to use the APIC on that board, which however is not at all implemented yet. Also, selection of PCap network interface is not yet in place. Also, SLiRP has has DHCP issues, which are hard to patch - if you make it work with the iPXE BIOS, it stops working with Windows 95, if you make it work with Windows 95, it stops working with the iPXE BIOS.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Networking discussion

Post by SarahWalker »

Ok. Is any of this stuff likely to get done and submitted for mainline inclusion in, say, the next year or two? And, for that matter, is any of it actually a prerequisite for getting basic NE2000 emulation committed? I've been waiting something like two years for a committable version of this code with little obvious progress, and I'm basically asking for reasons why I shouldn't get the existing code into a decent enough state for the next release.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Networking discussion

Post by Battler »

- SarahWalker: Not even the improved emulation in 86Box works with most non-Windows guests, I'd say neozeed's works even less... there's still a *lot* to do with it to get into an actually usable state.

Edit: And it only works on Windows hosts. So someone would need to port it to Linux first anyway.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Networking discussion

Post by SarahWalker »

In the interest of getting networking support into a mainline release at some point, I've committed the NE2000 emulation at rev 822. This is basically neozeed's patch rebased with some config stuff added. Build with 'make -f Makefile.mingw-network' - it's currently only supported on Windows, and I've only tested 32-bit builds. It currently defaults to SLiRP, if you want to use PCAP you currently have to edit pcem.cfg.
jznomoney
Posts: 97
Joined: Sat 06 Dec, 2014 9:11 pm

Re: Networking discussion

Post by jznomoney »

can you repost how to configure for pcap if you have time. thanks in advanced.
ndavis82
Posts: 47
Joined: Sun 25 Dec, 2016 5:54 am

Re: Networking discussion

Post by ndavis82 »

I'm getting a fatal error when compiling, "error: pcap.h: No such file or directory"

Using msys on Windows
ndavis82
Posts: 47
Joined: Sun 25 Dec, 2016 5:54 am

Re: Networking discussion

Post by ndavis82 »

Nevermind. I downloaded WinPcap development pack and copied over the necessary lib and include files.
Post Reply