네트워크 시뮬레이터 ns-2: 라우터의 MTU가 다른 네트워크의 조각화 모델링

네트워크 시뮬레이터 ns-2: 라우터의 MTU가 다른 네트워크의 조각화 모델링

간단한 네트워크 모델이 있습니다. 호스트 간에 파일을 전송합니다. 다양한 라우터가 있으며 MTU전체 OTcL코드는 다음과 같습니다.

####################################################################
#                                                                  #
#                               PRESETS                            #
#                                                                  #
####################################################################

# new simulator object
set ns [new Simulator]

# trace file
set allchan [open /ns2/examples/data.tr w]
$ns trace-all $allchan

# for nam
set visio [open /ns2/examples/data.nam w]
$ns namtrace-all $visio

#procedure triggered at finish time
proc finish {} {
    global ns visio allchan

    $ns flush-trace

    close $visio
    close $allchan

    exec nam /ns2/examples/data.nam &   
    exit 0
}

####################################################################
#                                                                  #
#                               LINKS &NODES                       #
#                                                                  #
####################################################################
set god [create-god 6]
for {set i 0} {$i < 6} {incr i} {
    set node_($i) [$ns node]    
}
for {set i 0} {$i < 5} {incr i} {
    $ns duplex-link $node_($i) $node_([expr $i+1]) 2Mb 10ms DropTail
}

#============================= hosts ===============================
$node_(0) color Blue
$node_(5) color Blue
#============================ routers ==============================
$node_(1) color Red
$node_(2) color Red
$node_(3) color Red
$node_(4) color Red

####################################################################
#                                                                  #
#                            AGENTS                                # 
#                                                                  #
####################################################################
set host1 [new Agent/TCP]
$ns attach-agent $node_(0) $host1
$host1 set fid_ 0
$host1 set mtu_ 1500

set router1 [new Agent/TCP]
$ns attach-agent $node_(1) $router1
$router1 set fid_ 1
$router1 set mtu_ 1000

set router2 [new Agent/TCP]
$ns attach-agent $node_(2) $router2
$router2 set fid_ 2
$router2 set mtu_ 800

set router3 [new Agent/TCP]
$ns attach-agent $node_(3) $router3
$router3 set fid_ 3
$router3 set mtu_ 700

set router4 [new Agent/TCP]
$ns attach-agent $node_(4) $router4
$router4 set fid_ 4
$router4 set mtu_ 600

set host2 [new Agent/TCPSink]
$ns attach-agent $node_(5) $host2
$host2 set mtu_ 1500
$ns connect $host1 $host2

####################################################################
#                                                                  #
#                          APPLICATIONS                            #
#                                                                  #
####################################################################
set ftp [new Application/FTP]
$ftp attach-agent $host1
$ftp set type FTP

####################################################################
#                                                                  #
#                           START SIM                              #
#                                                                  #
####################################################################
$ns at 0.1 "$ftp start"
$ns at 10.0 "$ftp stop"

$ns at 11.0 "finish"
$ns run

여기에 이미지 설명을 입력하세요.

패킷의 조각화를 보고 싶지만 표시되지 않습니다. 그 이유는 무엇입니까?

나는 그것을 설정할 수 없다고 생각합니다 MTU.

그것은 말한다여기저것:

ns2의 MTU(최대 전송 단위) 기본값은 일반적으로 1500입니다. 이제 연구 결과에 따라 이 값을 변경하려면 "mac-802.3.h" 파일로 이동하여 "IEEE_8023_MAXFRAME" 값을 변경하고 다시 컴파일하면 됩니다. 다음에서 파일을 찾을 수 있습니다.

/home/사용자 이름/ns-allinone-2.xx/ns-2.xx/mac

부분data.tr:

