NS3 network Emulation (fdnetdevice): The Problem of the

Source: Internet
Author: User

Happy Shrimp

http://blog.csdn.net/lights_joy/

Welcome reprint, but please keep the author information


In the previous section, we used fdnetdevice for real-time simulations, using NS3 to send pings to an actual machine package, but the results are obviously a bit off our expected result, because Ping The response time of the package is significantly longer than the response time under normal circumstances.


this is for NS3 Send Ping The result of the package:


Use WireShark in the NS3 using the adapter on the clutch, this is the packet caught on the physical NIC:


obviously the response to the end is no problem, the problem arises in WinPcap on the Send? Just learn ICMPv4 also encountered this problem, together solve it. A search on the internet seems to be the problem occurs when you open a winpcap device with the specified parameters:


if (Adhandle = Pcap_open_live (M_devicename.c_str (),//name of the device65536,//portion of the packet to capture.//655 Grants that the whole packet would be captured on all the macs.1,//promiscuous mode (nonzero means promiscuous) 1000,// Read timeouterrbuf//error buffer) = = NULL) {fprintf (stderr, "\nunable to open the adapter. %s is not supported by Winpcap\n ", M_devicename.c_str ()); return-1;}

Here's Read Timeout values come directly from WinPcap Sample code, check the meaning of this parameter:


Read_timeout,: read timeoutin milliseconds. The read timeout is used to arrange that the read notnecessarily return immediately when a packet was seen, but that it Wai TS Forsome amount of time to allow more packets to arrive and to read multiplepackets from the OS kernel in one operation. Not all platforms support a readtimeout; On platforms that's Don ' t, the read timeout is ignored.


change this value to 1 . Perform the simulation again



This is a better result. ~~~ , and then change to -1 Try :



better results, just at the moment CPU Higher usage rates.










??

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

NS3 network emulation: Fdnetdevice issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.