Calculating delay in first.cc

59 views
Skip to first unread message

Seongmin Kim

unread,
Dec 30, 2022, 8:14:39 AM12/30/22
to ns-3-users
Hi, I'm trying to figure out why the delay to send one packet in first.cc is 0.0036864s

Based on the fact that,
DataRate of NetDevice: 5Mbps
Delay of PointToPointChannel: 2ms
PacketSize: 1024 bytes
Propagation delay: 0.002s
Transmission delay: (1024 * 8) / (5 * 1000000) = 0.0016384s
Delay should be 0.0036384s
I looked up the log and I think transmission and propagation delay is all that matters in here.
log.png
Is there any factors i missed?
I'm wondering why there is 0.0000480s gap between my calculation and what the NS3 says.

Thank you!

Gabriel Ferreira

unread,
Dec 30, 2022, 12:06:18 PM12/30/22
to ns-3-users
Yes, you missed the lower layers.

Application payload = 1024 bytes
Transport-layer header (UdpHeader with 8 bytes) + 1024 = 1032
Network-layer header (Ipv4Header with 20 bytes) + 1032 = 1052
Link-layer header (PppHeader with 2 bytes) + 1052 = 1054.
Total packet size = 1054 bytes

Screenshot from 2022-12-30 13-46-23.png

Seongmin Kim

unread,
Dec 30, 2022, 4:42:05 PM12/30/22
to ns-3-users
Thank you so much sir!
2022년 12월 31일 토요일 오전 2시 6분 18초 UTC+9에 gabriel...@gmail.com님이 작성:
Reply all
Reply to author
Forward
0 new messages