I tried hooking up the tcp-socket created by ethertap.cc with a TAP
device using :
sudo socat tcp:localhost:3500 interface:tap-gem5
and that seems to work fine (assuming I have created tap-gem5 using tunctl)
I am still not sure how to connect the EtherTap device to the
simulated machine using a Port. The function body in makeDualRoot (in
FSConfig.py) shows how to do this for an EtherLink device, but I am
not sure how to extend this for an EtherTap device. I tried adding an
element of type 'Port' to the class EtherTap and connecting that to
the ethernet intefrace of the simulated system. The code snippet I
used was :
class EtherTap(EtherObject):
type = 'EtherTap'
bufsz = Param.Int(10000, "tap buffer size")
dump = Param.EtherDump(NULL, "dump object")
port = Param.UInt16(3500, "tap port")
interface = Port("EtherTap port interface ")
in Ethernet.py followed by :
self.ethertap.interface=Parent.testsys.tsunami.ethernet.interface
in FSConfig.py
I don't think this works, and I get the following warnings :
warn: error looking up port interface on object testsys.tsunami.ethernet
warn: error casting SimObject ethertap to MemObject
warn: connectPorts: port lookup error
Anirudh
On Mon, Apr 2, 2012 at 1:05 AM, Anirudh Sivaraman <[email protected]> wrote:
>
> On Apr 2, 2012 12:36 AM, "nathan binkert" <[email protected]> wrote:
>>
>> > 1. I can't figure out where the tap device is actually created from
>> > the source of ethertap.cc. I expect to see something like
>> > "open(/dev/net/tun)" which opens a tap device.
>>
>> My memory is super fuzzy, but basically the way it worked is that
>> ethertap listened on a tcp port and the thing that connected to the
>> tun device just opened the tun device and sent the packets over the
>> tcp connection to the ethertap device. I'm pretty sure that you
>> should be able to use socat to do that job as I have no idea what
>> happened to the original code for that bit.
>
> Ok. So you use socat to connect a tcp socket with a tun interface. That
> makes sense.
>
>
>>
>> > 2. How do I actually use ethertap.cc in a simulation script ? Is there
>> > an example that runs (even if functionally incorrect) ?
>>
>> Ethernet devices have port interfaces like memory devices do. You can
>> just connect an ethertap device to an ethernet interface the way you'd
>> connect an etherlink.
>
> Ok I ll take a look at the etherlink example file and base it off that.
>
>
>> _______________________________________________
>> gem5-dev mailing list
>> [email protected]
>> http://m5sim.org/mailman/listinfo/gem5-dev
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev