How to get the (Link-layer) Source Node of a packet at runtime in NS2?

366 Views Asked by At

I'm using NS 2.35 to study the performance of layer-2 switches in networks. There are 2 questions (shown below that bothered me for a long time):

  1. I'd like to know how to get the (Link-layer) Source Node of a packet at runtime in NS2? I want to simulate a layer-2 switch and process packets according to the input ports where they come in. So I want to get the source node of a packet (like one of the fields in packet-trace shows).
  2. Is there an easy way to get the total number of links connected to a node at runtime?

Any help would be greatly appreciated.

0

There are 0 best solutions below