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

[ns] packet loss in LAN



HI, there ,
Thansk a lot for your previous response. They has been very helpful!:)
now, I have a Q about packet drop in LAN:

I use filter to implement packet loss in LAN: ( the normal loss model
does not work for LAN)..

proc add-error {lan src dst errmodel} {
        $lan instvar lanIface_

        set nif $lanIface_($dst)

        set filter [new Filter/Field]
        $nif add-receive-filter $filter
        $filter filter-target $errmodel
        $errmodel target [$filter target]
        $filter set offset_ [PktHdr_offset PacketHeader/Mac macSA_]

        $filter set match_ [[$lanIface_($src) set mac_] id ]  
}

in vlan.tcl, add-receive-filter is defined as:

LanIface instproc add-receive-filter filter {
        $self instvar mac_

#       $filter target [$mac_ target]
#       $mac_ target $filter

        $filter target [$mac_ up-target]
        $mac_ up-target $filter
}

it used to be 
#       $filter target [$mac_ target]
#       $mac_ target $filter

I changed it to use up-target, since I think it is receive filter, the
packet is going up, so it should use up-target. please correct me if I
got it wrong.

now I have this problem: the packet loss recorded in ns trace file can
still be seen by the link layer,i.e. the dropped packet is not seen by the
TCP receiver, but it is seen/received by the link layer in the receiver. I
thought the mac layer do the filter, as shown in add-receive-filter
procedure, so the mac layer at the receiver should filter out the droped
packet, and should NOt be forwarded to the link layer. 

but if the link layer ACK is dropped, it is not seen by the receiver of
the ack.
so the dropped TCP packet is still mysteriously seen by the link layer of
the receiver. However, for the dropped Link layer packet, it is not
seen by the corresponding link layer receiver, which is considered as act
correctly.

Does any one have any idea what might be the problem?
Thanks alot in advance!
yan