ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

determine topic established port number for transport control

asked 2012-01-05 07:35:31 -0600

Jason LaPenta gravatar image

updated 2014-01-28 17:11:04 -0600

ngrennan gravatar image

Hello,

I would like to use transport control, tc, to prioritize data on certain topic connections. How do I determine the port number for the topic connection between two nodes on different computers? rostopic info and rosnode info do not appear to give me this information.

For example, this test shows connections between two nodes, ladybug_server and ladybug_viewer. The viewer is located on the "terminal" computer and the server is located on "robot" computer. The terminal and server computers are connected via wifi. In the below example the terminal is 10.42.43.237.

the topics:

username@terminal:~/tc_test$ rostopic list
/joy_tablet
/ladybug_server/config
/ladybug_server/frame_ack
/ladybug_server/info
/ladybug_server/realtime_video
/ladybug_server/rsync_done
/ladybug_server/snapshot_request
/ladybug_server/snapshot_taken
/map_pose_updater/pose_announce
/rosout
/rosout_agg

for example, trying to find the realtime video port

username@robot:~$ rostopic info /ladybug_server/realtime_video
Type: ladybug/ladybugRealtimeVideo

Publishers: 
 * /ladybug_server (http://robot:59560/)

Subscribers: 
 * /ladybug_viewer (http://10.42.43.237:49643/)

Now trying to determine the established connections:

username@terminal:~/tc_test$ sudo netstat -anp | grep ladybug
tcp        0      0 0.0.0.0:35060           0.0.0.0:*               LISTEN      14359/ladybug_viewe
tcp        0      0 0.0.0.0:49643           0.0.0.0:*               LISTEN      14359/ladybug_viewe
tcp        0      0 10.42.43.237:35060      10.42.43.1:50960        ESTABLISHED 14359/ladybug_viewe
tcp        0      0 10.42.43.237:35060      10.42.43.1:50957        ESTABLISHED 14359/ladybug_viewe
tcp        0      0 10.42.43.237:40618      10.42.43.1:49016        ESTABLISHED 14359/ladybug_viewe
tcp        0      0 10.42.43.237:35060      10.42.43.1:50959        ESTABLISHED 14359/ladybug_viewe
tcp        0      0 10.42.43.237:37043      10.42.43.1:11311        CLOSE_WAIT  14359/ladybug_viewe
tcp        0      0 10.42.43.237:35060      10.42.43.1:50961        ESTABLISHED 14359/ladybug_viewe
udp        0      0 0.0.0.0:49045           0.0.0.0:*                           14359/ladybug_viewe
unix  3      [ ]         STREAM     CONNECTED     102562   14359/ladybug_viewe 


username@robot:~$ sudo netstat -anp | grep ladybug_ser
tcp        0      0 0.0.0.0:49016           0.0.0.0:*               LISTEN      12220/ladybug_serve
tcp        0      0 0.0.0.0:59560           0.0.0.0:*               LISTEN      12220/ladybug_serve
tcp        0      0 10.42.43.1:50959        10.42.43.237:35060      ESTABLISHED 12220/ladybug_serve
tcp        0      0 127.0.0.1:49016         127.0.0.1:38779         ESTABLISHED 12220/ladybug_serve
tcp        0      0 10.42.43.1:50960        10.42.43.237:35060      ESTABLISHED 12220/ladybug_serve
tcp        0      0 10.42.43.1:49016        10.42.43.237:40618      ESTABLISHED 12220/ladybug_serve
tcp        1      0 10.42.43.1:53324        10.42.43.1:11311        CLOSE_WAIT  12220/ladybug_serve
tcp        0      0 10.42.43.1:50961        10.42.43.237:35060      ESTABLISHED 12220/ladybug_serve
udp        0      0 0.0.0.0:40540           0.0.0.0:*                           12220/ladybug_serve

The question is, which one of these ports is the connected realtime_video topic between the server and terminal? By monitoring the netstat output queued data for a while I can "guess" that the realtime video port is 49016/40618 because ... (more)

edit retag flag offensive close merge delete

Comments

may I know how you are getting the images from the ladybug in the first place? I have a ladybug3 that I'd like to setup.

brice rebsamen gravatar image brice rebsamen  ( 2013-07-09 11:09:56 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-01-05 11:28:44 -0600

ahendrix gravatar image

The port numbers for publishers and subscribers are determined dynamically at runtime; settings up rules to prioritize this traffic will be tricky.

Note that rosnode info on the subscribing node shows the port and IP that it's connected to; in your case a rosnode info ladybug_viewer should give you the port number.

If you're trying to improve the performance of a video stream, have you looked at the image_transport_plugins stack?

If you're dead-set on setting up rules, I recommend that you do so dynamically. You'll probably have to use the Master API to make XML-RPC calls to the ROS master to determine the publisher URI.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-01-05 07:35:31 -0600

Seen: 2,843 times

Last updated: Jan 05 '12