Skip to contentSkip to conversation

Connecting UML_SWITCH and Wireshark

uml-devel Julien Iguchi-Cartigny 4 participants 8 messages Sep 1, 2008 – Sep 4, 2008 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

Hello,

(seems a developper question, apologies if it's more a user (moron) question)

I'm using Netkit (www.netkit.org): it's a network simulator using UML and I want to show packets exchanged between the UML machines. I believe the best way is to

- use wireshark with the flag "-" to capture packets in the standard input.
- use netcat to read the data socket of uml_switch and print to the standard output

But uml_switch uses a ctl socket to open new port. I need a way to manually open a port by uml_switch to connect netcat. I don't think uml_switch offer command-line instruction for this, so is the best way to write a short program writing on the ctl socket of uml_switch ? If yes, what data to send to uml_switch ?

Cheers,

Julien.

Signature · 1 line
Trouble-a-cat Limited

begin:vcard
fn:Julien Iguchi-Cartigny
n:Iguchi-Cartigny;Julien org;quoted-printable;quoted-printable:Universit=C3=A9 de Limoges;D=C3=A9partement DMI adr;quoted-printable:83, rue d'Isle;;Site Jid=C3=A9;Limoges;;87000;France email;internet:[email protected]
title:Assistant Professor
tel;work:+33555436930
tel;cell:+33681606483
x-mozilla-html:FALSE
url:http://msi.unilim.fr/~cartigny/
version:2.1
end:vcard

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw

Hello
I made another network simulator (clownix.net) and I just run wireshark inside the uml machines, I do not see why you have troubles to see ip frames.

Le lundi 01 septembre 2008 à 17:44 +0200, Julien Iguchi-Cartigny a écrit :

Quoted 24 lines

Hello,

(seems a developper question, apologies if it's more a user (moron) question)

I'm using Netkit (www.netkit.org): it's a network simulator using UML and I want to show packets exchanged between the UML machines. I believe the best way is to

- use wireshark with the flag "-" to capture packets in the standard input.
- use netcat to read the data socket of uml_switch and print to the standard output

But uml_switch uses a ctl socket to open new port. I need a way to manually open a port by uml_switch to connect netcat. I don't think uml_switch offer command-line instruction for this, so is the best way to write a short program writing on the ctl socket of uml_switch ? If yes, what data to send to uml_switch ?

Cheers,

Julien.

Quoted 6 lines

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#2 lore raw

Hello Vincent,

Netkit doesn't support X, and I don't want it anyway, as the user has already several terminals on his screen (one by UML machine).

I want Wireshark to be running on the host computer, and I don't want to use the TAP solution (students using the simulator don't have root access).

So, the only way is to connect wireshark on uml_switch (how ?).

Cheers,

Julien.

Quoted 41 lines · vincent-perrier

Hello
I made another network simulator (clownix.net) and I just run wireshark inside the uml machines, I do not see why you have troubles to see ip frames.

Le lundi 01 septembre 2008 à 17:44 +0200, Julien Iguchi-Cartigny a écrit :

Quoted 30 lines

Hello,

(seems a developper question, apologies if it's more a user (moron) question)

I'm using Netkit (www.netkit.org): it's a network simulator using UML and I want to show packets exchanged between the UML machines. I believe the best way is to

- use wireshark with the flag "-" to capture packets in the standard input.
- use netcat to read the data socket of uml_switch and print to the standard output

But uml_switch uses a ctl socket to open new port. I need a way to manually open a port by uml_switch to connect netcat. I don't think uml_switch offer command-line instruction for this, so is the best way to write a short program writing on the ctl socket of uml_switch ? If yes, what data to send to uml_switch ?

Cheers,

Julien.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Signature · 1 line
Trouble-a-cat Limited

begin:vcard
fn:Julien Iguchi-Cartigny
n:Iguchi-Cartigny;Julien org;quoted-printable;quoted-printable:Universit=C3=A9 de Limoges;D=C3=A9partement DMI adr;quoted-printable:83, rue d'Isle;;Site Jid=C3=A9;Limoges;;87000;France email;internet:[email protected]
title:Assistant Professor
tel;work:+33555436930
tel;cell:+33681606483
x-mozilla-html:FALSE
url:http://msi.unilim.fr/~cartigny/
version:2.1
end:vcard

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#3 lore raw

On Tue, Sep 02, 2008 at 10:39 AM, Julien Iguchi-Cartigny wrote:

Hi Julien,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

- use wireshark with the flag "-" to capture packets in the standard input.
- use netcat to read the data socket of uml_switch and print to the standard output

On wireshark(1) they say this works only if you have a libpcap format on wireshark's STDIN, but in this way you'll have pure ethernet frames.

Does Netkit support uml's vde network?
If it does then you can use the 'pdump' plugin in vde_switch which dumps all the traffic in pcap format.

Here you can find an example of pdump usage:
http://qemu-forum.ipi.fi/viewtopic.php?f=2&p=13488#p13488

HTH

luca

Signature · 14 lines
Beware of programmers who carry screwdrivers.
                        -- Leonard Brandwein

http://shammash.homelinux.org/ - http://www.artha.org/ - http://www.yue.it/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#4 lore raw

Hello Luca,

Quoted 2 lines

On wireshark(1) they say this works only if you have a libpcap format on wireshark's STDIN, but in this way you'll have pure ethernet frames.

Damn it ! I didn't think of this problem.

Quoted 3 lines

Does Netkit support uml's vde network?
If it does then you can use the 'pdump' plugin in vde_switch which dumps all the traffic in pcap format.

I don't think so (I didn't see reference to vde_switch in netkit distribution).

One idea is to do the same think: use pdump on uml_switch (vde_switch seems close to uml_switch, right ?).

An other idea could be to extend uml_switch to dump traffic on standard output in cap format. Don't seem too difficult (include libcap is needed, and some code of course).

The only problem is how to connect the standard input of wireshark and the standard output of this "new" uml_switch; netcat is an interesting "brut hack" to do this (not really "elegant") but maybe some people have a better solution ????

Cheers,

Julien.

Quoted 8 lines

Here you can find an example of pdump usage:
http://qemu-forum.ipi.fi/viewtopic.php?f=2&p=13488#p13488

HTH

luca

Signature · 1 line
Trouble-a-cat Limited

begin:vcard
fn:Julien Iguchi-Cartigny
n:Iguchi-Cartigny;Julien org;quoted-printable;quoted-printable:Universit=C3=A9 de Limoges;D=C3=A9partement DMI adr;quoted-printable:83, rue d'Isle;;Site Jid=C3=A9;Limoges;;87000;France email;internet:[email protected]
title:Assistant Professor
tel;work:+33555436930
tel;cell:+33681606483
x-mozilla-html:FALSE
url:http://msi.unilim.fr/~cartigny/
version:2.1
end:vcard

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#5 lore raw
In reply to Julien Iguchi-Cartigny

Hello Julien
I find Xorg/gtk very very usefull! even if I too work only in terminals with command-line interfaces.
As I plan to have sip softphones in my next uml machines, I have to have all the necessary gui (including a java machine). But if you really want to spy ip packets without gtk, use tshark, it is also a fantastic piece of software.
Cheers
Vincent Perrier

Le mardi 02 septembre 2008 à 10:39 +0200, Julien Iguchi-Cartigny a écrit :

Quoted 8 lines

Hello Vincent,

Netkit doesn't support X, and I don't want it anyway, as the user has already several terminals on his screen (one by UML machine).

I want Wireshark to be running on the host computer, and I don't want to use the TAP solution (students using the simulator don't have root access).

