我得到的anwser,因爲我的Ubuntu版本是3.0.13-100,在這個錯誤version.if要解決這個問題,你需要更新你的kernl版本
的錯誤是,當你像這樣運行命令:
$ sudo sysctl -w net.ipv4.neigh.default.gc_thresh1=128
收到此錯誤信息:
error: "Invalid argument" setting key "net.ipv4.neigh.default.gc_thresh1"
這個bug在3.0.13-96版本3.0.13-100,詳細查看該link
時mininet啓動,它將運行fixLimits()函數:
def fixLimits(): "Fix ridiculously small resource limits." debug("*** Setting resource limits\n") try: rlimitTestAndSet(RLIMIT_NPROC, 8192) rlimitTestAndSet(RLIMIT_NOFILE, 16384) #Increase open file limit sysctlTestAndSet('fs.file-max', 10000) #Increase network buffer space sysctlTestAndSet('net.core.wmem_max', 16777216) sysctlTestAndSet('net.core.rmem_max', 16777216) sysctlTestAndSet('net.ipv4.tcp_rmem', '10240 87380 16777216') sysctlTestAndSet('net.ipv4.tcp_wmem', '10240 87380 16777216') sysctlTestAndSet('net.core.netdev_max_backlog', 5000) #Increase arp cache size sysctlTestAndSet('net.ipv4.neigh.default.gc_thresh1', 4096) sysctlTestAndSet('net.ipv4.neigh.default.gc_thresh2', 8192) sysctlTestAndSet('net.ipv4.neigh.default.gc_thresh3', 16384) #Increase routing table size sysctlTestAndSet('net.ipv4.route.max_size', 32768) #Increase number of PTYs for nodes sysctlTestAndSet('kernel.pty.max', 20000) # pylint: disable=broad-except except Exception: warn("*** Error setting resource limits. " "Mininet's performance may be affected.\n") # pylint: enable=broad-except