18
The Network Simulator NS-2 & SCTP Module Student Kuo-Lun Lu Advisor Dr. Jen-Yi Pan

The Network Simulator NS-2 & SCTP Module Student : Kuo-Lun Lu Advisor : Dr. Jen-Yi Pan

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

The Network Simulator NS-2 & SCTP Module

Student : Kuo-Lun Lu

Advisor : Dr. Jen-Yi Pan

Outline

• SCTP

- what's is SCTP

- important features

• SCTP module

- multi-interface

- set nodes

- configuration parameters

What is SCTP ?

• SCTP ( Stream Control Transmission Protocol ) - PSTN signaling messages over IP Networks

• Similar to TCP and UDP - transport layer

- reliable / unreliable transmission

- congestion control

- ordered / unordered transmission

Important Features

• Multi-homing

• Multiple Streams

• SACK

• reliable / unreliable transmission

• ordered / unordered

SCTP Multi-homing

• More than one IP address. - one of the IP addresses is set to be the primary address primary path - other IP addresses secondary path

Interface 1

Interface 2

Interface 1

Interface 2

#path1

#path2 #path3

#path4

four possibly independent pathsHost A Host B

Multi-homing – change path

HostB

NI-1

HostA

OS

OS

Multi-homing

NI-1

IP networkERRORXData Data Data

Data

Data

Data

Data

DataDataDataDataNI-2 Primary Path

Secondary Path

X

Primary Path

Secondary PathX

SCTP Multiple Stream

• The streams within an SCTP association allow the endpoints to transfer multiple sequences of messages at the same time.

HostB

NI

HostA

OSNI

OSData3 Data2 Data1 Data0

Data7 Data6 Data5 Data4

Data11 Data10 Data9 Data8

Multiple Streams

Acknowledgment chunk

• SCTP detects packet losses by checking the blocking gaps in its Selective Acknowledgment (SACK) chunks.

SCTP module

• Base SCTP Agent在撰寫的過程中,主要遵循 RFC2960與其相關的後續推出的 draft 。包括有:– Normal Establishment of an Association (rudimentary handshake)– Transmission of DATA Chunks– Acknowledgment on Reception of DATA Chunks– Management Retransmission Timer– Multi-homed SCTP Endpoints– Stream Identifier and Stream Sequence Number– Ordered and Unordered Delivery– Report Gaps in Received DATA TSNs– SCTP Slow-Start and Congestion Avoidance– Endpoint Failure Detection– Path Failure Detection– Path Heartbeat (without upper layer control)– Partial Reliability (draft-ietf-tsvwg-usctp-01.txt)

Multi-interface

• NS2's architecture, a node can't actually be multihomed.

Each multihomed node is actually made up of

more than one node.

- core node

- interface node

建立多網路介面節點方法 -- command Where to find?

in sctp.cc

• set-multihome-core : 建立核心節點• multihome-add-interface : 核心節點與網路介面 Link

$ns node-config-multihome-core \ -wiredRouting OFF \ -macTrace OFFset host1_core [$ns node 1.0.1]set host1_if0 [$ns node 1.0.2]set host1_if1 [$ns node 2.0.1]$ns multihome-add-interface $host1_core $host1_if0$ns multihome-add-interface $host1_core $host1_if1

host1_core [$ns node 1.0.1]

host1_if0 [$ns node 1.0.2]

host1_if1 [$ns node 2.0.1]

在節點加上 SCTP agent

• multihome-attach-agent :將 SCTP agent加到節點上

– 若 SCTP僅有單一網路介面則用 attach-agentset sctp0 [new Agent/SCTP]

$ns attach-agent $host0 $sctp0

– 若 SCTP有多個網路介面則用 multihome-attach-agent set sctp1 [new Agent/SCTP]

$ns multihome-attach-agent $host1_core $sctp1

設定路徑• set-primary-destination:目的端有多個介面 ,設定要到達的 Destination 位置– $sctp0 set-primary-destination $host1_if0

不指定 ?

• force-source:設定多界面節點的主用 interface– $ns at 0 "$sctp1 force-source $host1_if0“

主要參數設定

Where to find?

in sctp.cc

• PathMaxRetrans_ 5– 當路徑的錯誤計數器超過此參數值時,會將此路徑的狀態設為 INACTIVE 並改由其他路徑傳輸。

• maxInitRetransmits 8 – 是 INIT Chunk 的最大重傳次數

• heartInterval_ 30– 當路徑超過此參數時間沒有資料傳送時,將路徑視為是 idle path ,並開始透過 HEARTBEAT 機制偵測路徑的狀態 (以秒為單位 )。

主要參數設定 (cont.)

• mtu_ 1500 – 是指每條路徑的最大傳輸單位

• initialSsthresh_ 65536 – Ssthresh(以 Byte 為單位 )

• InitialCwnd_ 2 – Cwnd ( 以 MTU - SCTP/IP headers 為單位 )

• numOutStreams_ 1 – 指由傳送端到接收端有幾條 outbound stream

• unordered_ 0 – 所傳輸的資料是有序或無序傳輸,預設 0 指 ordered

• ipHeaderSize_ 20 – IP header 的長度

主要參數設定 (cont.)

• dataChunkSize_ 512 – Data chunk 的長度

• useDelayedSacks_ 1 –是否使用 Delay SACK

• rtxToAlt_ 1

….其餘參數設定可參閱 NS2使用手冊

• rtxToAlt_–重傳的資料是否要使用其他路徑傳輸 0 = sam

e, 1 = alt, 2 = fast rtx to same + timeouts to alt