Quoted 50 lines

So, the only way is to connect wireshark on uml_switch (how ?).

Cheers,

Julien.

Quoted 41 lines · vincent-perrier

Hello
I made another network simulator (clownix.net) and I just run wireshark inside the uml machines, I do not see why you have troubles to see ip frames.

Le lundi 01 septembre 2008 à 17:44 +0200, Julien Iguchi-Cartigny a écrit :

Quoted 30 lines

Hello,

(seems a developper question, apologies if it's more a user (moron) question)

I'm using Netkit (www.netkit.org): it's a network simulator using UML and I want to show packets exchanged between the UML machines. I believe the best way is to

- use wireshark with the flag "-" to capture packets in the standard input.
- use netcat to read the data socket of uml_switch and print to the standard output

But uml_switch uses a ctl socket to open new port. I need a way to manually open a port by uml_switch to connect netcat. I don't think uml_switch offer command-line instruction for this, so is the best way to write a short program writing on the ctl socket of uml_switch ? If yes, what data to send to uml_switch ?

Cheers,

Julien.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#6 lore raw
In reply to Julien Iguchi-Cartigny
Quoted 8 lines · Julien Iguchi-Cartigny

I'm using Netkit (www.netkit.org): it's a network simulator using UML and I want to show packets exchanged between the UML machines. I believe the best way is to

- use wireshark with the flag "-" to capture packets in the standard input.
- use netcat to read the data socket of uml_switch and print to the standard output

Quoted 5 lines

But uml_switch uses a ctl socket to open new port. I need a way to manually open a port by uml_switch to connect netcat. I don't think uml_switch offer command-line instruction for this, so is the best way to write a short program writing on the ctl socket of uml_switch ? If yes, what data to send to uml_switch ?

If you want to capture UML network traffic going over uml_switch (be it with wireshark or tcpdump - it doesn't matter), there are two basic ways of doing it:
enable hub mode (uml_switch -hub) and then either

sniff from a UML's eth0 (a third UML if you don't want to
interfere with the communicating UMLs), or
add a host tap device to the switch (uml_switch -tap tap<n>)
and sniff that.

Jeff

Signature · 11 lines
Work email - jdike at linux dot intel dot com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#7 lore raw

Hello Jeff,

Both solutions don't satisfy my needs.

- My UML machines run only in terminal mode (no X)
- I don't want to use mechanisms which require root rights.

I've investigated the code of uml_switch and I think a slight modification can offer a user-level sniff for UML: add a new request type (uml_switch.c) and create a simple program which connect to the uml_switch and just dump (in raw or libpcap format) in standard input the traffic.

I don't think it requires a lot of works...

Julien.

Quoted 27 lines · Jeff Dike
Quoted 8 lines · Julien Iguchi-Cartigny

I'm using Netkit (www.netkit.org): it's a network simulator using UML and I want to show packets exchanged between the UML machines. I believe the best way is to

- use wireshark with the flag "-" to capture packets in the standard input.
- use netcat to read the data socket of uml_switch and print to the standard output

Quoted 5 lines

But uml_switch uses a ctl socket to open new port. I need a way to manually open a port by uml_switch to connect netcat. I don't think uml_switch offer command-line instruction for this, so is the best way to write a short program writing on the ctl socket of uml_switch ? If yes, what data to send to uml_switch ?

If you want to capture UML network traffic going over uml_switch (be it with wireshark or tcpdump - it doesn't matter), there are two basic ways of doing it:
enable hub mode (uml_switch -hub) and then either

sniff from a UML's eth0 (a third UML if you don't want to
interfere with the communicating UMLs), or
add a host tap device to the switch (uml_switch -tap tap<n>)
and sniff that.

Jeff

Signature · 1 line
Trouble-a-cat Limited

begin:vcard
fn:Julien Iguchi-Cartigny
n:Iguchi-Cartigny;Julien org;quoted-printable;quoted-printable:Universit=C3=A9 de Limoges;D=C3=A9partement DMI adr;quoted-printable:83, rue d'Isle;;Site Jid=C3=A9;Limoges;;87000;France email;internet:[email protected]
title:Assistant Professor
tel;work:+33555436930
tel;cell:+33681606483
x-mozilla-html:FALSE
url:http://msi.unilim.fr/~cartigny/
version:2.1
end:vcard

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel