How to measure or calculate the time-varying networked-induced delay? i know that the delay can be measured from the timestamp but how to extract the value of timestamp from data packet using simulink in Matlab program?
Round trip time is the basis for calculating the time taken for a packet to travel and come back . If the network induces delay , ACK will tell you and from my understanding the non-delay vs delay can be computed.
How to extract , you should look at packet fields that is protocol dependent (based on your setting)
Check for RFCs for TCP/UDP packet formats (bit level)
Yes. You can measure the time-varying network delay based on the round trip delay measurement. In Simulink, for e.g. you can use ramp signal/digital clock as delay measurement signal generator which sending through network together with the data packet. Once, it is arrive at the destination, the ramp signal is send back to the origin point. So, the difference in step/time of the signal indicate the round trip delay value. If you assume that forward and backward channel delay is similar, the delay for each channel is equal to half from the value of round trip delay.
Basicly, what you did is right. You can add on the clock (store the signal at the host PC) and also pack together with the sine wave signal. And, once the remote PC receive the packet with the clock, the clock signal is pack again and send back to the host PC. So, when the clock signal is received by the host PC, the difference between the current clock signal (stored) and the received current signal can be obtained. The difference is the estimated of round-trip delay. Other than clock, u can also use ramp signal for this purpose. Thanks.