+ 0.1 0 1 tcp 40 ------- 0 0.0 5.0 0 0
- 0.1 0 1 tcp 40 ------- 0 0.0 5.0 0 0
r 0.11016 0 1 tcp 40 ------- 0 0.0 5.0 0 0
+ 0.11016 1 2 tcp 40 ------- 0 0.0 5.0 0 0
- 0.11016 1 2 tcp 40 ------- 0 0.0 5.0 0 0
r 0.12032 1 2 tcp 40 ------- 0 0.0 5.0 0 0
+ 0.12032 2 3 tcp 40 ------- 0 0.0 5.0 0 0
- 0.12032 2 3 tcp 40 ------- 0 0.0 5.0 0 0
r 0.13048 2 3 tcp 40 ------- 0 0.0 5.0 0 0
+ 0.13048 3 4 tcp 40 ------- 0 0.0 5.0 0 0
- 0.13048 3 4 tcp 40 ------- 0 0.0 5.0 0 0
r 0.14064 3 4 tcp 40 ------- 0 0.0 5.0 0 0
+ 0.14064 4 5 tcp 40 ------- 0 0.0 5.0 0 0
- 0.14064 4 5 tcp 40 ------- 0 0.0 5.0 0 0
r 0.1508 4 5 tcp 40 ------- 0 0.0 5.0 0 0
+ 0.1508 5 4 ack 40 ------- 0 5.0 0.0 0 1
- 0.1508 5 4 ack 40 ------- 0 5.0 0.0 0 1
r 0.16096 5 4 ack 40 ------- 0 5.0 0.0 0 1
+ 0.16096 4 3 ack 40 ------- 0 5.0 0.0 0 1
- 0.16096 4 3 ack 40 ------- 0 5.0 0.0 0 1
r 0.17112 4 3 ack 40 ------- 0 5.0 0.0 0 1
+ 0.17112 3 2 ack 40 ------- 0 5.0 0.0 0 1
- 0.17112 3 2 ack 40 ------- 0 5.0 0.0 0 1
r 0.18128 3 2 ack 40 ------- 0 5.0 0.0 0 1
+ 0.18128 2 1 ack 40 ------- 0 5.0 0.0 0 1
- 0.18128 2 1 ack 40 ------- 0 5.0 0.0 0 1
r 0.19144 2 1 ack 40 ------- 0 5.0 0.0 0 1
+ 0.19144 1 0 ack 40 ------- 0 5.0 0.0 0 1
- 0.19144 1 0 ack 40 ------- 0 5.0 0.0 0 1
r 0.2016 1 0 ack 40 ------- 0 5.0 0.0 0 1
+ 0.2016 0 1 tcp 1040 ------- 0 0.0 5.0 1 2
- 0.2016 0 1 tcp 1040 ------- 0 0.0 5.0 1 2
+ 0.2016 0 1 tcp 1040 ------- 0 0.0 5.0 2 3
- 0.20576 0 1 tcp 1040 ------- 0 0.0 5.0 2 3
r 0.21576 0 1 tcp 1040 ------- 0 0.0 5.0 1 2
+ 0.21576 1 2 tcp 1040 ------- 0 0.0 5.0 1 2
- 0.21576 1 2 tcp 1040 ------- 0 0.0 5.0 1 2
r 0.21992 0 1 tcp 1040 ------- 0 0.0 5.0 2 3
+ 0.21992 1 2 tcp 1040 ------- 0 0.0 5.0 2 3
- 0.21992 1 2 tcp 1040 ------- 0 0.0 5.0 2 3
r 0.22992 1 2 tcp 1040 ------- 0 0.0 5.0 1 2
+ 0.22992 2 3 tcp 1040 ------- 0 0.0 5.0 1 2
- 0.22992 2 3 tcp 1040 ------- 0 0.0 5.0 1 2
r 0.23408 1 2 tcp 1040 ------- 0 0.0 5.0 2 3
+ 0.23408 2 3 tcp 1040 ------- 0 0.0 5.0 2 3
- 0.23408 2 3 tcp 1040 ------- 0 0.0 5.0 2 3
r 0.24408 2 3 tcp 1040 ------- 0 0.0 5.0 1 2
+ 0.24408 3 4 tcp 1040 ------- 0 0.0 5.0 1 2
- 0.24408 3 4 tcp 1040 ------- 0 0.0 5.0 1 2
r 0.24824 2 3 tcp 1040 ------- 0 0.0 5.0 2 3
+ 0.24824 3 4 tcp 1040 ------- 0 0.0 5.0 2 3
- 0.24824 3 4 tcp 1040 ------- 0 0.0 5.0 2 3
r 0.25824 3 4 tcp 1040 ------- 0 0.0 5.0 1 2
+ 0.25824 4 5 tcp 1040 ------- 0 0.0 5.0 1 2
- 0.25824 4 5 tcp 1040 ------- 0 0.0 5.0 1 2
r 0.2624 3 4 tcp 1040 ------- 0 0.0 5.0 2 3
+ 0.2624 4 5 tcp 1040 ------- 0 0.0 5.0 2 3
- 0.2624 4 5 tcp 1040 ------- 0 0.0 5.0 2 3
r 0.2724 4 5 tcp 1040 ------- 0 0.0 5.0 1 2
+ 0.2724 5 4 ack 40 ------- 0 5.0 0.0 1 4
- 0.2724 5 4 ack 40 ------- 0 5.0 0.0 1 4
r 0.27656 4 5 tcp 1040 ------- 0 0.0 5.0 2 3
    ...

이 기사설명하다,(NS-2와 NS-3의 숨겨진 터미널 문제에 대한 비교 연구):

핵심 패킷 데이터 구조는 시뮬레이션에 적합하지 않으며 조각화를 지원하지 않습니다.

조각화를 시뮬레이션하는 방법은 무엇입니까? 이거 모델해도 될까요?ns-2?

