This tutorial demonstrates how to access connection header information
in rospy. 

For topics, the connection header information allows a Subscriber to
determine who the message was published by. There are also additional
fields in the connection header that contain runtime type information
for the topic. listener_connection_header.py shows how to access
this information from a Message. You can run a demo of it in action
by running:

roslaunch connection_header.launch

Connection headers have additional functionality as a Service client
can pass in additional metadata when creating a rospy.ServiceProxy
object. This functionality is somewhat similar to HTTP in that you can
use it to implement sessions or otherwise provide additional metadata
with a service call.

server_connection_header.py and client_connection_header.py contain
variants on the add_two_ints demos that show how this information
can be used. In order to run this demo you must run three commands:

roscore
rosrun rospy_tutorials server_connection_header.py
rosrun rospy_tutorials client_connection_header.py