Discussion:
Configure networking in Gem5 X86 FS
(too old to reply)
Ahmad Hassan via gem5-users
2014-06-25 09:55:44 UTC
Permalink
Hi,

I have set up eth0 interface in X86 FS mode through e1000 driver. But I
cannot SSH or ping the the host machine or any other IP or the network. I
noticed that GEM5 does not create any bridge/NAT on the host machine.

How can I configure networking in gem5 so that I can SSH from any machine
on the network or the host machine into gem5 X86 FS Ubuntu?

Thanks.

-Ahmad
Andreas Hansson via gem5-users
2014-06-25 12:58:05 UTC
Permalink
Hi Ahmad,

There is currently no such functionality in gem5, and networking is only supported within one simulator instance. At the moment you can connect two systems (as there is no ethernet switch), but on the developer list there has been discussions mentioning ongoing work to create an Ethernet switch, which would allow more systems (>2) to communicate over Ethernet.

Coming back to your original question, the tricky part with host bridging/NATing is the different time scales. The simulated system is perhaps 1.000 - 10.000x slower than the host system, and this difference in time scale confuses the TCP/IP stack(s). Also, having an external network connection will make simulations non-deterministic, which is often undesirable. All this said, if you have ideas of how to make it work, please feel free to share and discuss on the list.

Andreas

From: Ahmad Hassan via gem5-users <gem5-***@gem5.org<mailto:gem5-***@gem5.org>>
Reply-To: Ahmad Hassan <***@gmail.com<mailto:***@gmail.com>>, gem5 users mailing list <gem5-***@gem5.org<mailto:gem5-***@gem5.org>>
Date: Wednesday, 25 June 2014 04:55
To: gem5 users mailing list <gem5-***@gem5.org<mailto:gem5-***@gem5.org>>
Subject: [gem5-users] Configure networking in Gem5 X86 FS

Hi,

I have set up eth0 interface in X86 FS mode through e1000 driver. But I cannot SSH or ping the the host machine or any other IP or the network. I noticed that GEM5 does not create any bridge/NAT on the host machine.

How can I configure networking in gem5 so that I can SSH from any machine on the network or the host machine into gem5 X86 FS Ubuntu?

Thanks.

-Ahmad

-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782
马久跃 via gem5-users
2014-06-25 23:07:18 UTC
Permalink
Hi Ahmad,

you may try ethertap device + socat tool, they can connect gem5 to host machine. but you need some modify to ethertap to make it work with socat.

Jiuyue
Post by Andreas Hansson via gem5-users
Hi Ahmad,
There is currently no such functionality in gem5, and networking is only supported within one simulator instance. At the moment you can connect two systems (as there is no ethernet switch), but on the developer list there has been discussions mentioning ongoing work to create an Ethernet switch, which would allow more systems (>2) to communicate over Ethernet.
Coming back to your original question, the tricky part with host bridging/NATing is the different time scales. The simulated system is perhaps 1.000 - 10.000x slower than the host system, and this difference in time scale confuses the TCP/IP stack(s). Also, having an external network connection will make simulations non-deterministic, which is often undesirable. All this said, if you have ideas of how to make it work, please feel free to share and discuss on the list.
Andreas
Date: Wednesday, 25 June 2014 04:55
Subject: [gem5-users] Configure networking in Gem5 X86 FS
Hi,
I have set up eth0 interface in X86 FS mode through e1000 driver. But I cannot SSH or ping the the host machine or any other IP or the network. I noticed that GEM5 does not create any bridge/NAT on the host machine.
How can I configure networking in gem5 so that I can SSH from any machine on the network or the host machine into gem5 X86 FS Ubuntu?
Thanks.
-Ahmad
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Ahmad Hassan via gem5-users
2014-06-27 11:02:57 UTC
Permalink
Hi Jiuyue,

I added ethertap in FSConfig.py as self.ethertap = EtherTap(). I noticed
that it opens the port 3500 on the local host. What does EtherTap do if I
send the data on port 3500?

Shall I run socat on simulated OS or the host OS? What socket I should bind
to whom, using socat?

Thanks.
Regards,

Best Regards, Hassan

TIP HANA Cloud Computing, Systems Engineering