프록시를 사용하는 경우는 TCP어디입니까 MTU?

부분TCP 프로토콜:

...
 TcpAgent::TcpAgent() : Agent(PT_TCP), 
         t_seqno_(0), t_rtt_(0), t_srtt_(0), t_rttvar_(0), 
        t_backoff_(0), ts_peer_(0), 
         rtx_timer_(this), delsnd_timer_(this), 
         burstsnd_timer_(this), 
         dupacks_(0), curseq_(0), highest_ack_(0), cwnd_(0), ssthresh_(0), 
         count_(0), fcnt_(0), rtt_active_(0), rtt_seq_(-1), rtt_ts_(0.0), 
         maxseq_(0), cong_action_(0), ecn_burst_(0), ecn_backoff_(0),
         ect_(0), lastreset_(0.0),
         restart_bugfix_(1), closed_(0), nrexmit_(0),
         first_decrease_(1), qs_requested_(0), qs_approved_(0)
 {
 #ifdef TCP_DELAY_BIND_ALL
 #else /* ! TCP_DELAY_BIND_ALL */
         // not delay-bound because delay-bound tracevars aren't yet supported
         bind("t_seqno_", &t_seqno_);
         bind("rtt_", &t_rtt_);
         bind("srtt_", &t_srtt_);
         bind("rttvar_", &t_rttvar_);
         bind("backoff_", &t_backoff_);
         bind("dupacks_", &dupacks_);
         bind("seqno_", &curseq_);
         bind("ack_", &highest_ack_);
         bind("cwnd_", &cwnd_);
         bind("ssthresh_", &ssthresh_);
         bind("maxseq_", &maxseq_);
         bind("ndatapack_", &ndatapack_);
         bind("ndatabytes_", &ndatabytes_);
         bind("nackpack_", &nackpack_);
         bind("nrexmit_", &nrexmit_);
         bind("nrexmitpack_", &nrexmitpack_);
         bind("nrexmitbytes_", &nrexmitbytes_);
         bind("necnresponses_", &necnresponses_);
         bind("ncwndcuts_", &ncwndcuts_);
 #endif /* TCP_DELAY_BIND_ALL */

 }
...

SCTP프록시를 사용하는 경우 다음과 같이 다르게 설정할 수 있습니다 MTU.

부분sctp.cc

...
void SctpAgent::delay_bind_init_all()
{
  delay_bind_init_one("debugMask_");
  delay_bind_init_one("debugFileIndex_");
  delay_bind_init_one("associationMaxRetrans_");
  delay_bind_init_one("pathMaxRetrans_");
  delay_bind_init_one("changePrimaryThresh_");
  delay_bind_init_one("maxInitRetransmits_");
  delay_bind_init_one("heartbeatInterval_");
  delay_bind_init_one("mtu_");
  delay_bind_init_one("initialRwnd_");
  delay_bind_init_one("initialSsthresh_");
  delay_bind_init_one("ipHeaderSize_");
  delay_bind_init_one("dataChunkSize_");
  delay_bind_init_one("numOutStreams_");
  delay_bind_init_one("useDelayedSacks_");
  delay_bind_init_one("sackDelay_");
  delay_bind_init_one("useMaxBurst_");
  delay_bind_init_one("initialCwnd_");
  delay_bind_init_one("initialRto_");
  delay_bind_init_one("minRto_");
  delay_bind_init_one("maxRto_");
  delay_bind_init_one("fastRtxTrigger_");
  delay_bind_init_one("numUnrelStreams_");
  delay_bind_init_one("reliability_");
  delay_bind_init_one("unordered_");
  delay_bind_init_one("rtxToAlt_");
  delay_bind_init_one("dormantAction_");
  delay_bind_init_one("routeCacheLifetime_");
  delay_bind_init_one("routeCalcDelay_");

  /* PN: 5/07. Simulate send window */
  delay_bind_init_one("initialSwnd_");
  /* PN: 5/07. NR-Sacks */
  delay_bind_init_one("useNonRenegSacks_");

  delay_bind_init_one("trace_all_");
  delay_bind_init_one("cwnd_");
  delay_bind_init_one("rwnd_");
  delay_bind_init_one("rto_");
  delay_bind_init_one("errorCount_");
  delay_bind_init_one("frCount_");
  delay_bind_init_one("timeoutCount_");
  delay_bind_init_one("rcdCount_");

  Agent::delay_bind_init_all();
}
...

..하지만 조각은 여전히 ​​얻지 못합니다 -

[root@localhost ...]# ns /ns2/examples/mathm2.tcl
num_nodes is set 6
SCTP ERROR: DATA chunk size (1468) too big!
            SCTP/IP header = 32
            Control chunk reservation = 0
            MTU = 600

관련 정보