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

Re: [ns] addition to ip hdr



On Tue, 17 Jul 2000, [email protected] wrote:

> While on the subject, is there any way to keep *all* headers from being
> included in a packet?  That is, it seems like alot of baggage to have all
> protocol headers within each packet as appears to be the case.  Say if you
> have a TCP packet, why would you want to include say a UDP header in the
> packet?

Innocent question: why doesn't Packet have derived classes?

Provided you've got a base virtual method that identifies packet type
(integer will suffice) so agents can check they're receiving the right
type by querying the replacement in the derived class, you can place
header overhead only where it is needed.

You'd just replace Packet* in the various agents with TCPPacket*,
UDPPacket*, or whatever to get the headers you need.

Except for handling the (optional) wireless headers as well you'd need
some form of multiple inheritance for e.g. TCP, TCP-with-wireless...
er.

L.

is surprised that the Packet hierachy doesn't reflect other ns
hierarchies.

<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>