*SAP (UK) Limited *| The Concourse, Queen's Rd, Queen's Island, Titanic
Quarter | BT3 9DT Belfast | UK
Post by Andreas Hansson via gem5-users
Hi Ahmad,
you may try ethertap device + socat tool, they can connect gem5 to host
machine. but you need some modify to ethertap to make it work with socat.
Jiuyue
写道
Hi Ahmad,
There is currently no such functionality in gem5, and networking is only
supported within one simulator instance. At the moment you can connect two
systems (as there is no ethernet switch), but on the developer list there
has been discussions mentioning ongoing work to create an Ethernet switch,
which would allow more systems (>2) to communicate over Ethernet.
Coming back to your original question, the tricky part with host
bridging/NATing is the different time scales. The simulated system is
perhaps 1.000 - 10.000x slower than the host system, and this difference in
time scale confuses the TCP/IP stack(s). Also, having an external network
connection will make simulations non-deterministic, which is often
undesirable. All this said, if you have ideas of how to make it work,
please feel free to share and discuss on the list.
Andreas
Date: Wednesday, 25 June 2014 04:55
Subject: [gem5-users] Configure networking in Gem5 X86 FS
Hi,
I have set up eth0 interface in X86 FS mode through e1000 driver. But I
cannot SSH or ping the the host machine or any other IP or the network. I
noticed that GEM5 does not create any bridge/NAT on the host machine.
How can I configure networking in gem5 so that I can SSH from any machine
on the network or the host machine into gem5 X86 FS Ubuntu?
Thanks.
-Ahmad
-- IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended
recipient, please notify the sender immediately and do not disclose the
contents to any other person, use it for any purpose, or store or copy the
information in any medium. Thank you.
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ,
Registered in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ,
Registered in England & Wales, Company No: 2548782
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
马久跃 via gem5-users
2014-06-27 12:27:17 UTC
Permalink
Hi Ahmad,

3500 port provided by ethertap is a "virtual ethernet tunnel" (google TAP/TUN), you can send/recv ethernet packet to/from gem5.

socat can bind this port to a virtual ethernet device on host os.

you need to do followings to make this work:
1) connect Ethernet device to ethertap.tap port using EtherLink, maybe you have to add "tap" port to py file yourself (see getSlavePort() in ethertap.cc)
2) run socat on host os, bind localhost:3500 to tap device (I forgot the parameter, you may google it), this will create a virtual ethernet device "tapX" at host os, you can config ip to it as other ethernet device
3) you also need some modify to send/recv in ethertap cxx source, current impl send data using a loop which cause checksum failed and packet dropped at host kernel. I'll post this patch next week.

Jiuyue
Post by Ahmad Hassan via gem5-users
Hi Jiuyue,
I added ethertap in FSConfig.py as self.ethertap = EtherTap(). I noticed that it opens the port 3500 on the local host. What does EtherTap do if I send the data on port 3500?
Shall I run socat on simulated OS or the host OS? What socket I should bind to whom, using socat?
Thanks.
Regards,
Best Regards, Hassan
TIP HANA Cloud Computing, Systems Engineering
SAP (UK) Limited | The Concourse, Queen's Rd, Queen's Island, Titanic Quarter | BT3 9DT Belfast | UK
Post by Andreas Hansson via gem5-users
Hi Ahmad,
you may try ethertap device + socat tool, they can connect gem5 to host machine. but you need some modify to ethertap to make it work with socat.
Jiuyue
Post by Andreas Hansson via gem5-users
Hi Ahmad,
There is currently no such functionality in gem5, and networking is only supported within one simulator instance. At the moment you can connect two systems (as there is no ethernet switch), but on the developer list there has been discussions mentioning ongoing work to create an Ethernet switch, which would allow more systems (>2) to communicate over Ethernet.
Coming back to your original question, the tricky part with host bridging/NATing is the different time scales. The simulated system is perhaps 1.000 - 10.000x slower than the host system, and this difference in time scale confuses the TCP/IP stack(s). Also, having an external network connection will make simulations non-deterministic, which is often undesirable. All this said, if you have ideas of how to make it work, please feel free to share and discuss on the list.
Andreas
Date: Wednesday, 25 June 2014 04:55
Subject: [gem5-users] Configure networking in Gem5 X86 FS
Hi,
I have set up eth0 interface in X86 FS mode through e1000 driver. But I cannot SSH or ping the the host machine or any other IP or the network. I noticed that GEM5 does not create any bridge/NAT on the host machine.
How can I configure networking in gem5 so that I can SSH from any machine on the network or the host machine into gem5 X86 FS Ubuntu?
Thanks.
-Ahmad
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Ahmad Hassan via gem5-users
2014-06-27 13:19:38 UTC
Permalink
Hi Jiuyue,

I have a use case where my benchmark opens a sockets in simulated OS inside
gem5 on port 8080. Now I want to send data to this 8080 port from outside
gem5 (from host OS). I have done the following:

I added a serial port com_2. Now I see that port 3456 is opened for com_1
and 3457 for com_2. Then I send data from host OS to gem5 com_2 using port
3457. The log message shows that gem5 receives this data. Inside gem5 then
I bind com_2 to port 8080 using the following commands but com_2 doesn't
forward anything to port 8080:

mknod /dev/ttyS1 c 4 65
socat /dev/ttyS1,raw,echo=0,crnl tcp4-connect:localhost:8080 << binds
successfully

Is this approach wrong?

