--- a/src/internet/model/nsc-tcp-socket-impl.cc Thu May 19 00:57:32 2016 +0200 +++ a/src/internet/model/nsc-tcp-socket-impl.cc Thu May 19 12:16:54 2016 -0700 @@ -633,7 +633,7 @@ SocketAddressTag tag; tag.SetAddress (m_peerAddress); - p->AddPacketTag (tag); + p->ReplacePacketTag (tag); m_deliveryQueue.push (p); m_rxAvailable += p->GetSize (); --- a/src/internet/model/tcp-socket-base.cc Thu May 19 00:57:32 2016 +0200 +++ a/src/internet/model/tcp-socket-base.cc Thu May 19 12:16:54 2016 -0700 @@ -874,7 +874,7 @@ { tag.SetAddress (Inet6SocketAddress (m_endPoint6->GetPeerAddress (), m_endPoint6->GetPeerPort ())); } - outPacket->AddPacketTag (tag); + outPacket->ReplacePacketTag (tag); } return outPacket; } --- a/src/internet/model/tcp-socket.h Thu May 19 00:57:32 2016 +0200 +++ a/src/internet/model/tcp-socket.h Thu May 19 12:16:54 2016 -0700 @@ -42,6 +42,15 @@ * * This class exists solely for hosting TcpSocket attributes that can * be reused across different implementations. + * + * Socket data that is read from this socket using the methods returing + * an ns3::Packet object (i.e., Recv (), RecvMsg (), RecvFrom ()) will + * return Packet objects with a SocketAddressTag attached as a packet tag. + * The address, of underlying type InetSocketAddress, contains the address + * and port of the sender. Applications may safely remove this tag from + * the Packet. + * + * \see class SocketAddresssTag */ class TcpSocket : public Socket { --- a/src/internet/model/udp-socket-impl.cc Thu May 19 00:57:32 2016 +0200 +++ a/src/internet/model/udp-socket-impl.cc Thu May 19 12:16:54 2016 -0700 @@ -1036,7 +1036,7 @@ Address address = InetSocketAddress (header.GetSource (), port); SocketAddressTag tag; tag.SetAddress (address); - packet->AddPacketTag (tag); + packet->ReplacePacketTag (tag); m_deliveryQueue.push (packet); m_rxAvailable += packet->GetSize (); NotifyDataRecv (); @@ -1092,7 +1092,7 @@ Address address = Inet6SocketAddress (header.GetSourceAddress (), port); SocketAddressTag tag; tag.SetAddress (address); - packet->AddPacketTag (tag); + packet->ReplacePacketTag (tag); m_deliveryQueue.push (packet); m_rxAvailable += packet->GetSize (); NotifyDataRecv (); --- a/src/internet/model/udp-socket.h Thu May 19 00:57:32 2016 +0200 +++ a/src/internet/model/udp-socket.h Thu May 19 12:16:54 2016 -0700 @@ -42,6 +42,15 @@ * This class exists solely for hosting UdpSocket attributes that can * be reused across different implementations, and for declaring * UDP-specific multicast API. + * + * Socket data that is read from this socket using the methods returing + * an ns3::Packet object (i.e., Recv (), RecvMsg (), RecvFrom ()) will + * return Packet objects with a SocketAddressTag attached as a packet tag. + * The address, of underlying type InetSocketAddress, contains the address + * and port of the sender. Applications may safely remove this tag from + * the Packet. + * + * \see class SocketAddresssTag */ class UdpSocket : public Socket { --- a/src/network/utils/packet-socket.h Thu May 19 00:57:32 2016 +0200 +++ a/src/network/utils/packet-socket.h Thu May 19 12:16:54 2016 -0700 @@ -74,6 +74,24 @@ * - Accept: not allowed * * - Listen: returns -1 (OPNOTSUPP) + * + * Socket data that is read from this socket using the methods returing + * an ns3::Packet object (i.e., Recv (), RecvMsg (), RecvFrom ()) will + * return Packet objects with three PacketTag objects attached. + * Applications may wish to read the extra out-of-band data provided in + * these tags, and may safely remove the tags from the Packet. + * + * - PacketSocketTag: contains destination address (type PacketSocketAddress) + * and packet type of the received packet + * + * - SocketAddressTag: contains source address (type PacketSocketAddress) + * of the received packet + * + * - DeviceNameTag: contains the TypeId string of the relevant NetDevice + * + * \see class PacketSocketTag + * \see class SocketAddresssTag + * \see class DeviceNameTag */ class PacketSocket : public Socket {