English Amiga Board Amiga Lore


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 22 June 2013, 17:08   #1
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,559
slirp network emulation backend

slirp user mode networking is now merged (from Basilisk II, qemu version is too qemu specific)

http://www.winuae.net/files/b/winuae.zip (pre-beta, if interested of testing)

- It is sort of emulated NAT, only connections from emulated environment to servers work. (inbound won't work).
- ICMP won't work. (ping does nothing)
- Does not require admin privileges or installation of drivers.
- If not using DHCP, IP must be set to 10.0.2.15, gateway 10.0.2.2, dns 10.0.2.3, mask 255.255.255.0. (DHCP gives exact same addresses). These IP addresses are virtual, they don't exist outside of emulation.
- Supported by A2065 and uaenet emulations.
- Uses winsocket API = does not cause mysterious packet losses due to security software.

It takes raw ethernet frame from emulated network hardware, parses it, re-creates identical enough network calls using host's standard socket API and returns back raw ethernet frames. (Lots of emulations here, emulated Amiga runs network stack that creates ethernet frames, ethernet frames are parsed by slirp, host creates ethernet frames again)

Check for example qemu documentation for more details.

Logging: -slirplog x (x=1 to 7)

Last edited by Toni Wilen; 23 June 2013 at 16:08.
Toni Wilen is online now  
AdSense AdSense  
Old 22 June 2013, 18:03   #2
Leandro Jardim
Registered User
Leandro Jardim's Avatar
 
Join Date: Nov 2009
Location: Legoland
Age: 38
Posts: 1,147
Quote:
Originally Posted by Toni Wilen View Post
... It takes raw ethernet frame from emulated network hardware, parses it, re-creates identical enough network calls using host's standard socket API and returns back raw ethernet frames. (Lots of emulations here, emulated Amiga runs network stack that creates ethernet frames, ethernet frames are parsed by slirp, host creates ethernet frames again)] ...
Fantastic, Toni! More emulation is always best! I will wait for this and for the graphics board emulation that you promised (another fantastic thing).

You are the man!

Last edited by Leandro Jardim; 22 June 2013 at 18:36.
Leandro Jardim is offline  
Old 23 June 2013, 15:01   #3
amiga_1
 
Posts: n/a
@Toni:

Can you make it use Windows "hosts" file ??
 
Old 23 June 2013, 16:07   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,559
Quote:
Originally Posted by amiga_1 View Post
Can you make it use Windows "hosts" file ??
For what? Amiga-side DNS queries still use it normally.
Toni Wilen is online now  
Old 23 June 2013, 17:14   #5
amiga_1
 
Posts: n/a
Quote:
Originally Posted by Toni Wilen View Post
For what? Amiga-side DNS queries still use it normally.

I have "blocked" some sites (re-directing them to 127.0.0.0) on Windows-side, and I don't want them to be accessed under Amiga-side.

I went online with Miami Deluxe, and the "blocked" sites are accessed, thus the Windows hosts file is bypassed, it seems!
 
Old 23 June 2013, 18:52   #6
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,559
I thought it used normal DNS API but it "only" (after ethernet frame has been parsed) checks if TCP or UDP is going to 10.0.2.3 (DNS IP), it gets redirected to your real DNS server.

Sorry, I am not going to touch slirp code. (except to get it to compile with MSVC)
Toni Wilen is online now  
Old 23 June 2013, 18:57   #7
amiga_1
 
Posts: n/a
Quote:
Originally Posted by Toni Wilen View Post
I thought it used normal DNS API but it "only" (after ethernet frame has been parsed) checks if TCP or UDP is going to 10.0.2.3 (DNS IP), it gets redirected to your real DNS server.

Sorry, I am not going to touch slirp code. (except to get it to compile with MSVC)

Ok, can you at least making it work with Admin privileges ONLY ?
 
Old 23 June 2013, 19:01   #8
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,559
Quote:
Originally Posted by amiga_1 View Post
Ok, can you at least making it work with Admin privileges ONLY ?
Of course not. Thats the whole point of slirp!

EDIT: Block them using some firewall because using hosts "blocking" won't block if someone wants to use IP address directly.

Last edited by Toni Wilen; 23 June 2013 at 19:19.
Toni Wilen is online now  
Old 25 January 2014, 17:21   #9
Noth
Registered User
Noth's Avatar
 
Join Date: Aug 2013
Location: Lausanne, Switzerland
Posts: 152
Hi Toni, is their a way to open a port on the host to forward a connection (typically the telnet port 23/tcp) to the guest system in WinUAE? It'd be nice to access AMIX and friends via a not so braindead console... (AMIX's virtual consoles don't allow the cursor to move back and forth or check the history of the commands...).
Noth is offline  
Old 25 January 2014, 17:36   #10
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,559
You need to use winpcap method. SLIRP is outbound only, method used by SLIRP can't work for inbound connections.
Toni Wilen is online now  
Old 25 January 2014, 19:22   #11
Noth
Registered User
Noth's Avatar
 
Join Date: Aug 2013
Location: Lausanne, Switzerland
Posts: 152
Quote:
Originally Posted by Toni Wilen View Post
You need to use winpcap method. SLIRP is outbound only, method used by SLIRP can't work for inbound connections.
Which is unlikely to work for those of us using WINE I suppose... Oh well, doesn't matter. Thanks for the answer.

Last edited by prowler; 25 January 2014 at 21:20. Reason: Rewind.
Noth is offline  
Old 25 January 2014, 19:22   #12
Noth
Registered User
Noth's Avatar
 
Join Date: Aug 2013
Location: Lausanne, Switzerland
Posts: 152
Quote:
Originally Posted by Toni Wilen View Post
You need to use winpcap method. SLIRP is outbound only, method used by SLIRP can't work for inbound connections.
SLiRP is meant to be able to do portforwarding... neozeed mentions it all over his blog. Could it be added in a later release of WinUAE if the code is available?
Noth is offline  
Old 25 January 2014, 19:28   #13
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,559
Quote:
Originally Posted by Noth View Post
Which is unlikely to work for those of us using WINE I suppose... Oh well, doesn't matter. Thanks for the answer.
Yeah, it needs Windows driver.

What about serial port console?
Toni Wilen is online now  
Old 20 February 2014, 17:16   #14
Noth
Registered User
Noth's Avatar
 
Join Date: Aug 2013
Location: Lausanne, Switzerland
Posts: 152
Tried the serial port console but no matter what I can't get a login prompt. Can't we have a port forwarded in SLiRP to be able to telnet in? it would be so much easier...
Noth is offline  
Old 21 February 2014, 15:25   #15
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,559
SLIRP is not done by me and it is designed to be NAT only. I am not sure if it can be made to listen for incoming connections without major changes.
Toni Wilen is online now  
Old 21 February 2014, 20:52   #16
Noth
Registered User
Noth's Avatar
 
Join Date: Aug 2013
Location: Lausanne, Switzerland
Posts: 152
Paging Neozeed!
Noth is offline  
Old 24 February 2014, 05:41   #17
neozeed
Registered User
 
Join Date: Jan 2013
Location: Hong Kong, SAR
Posts: 28
hey sorry for going dark life took a major turn...

I saw the slirp and was really excited, although for some reason I've been having issues with it.. I'll get to that later.

Doing inbound TCP connections is really simple with the slirp network library.

It's a one liner too!

struct in_addr guest_addr;
inet_aton("10.0.2.15",&guest_addr);


slirp_redir(0,42323,guest_addr,23);

This would take TCP port 42323 on the host machine, and redirect it to port 23.

I'm going to re-install and see if I can come back with something more meangful about slirp, but I was able to ping 10.0.2.2 in the VM just fine, and when I try to connect to my BBS, it "works" but nothing is displayed on the amiga side... oddly enough watching me on the bbs, it worked fine..... I did try AmiTCP 2,3 and the 4.0 ... AmigaDOS 2.1...

But like I said I need to re-install fresh and see what I can do for a bug report.


-- edit

well it seems slirp works better with OS 3.1 & AmiTCP 4 ... Oh well, I can now use telser so I'm happy!

Last edited by neozeed; 24 February 2014 at 08:43.
neozeed is offline  
Old 24 February 2014, 11:02   #18
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,559
Quote:
Originally Posted by neozeed View Post
slirp_redir(0,42323,guest_addr,23);
If it really is that simple, how should it be implemented in WinUAE? Automatically add some common standard ports? Custom ports can be added via config file but basic ports should have simple on/off checkbox.

21, 22, 23, 80, 443? Anything else? Should there be some number added to host side port? (for example 80 becomes 8000 + 80 = 8080), low (<1024) ports may not be available and may require higher privileges.
Toni Wilen is online now  
Old 24 February 2014, 13:37   #19
neozeed
Registered User
 
Join Date: Jan 2013
Location: Hong Kong, SAR
Posts: 28
Quote:
Originally Posted by Toni Wilen View Post
If it really is that simple, how should it be implemented in WinUAE? Automatically add some common standard ports? Custom ports can be added via config file but basic ports should have simple on/off checkbox.

21, 22, 23, 80, 443? Anything else? Should there be some number added to host side port? (for example 80 becomes 8000 + 80 = 8080), low (<1024) ports may not be available and may require higher privileges.
On Qemu it was some fun syntax of -redir protocolort:hostort which could be repeated over and over again... I cheated on the SIMH Vax/PDP thing by just hardcoding some high ports to 23/80 as that was all I was interested in.. I suppose if you add in a listbox that lets people to add in a few things that'd be nice... the problem with picking arbitrary ports for people is that you can't run more than one instance of winuae... or what if I want to run an amiga email server (Im sure one exists somewhere) and I want port 25, not port 23.. etc etc......

I know you can issue multiple slirp_redir's... so I guess the other thing to do is maybe only allow for one or two port redirections..? Although yeah high ports are better as not everyone is an administrator on their computer.

I don't know why AmiTCP 2.2 & 3.02b has such a hard time teletting, but I'm glad I found a version of 4 that works!
neozeed is offline  
Old 24 February 2014, 17:49   #20
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,559
slirp_redir command line option added, not fully tested, I didn't have any good test cases but at least host-side socket gets opened. Multiple entries support.

slirp_redir=proto:host port:internal port:internal ip (for example slirp_redir=tcp:10023:23:10.0.2.15 for telnet)

http://www.winuae.net/files/b/winuae.zip

btw, at least slirp version used in winuae has annoying problem, it does not have any routine to release all currently open sockets and free all other resources. (Which would be really useful when emulated system gets reset.)

GUI won't have any port selections, "common ports on/off" checkbox is the only solution I am bothered to implement in GUI. Everything else: manual config file.
Toni Wilen is online now  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
SLiRP (user mode nat) neozeed request.UAE Wishlist 9 21 June 2013 16:38
Network cards JackTheKnife support.Hardware 4 08 December 2009 20:24
Network PC icewizard2k5 support.Apps 5 07 March 2005 00:49
Network Cards [Mr_L] support.Hardware 2 07 January 2004 16:28
Need help for A1200 network Djay support.Hardware 12 03 September 2002 07:10

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:50.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.37918 seconds with 12 queries