1
(gdb) b ipv4-end-point-demux.cc:199
此处对于各种五元组进行了匹配,如果最终大部分都满足不了匹配条件,就会认定为发给本地端点的。
2
(gdb) b udp-l4-protocol.cc:344
枚举所有的命中的端点,如果符合要求,则采取如下行动
(gdb) n
366 (*endPoint)->ForwardUp (packet->Copy (), header, udpHeader.GetSourcePort (),
(gdb)
这里ForwardUp的意思是向底层(OSI的更低层)上报,从软件实现看,是在向外层上报,所以叫ForwardUp(转发),
3
上层处理转发
void
UdpSocketImpl::ForwardUp
(gdb) b ns3::UdpSocketImpl::ForwardUp
Breakpoint 3 at 0x7ffff6d117a5: file ../src/internet/model/udp-socket-impl.cc, line 957.
(gdb)
Breakpoint 3, ns3::UdpSocketImpl::ForwardUp (this=0x7fffdc0065c0, packet=..., header=..., port=646, incomingInterface=...) at ../src/internet/model/udp-socket-impl.cc:957
957 NS_LOG_FUNCTION (this << packet << header << port);
(gdb) b 996
Breakpoint 5 at 0x7ffff6d11c88: file ../src/internet/model/udp-socket-impl.cc, line 996.
(gdb) c
Continuing.
Breakpoint 5, ns3::UdpSocketImpl::ForwardUp (this=0x7fffdc0065c0, packet=..., header=..., port=646, incomingInterface=...) at ../src/internet/model/udp-socket-impl.cc:996
996 NotifyDataRecv ();
(gdb)
4
接到通知的消息来自于
void
UnixSocketFd::RecvSocketData (Ptr<Socket> socket)
那么上层接收基本完成了。