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

Sengmentation and reassmbly agent



Dear NS users:

I just start learning ns and I have a question about making an agent.
I want to make an agent which handles segmentaion and reassembly in
aintermidiate node of a connection.

If anyone knows how to make it or has suggestions, I appriciate your
help.

A Brief model is like this:

Communication between Node0 and Node3 (2way communication)
Node0 sends packets to Node1 from Agent/CBR/UDP.
Node1 receives packets, then divides it into many cells and sends them
to Node2.
Node2 receives cells and recovers a packet, then sends it to Node3.
Node3 receives  packets.

Node1 and Node2 have the same agent function because this communication
is bidirectional.

 Node0         Node1          Node2          Node3
|Pakets|----|Packets|       |Packets| ---- |Packets|
            | cells |-------| cells |

Both Node1 and Node2 work as gateway.

I don't know how to code in ns to divide into cells and recover a packet
from cells.
What is a good way to make this model?

Help me.

I tried this way (my gent has following functions):
 1. receive a packet using recv() method. recv() is overwritten.
 2. get  next agent address from tcl command (ex. $sar dest-pkt
$Node2Agent)
 3.  make cells according to comming packet size
    and send to next agent using   dest_pkt->recv(cell,0), here dest_pkt
is an address of next agent.    
     // This may have a promblem. Cells seem not propagate a link.  
     // I don't know how to send cells in a link

--
Yukio HASHIMOTO