UDP congestion control in NS2

396 views Asked by At

I have a wired sensor network topology in NS2 and i'm using UDP protocol. Is there anyway to detect congestion on the network links so i can slow the rate of UDP packets sent? I'm thinking measuring the number of packets in a link queue or maybe measure incoming traffic rate with the available bandwidth on the link. I don't know if it's doable though. How can i detect congestion in UDP? Thank you.

1

There are 1 answers

0
Hugh White On

Routers signal congestion by dropping packets. If you insert a monotonically increasing 32-bit sequence number into each packet you send, the receiver will be able to detect if packets are lost by looking for gaps in the sequence numbers. Then, the receiver could send a packet back to the sender asking it to slow down. This answer is similar.