[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Packet size problem/question



On Sat, 13 Mar 1999 17:52:20 EST, Smitty wrote: 
>Okay, here's the deal, hopefully someone can help me. I've read the notes
>and Docs, and the tutorial, and scanned the archive.
>
>I am trying to get a new agent implemented that sends a packet to another
>node, and this other node looks at it and sends an acknowledgement bck.
>Both nodes are running the same agent, so I have a recv that checks if it
>should be an acknowledged packet or not. Upon seeing that ti should ack
>the packet, it does a Packet *pktret = allocpkt();. The agent who then
>sends this packet shows that the hdr_cmn->size_ of this packet is
>correctly 0, i.e., only the header is necessary? Or should that be
>including the size of the header? But at any rate, the agent who receives
>this packet sees it's size as the size of the packet that generated the
>ack, not as 0 or whatever it should be.
>
>Any help would be appreciated, especially if this stems from some gross
>misunderstanding of how ns uses packets/agents. Thanks.

NN&D in the subsection "The hdr\_cmn Class" says:

	The \code{size_} field is of general use and gives the
	simulated packet's size.
	Note that the actual number of bytes consumed in the simulation
	may not relate to the value of this field.
	Rather, it is used most often in computing the time required for a packet
	to be delivered along a network link.

I've added a little to this to clarify the questions you raise:

	The \code{size_} field is of general use and gives the
	simulated packet's size in bytes.
	Note that the actual number of bytes consumed in the simulation
	may not relate to the value of this field
	  (i.e., \code{size_} has \emph{no} relationship
	  to \code{sizeof(struct hdr_cmn)} or other ns structures).
	Rather, it is used most often in computing the time required for a packet
	to be delivered along a network link.
	As such it should be set to the sum of the
	  application data size
	  and IP-, transport-, and application-level headers
	  for the simulated packet.


   -John Heidemann