Skip to main content

· One min read

void TCPGenericCliAppBase::setStatusString(const char *s) { if (ev.isGUI()) displayString().setTagArg("t", 0, s); }

void TCPGenericCliAppBase::socketEstablished(int, void ) { // redefine* to perform or schedule first sending ev << "connected\n"; setStatusString("connected"); }

· One min read

剛看到

http://ctieware.eng.monash.edu.au/twiki/bin/view/Simulation/Installation

上提供了 IPv6SuiteWithINET for OMNeT++ 3.1, windows/linux 版.

趕快來試用,如果沒問題的話那 INET6 計畫的下一步就修正成寫 IPv6SuiteWithINET 文件推廣囉, 當然,要先自己 trace 一遍才知人家怎麼做的

4/21 quick revice: 必須安裝 VC 7.1 編譯程式才能編譯,6.0 的不行。程式可以由下面連結下載 http://www.microsoft.com/downloads/details.aspx?FamilyID=272be09d-40bb-49fd-9cb0-4bfa122fa91b&displaylang=en

· One min read

I found this paper through IEEE Xplore, and intrest in the topic "Eval freeBSD protocol stack in OMNeT++".

Integration of the FreeBSD TCP/IP-Stack into the Discrete Event Simulator OMNet++ Bless, R.; Doll, M.; Simulation Conference, 2004. Proceedings of the 2004 Winter Volume 2, December 5-8, 2004 Page(s):487 - 492

--

  • In asimulation environment one wants to run several hosts in parallel, So every required global and static FreeBSD variable must be made local to each host. -> a structure to store all the kernel variables for one host. -> Consequently,in the FreeBSD source every occurrence of the variables must be replaced by a reference into the corresponding structure.

ex: xyz is replaced to D->xyz

where D points to the current host structure that contains all the global and static kernel variables for this particular host.

  • Encapsulate the complete TCP/IP into one OMNeT++ simple module.

Others are out of my knowledge...... In consequence, I think porting protocol stacks from different architecture is still not an easy way....

· One min read

Define_Module (PingApp); 模組名稱是 PingApp

PingApp::initialize()

  1. 讀入 omnetpp.ini 中設定的參數.
  2. 在 TKenv 中監視
  • sendSeqNo
  • expectedReplySeqNo
  • dropCount
  • outOfOrderArrivalCount 這幾個結果 PingApp::handleMessage (cMessage *msg)

if (msg->isSelfMessage ()) 若訊息來自本身節點

destAddr = IPAddressResolver ().resolve (par ("destAddr")); 解析目的位址設定

來自其他節點則啟動回覆機制

processPingResponse(check_and_cast<pingpayload>(msg));

void PingApp::sendPing()

PingPayload msg = new PingPayload (name); 新增封包,接著下面照著宣告的格式填入對應的值 msg->setLength (8packetSize); //? 封包裡沒宣告

sendToICMP (msg, destAddr, srcAddr, hopLimit); 把訊息送到 ICMP 裡

PingApp::scheduleNextPing(cMessage *timer)

simtime_t nextPing = simTime () + intervalp->doubleValue (); 模擬時間加上間隔時間

void PingApp::sendToICMP(cMessage *msg, const IPvXAddress& destAddr, const IPvXAddress& srcAddr, int hopLimit) 判斷送出 v4/v6 icmp 格式封包

void PingApp::processPingResponse (PingPayload *msg) 收到 ICMP 封包,判斷</pingpayload> v4/v6 並<pingpayload>處理 </pingpayload>