Networking discussion
Re: Networking discussion
Very cool!! I tested NE2000 under Windows 98 and it works great! TCP/IP working fantastic!
- SarahWalker
- Site Admin
- Posts: 2054
- Joined: Thu 24 Apr, 2014 4:18 pm
Re: Networking discussion
Rev 823 adds a GUI dialogue to configure this.jznomoney wrote:can you repost how to configure for pcap if you have time. thanks in advanced.
Re: Networking discussion
The Voodoo configuration box is in the wrong place now since the latest commit.
- SarahWalker
- Site Admin
- Posts: 2054
- Joined: Thu 24 Apr, 2014 4:18 pm
Re: Networking discussion
Fixed in rev 824.
Re: Networking discussion
I compiled latest source but I met these errors with default settings of makefile.
These included -Wall -Werror arguments.
and I saw these warnings from slirp.
But I solved these warnings.
Here is a patch. no more warnings after this patch. I got this idea from 86Box's slirp files,
when I compile it, there was no warnings.
Thanks to them.
These included -Wall -Werror arguments.
Code: Select all
In file included from ne2000.c:35:0:
slirp/slirp.h:334:21: error: inline function 'remque_32' declared but never defined [-Werror]
extern inline void remque_32 _P((void *));
^~~~~~~~~
slirp/slirp.h:333:21: error: inline function 'insque_32' declared but never defined [-Werror]
extern inline void insque_32 _P((void *, void *));
^~~~~~~~~
Code: Select all
In file included from nethandler.c:2:0:
G:/backup-drivec/msys-pcem-fs116/mingw32/i686-w64-mingw32/include/winsock2.h:15:2: error: #warning Please include winsock2.h before windows.h [-Werror=cpp]
#warning Please include winsock2.h before windows.h
^~~~~~~
Code: Select all
gcc -I. -Ofast -Wall -c misc.c -o misc.o
misc.c: In function 'getouraddr':
misc.c:95:18: warning: passing argument 1 of 'gethostname' from incompatible pointer type [-Wincompatible-pointer-types]
if (gethostname(&buff,500) == 0)
^
In file included from slirp.h:42:0,
from misc.c:10:
G:/backup-drivec/msys-pcem-fs116/mingw32/i686-w64-mingw32/include/winsock2.h:1004:34: note: expected 'char *' but argument is of type 'char (*)[512]'
WINSOCK_API_LINKAGE int WSAAPI gethostname(char *name,int namelen);
^~~~~~~~~~~
misc.c:96:32: warning: passing argument 1 of 'gethostbyname' from incompatible pointer type [-Wincompatible-pointer-types]
he = gethostbyname(&buff);
^
In file included from slirp.h:42:0,
from misc.c:10:
G:/backup-drivec/msys-pcem-fs116/mingw32/i686-w64-mingw32/include/winsock2.h:1003:46: note: expected 'const char *' but argument is of type 'char (*)[512]'
WINSOCK_API_LINKAGE struct hostent *WSAAPI gethostbyname(const char *name);
^~~~~~~~~~~~~
gcc -I. -Ofast -Wall -c queue.c -o queue.o
gcc -I. -Ofast -Wall -c sbuf.c -o sbuf.o
gcc -I. -Ofast -Wall -c slirp.c -o slirp.o
slirp.c: In function 'slirp_select_poll':
slirp.c:439:26: warning: passing argument 2 of 'send' from incompatible pointer type [-Wincompatible-pointer-types]
ret = send(so->s, &ret, 0, 0); //This is what it should be.
^
In file included from slirp.h:42:0,
from slirp.c:1:
G:/backup-drivec/msys-pcem-fs116/mingw32/i686-w64-mingw32/include/winsock2.h:997:34: note: expected 'const char *' but argument is of type 'int *'
WINSOCK_API_LINKAGE int WSAAPI send(SOCKET s,const char *buf,int len,int flags);
^~~~
slirp.c:485:26: warning: passing argument 2 of 'send' from incompatible pointer type [-Wincompatible-pointer-types]
ret = send(so->s, &ret, 0,0);
^
In file included from slirp.h:42:0,
from slirp.c:1:
G:/backup-drivec/msys-pcem-fs116/mingw32/i686-w64-mingw32/include/winsock2.h:997:34: note: expected 'const char *' but argument is of type 'int *'
WINSOCK_API_LINKAGE int WSAAPI send(SOCKET s,const char *buf,int len,int flags);
^~~~
Here is a patch. no more warnings after this patch. I got this idea from 86Box's slirp files,
when I compile it, there was no warnings.
Thanks to them.
Re: Networking discussion
How do you enable pcap with the merged network patch? I have the guid from ethlist but I cannot figure out how to enable pcap as default. It keeps defaulting to slirp.
Re: Networking discussion
You must install WinPcap in your Windows.jznomoney wrote:How do you enable pcap with the merged network patch? I have the guid from ethlist but I cannot figure out how to enable pcap as default. It keeps defaulting to slirp.
And you must extract WinPcap Developer's Pack in your MinGW before compile.
See this latest posts, how to build and download Pcap.
https://pcem-emulator.co.uk/phpBB3/view ... ?f=3&t=597
Re: Networking discussion
I did that. I followed your guide.
- SarahWalker
- Site Admin
- Posts: 2054
- Joined: Thu 24 Apr, 2014 4:18 pm
Re: Networking discussion
You shouldn't need ethlist anymore, the GUI in rev 823 should allow you to select the device.
Re: Networking discussion
oops I missed the added parts to the gui. Sorry for the confusion.
Re: Networking discussion
Sarah: will we have two EXEs of PCem for the upcoming release? Or just a single one with the network card?
- SarahWalker
- Site Admin
- Posts: 2054
- Joined: Thu 24 Apr, 2014 4:18 pm
Re: Networking discussion
Haven't decided yet. I'd prefer one binary if possible.
Re: Networking discussion
I'd go with the one binary too! Doesn't make sense to have a non network version!
- SarahWalker
- Site Admin
- Posts: 2054
- Joined: Thu 24 Apr, 2014 4:18 pm
Re: Networking discussion
Should now work under Linux as of rev 836. Pass --enable-networking to ./configure.
-
- Posts: 183
- Joined: Wed 18 Mar, 2015 5:27 am
Re: Networking discussion
This is great to see! Thanks to Sarah, neozeed, and everyone else who's worked on this.
Quick question: can someone very briefly summarize the relative advantages and disadvantages of slirp vs. pcap in the specific context of how they've been implemented here?
Quick question: can someone very briefly summarize the relative advantages and disadvantages of slirp vs. pcap in the specific context of how they've been implemented here?
Re: Networking discussion
While I don't know how the networking code has been implemented, the difference between the slirp and pcap concepts lies on where the communication happens.
The concept of slirp does not require a system driver, because the application is acting on behalf of the emulated system. In some sense, it works more like a transparent proxy.
-pros: no additional software needed, no additional configuration needed, good for client scenario (i.e. web browsing, connecting to other services on internet...)
-cons: it can be used on server scenario, but only by explictly making the application open the ports and listen to connections. Communication guest->host is not possible, or requires workarounds, neither between multiple guests. The IP network is separated from the host one.
The concept of pcap uses a system driver because it has to emulate an ethernet adapter. It simulates an internal ethernet network. It also offers an additional "bridged" mode, where it does not use a virtual ethernet card, but instead attaches itself to the existing card at the driver level, so it intercepts and adds network paquets directly from/into it. This way, it can act as a router at the card level.
-pros: you can have an internal network of multiple guests and host that are all on the same IP network (usually useful for non-internet access), or you can use the bridged mode, and let the guests access the internet without problems. (client and server).
-cons: it requires the installation of the driver, so you might need administration access to the machine. It needs more configuration (determine the mode that you want to use, configure IPs, select cards..). Throughput can be worse (back to Windows Vista days, the emulated card was 10Mbit! ).
Many years ago I played with colinux and pcap, and was using both pcap modes, the bridged mode for internet access (apt-get ), and the virtual adapter for host<->guest communication ( X-window , pulseaudio , filesharing ). I still have a two cards mode on a VirtualBox machine, although I no longer use the x-window scenario.
The concept of slirp does not require a system driver, because the application is acting on behalf of the emulated system. In some sense, it works more like a transparent proxy.
-pros: no additional software needed, no additional configuration needed, good for client scenario (i.e. web browsing, connecting to other services on internet...)
-cons: it can be used on server scenario, but only by explictly making the application open the ports and listen to connections. Communication guest->host is not possible, or requires workarounds, neither between multiple guests. The IP network is separated from the host one.
The concept of pcap uses a system driver because it has to emulate an ethernet adapter. It simulates an internal ethernet network. It also offers an additional "bridged" mode, where it does not use a virtual ethernet card, but instead attaches itself to the existing card at the driver level, so it intercepts and adds network paquets directly from/into it. This way, it can act as a router at the card level.
-pros: you can have an internal network of multiple guests and host that are all on the same IP network (usually useful for non-internet access), or you can use the bridged mode, and let the guests access the internet without problems. (client and server).
-cons: it requires the installation of the driver, so you might need administration access to the machine. It needs more configuration (determine the mode that you want to use, configure IPs, select cards..). Throughput can be worse (back to Windows Vista days, the emulated card was 10Mbit! ).
Many years ago I played with colinux and pcap, and was using both pcap modes, the bridged mode for internet access (apt-get ), and the virtual adapter for host<->guest communication ( X-window , pulseaudio , filesharing ). I still have a two cards mode on a VirtualBox machine, although I no longer use the x-window scenario.
Re: Networking discussion
Haven't tried PCem on Pcap yet but i know i've tried it on a DOSBox build with it about a decade ago. It allowed the card to handle IPX (this protocol not installed on the host OS) and connected to one of my old machines running a network game on ipx natively.
Re: Networking discussion
SLiRP just lets you use TCP/IP from emulated system (and even that has some limitations), so it's not really that useful with PCem (unless you want to test old web browsers). The emulated system behaves as if it was behind a NAT router, so incoming connections aren't possible, and you can't use any other networking protocol, because SLiRP simply wasn't set up to handle that (in VMWare and VirtualBox the NAT mode is analogous to SLiRP).
With pcap, PCem emulates a computer connected directly to your LAN, as if it was connected directly to the switch. This means that all protocols work (which lets you run old multiplayer games that rely on IPX/SPX), however it probably won't work if you only have a WLAN connection (this is what VMWare and VirtualBox call bridged mode).
With pcap, PCem emulates a computer connected directly to your LAN, as if it was connected directly to the switch. This means that all protocols work (which lets you run old multiplayer games that rely on IPX/SPX), however it probably won't work if you only have a WLAN connection (this is what VMWare and VirtualBox call bridged mode).
-
- Posts: 183
- Joined: Wed 18 Mar, 2015 5:27 am
Re: Networking discussion
Thanks, ender! That's exactly the kind of explanation I was looking for.