Regards,
Post by Andreas Hansson via gem5-users
Hi Ahmad,
3500 port provided by ethertap is a "virtual ethernet tunnel" (google
TAP/TUN), you can send/recv ethernet packet to/from gem5.
socat can bind this port to a virtual ethernet device on host os.
1) connect Ethernet device to ethertap.tap port using EtherLink, maybe you
have to add "tap" port to py file yourself (see getSlavePort() in
ethertap.cc)
2) run socat on host os, bind localhost:3500 to tap device (I forgot the
parameter, you may google it), this will create a virtual ethernet device
"tapX" at host os, you can config ip to it as other ethernet device
3) you also need some modify to send/recv in ethertap cxx source, current
impl send data using a loop which cause checksum failed and packet dropped
at host kernel. I'll post this patch next week.
Jiuyue
Hi Jiuyue,
I added ethertap in FSConfig.py as self.ethertap = EtherTap(). I noticed
that it opens the port 3500 on the local host. What does EtherTap do if I
send the data on port 3500?
Shall I run socat on simulated OS or the host OS? What socket I should
bind to whom, using socat?
Thanks.
Regards,
Best Regards, Hassan
TIP HANA Cloud Computing, Systems Engineering
*SAP (UK) Limited *| The Concourse, Queen's Rd, Queen's Island,
Titanic Quarter | BT3 9DT Belfast | UK
Post by Andreas Hansson via gem5-users
Hi Ahmad,
you may try ethertap device + socat tool, they can connect gem5 to host
machine. but you need some modify to ethertap to make it work with socat.
Jiuyue
写道
Hi Ahmad,
There is currently no such functionality in gem5, and networking is
only supported within one simulator instance. At the moment you can connect
two systems (as there is no ethernet switch), but on the developer list
there has been discussions mentioning ongoing work to create an Ethernet
switch, which would allow more systems (>2) to communicate over Ethernet.
Coming back to your original question, the tricky part with host
bridging/NATing is the different time scales. The simulated system is
perhaps 1.000 - 10.000x slower than the host system, and this difference in
time scale confuses the TCP/IP stack(s). Also, having an external network
connection will make simulations non-deterministic, which is often
undesirable. All this said, if you have ideas of how to make it work,
please feel free to share and discuss on the list.
Andreas
Date: Wednesday, 25 June 2014 04:55
Subject: [gem5-users] Configure networking in Gem5 X86 FS
Hi,
I have set up eth0 interface in X86 FS mode through e1000 driver. But I
cannot SSH or ping the the host machine or any other IP or the network. I
noticed that GEM5 does not create any bridge/NAT on the host machine.
How can I configure networking in gem5 so that I can SSH from any
machine on the network or the host machine into gem5 X86 FS Ubuntu?
Thanks.
-Ahmad
-- IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended
recipient, please notify the sender immediately and do not disclose the
contents to any other person, use it for any purpose, or store or copy the
information in any medium. Thank you.
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ,
Registered in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ,
Registered in England & Wales, Company No: 2548782
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
马久跃 via gem5-users
2014-06-27 13:58:55 UTC
Permalink
This post might be inappropriate. Click to display it.
Antonis Nikitakis
2015-06-11 11:22:59 UTC
Permalink
Hello,

replying to this thread:
http://www.mail-archive.com/gem5-users%40gem5.org/msg10189.html

/Hi Ahmad,/

/3500 port provided by ethertap is a "virtual ethernet tunnel"
(google TAP/TUN), /
/you can send/recv ethernet packet to/from gem5./

/socat can bind this port to a virtual ethernet device on host os./

/you need to do followings to make this work:/
/1) connect Ethernet device to ethertap.tap port using EtherLink,
maybe you have /
/to add "tap" port to py file yourself (see getSlavePort() in
ethertap.cc)/
/2) run socat on host os, bind localhost:3500 to tap device (I
forgot the /
/parameter, you may google it), this will create a virtual ethernet
device /
/"tapX" at host os, you can config ip to it as other ethernet device/
/3) you also need some modify to send/recv in ethertap cxx source,
current impl /
/send data using a loop which cause checksum failed and packet
dropped at host /
/kernel. I'll post this patch next week./

/Jiuyue/


Could you please send the steps of the above procedure in more detail?
Thank you in advance,
Antonis
--
---------------------------------------------------------------------
Antonis Nikitakis

Post-doc Research Associate
Technical University of Crete, Greece
Electronic and Computer Engineering Department (ECE) (www.ece.tuc.gr)
MHL Laboratory (www.mhl.tuc.gr)

---------------------------------------------------------------------
Info:
CV:http://users.isc.tuc.gr/~anikitakis/
Linkedin:http://gr.linkedin.com/pub/antonis-nikitakis/20/441/625/
FB:facebook.com/anikitakis
---------------------------------------------------------------------
Loading...