Skip to main content

網路模擬 Scenario

· One min read

說到網路模擬,大家在試過各種模擬網路工具之後,都會覺得模擬網路比起實際架設其實並不是容易的事情,

網路模擬 Scenario 主要都是由 4 個部分構成:點,線,面,時間

因為網路通訊本身就由 Physical/MAC, IP, Network, Application 等層構成, 就 Physical/MAC 來簡分就有無線,有線之別,IP, Network 層裡又有多樣的協定, 總合起來先天網路通訊本模擬上就有極高的複雜度.

先由網路模擬 Scenario 來說. 在 ns2 上是在 tcl 檔中定義,在 omnet++ 上是在 ned 檔與 omnetpp.ini 檔中定義

NS2 無線模擬

· 2 min read

Digest from here :

In a mixed simulation involving wired and wireless nodes its necessary : 1. to turn on hierarchical routing 2. to create separate domains for wired and wireless nodes. There may be multiple wired and wireless domains to simulate multiple networks. 3. to have one base-station node in every wireless domain, thru which the wireless nodes may communicate with nodes outside their domain.

we need to use hierarchical routing in order to route packets between wireless and wired domains

  • the routing information for wired nodes are based on connectivity of the topology
  • use base-stations which act as gateways between wired and wireless domains

#Number of domains in this topology is 2 (one for the wired nodes and one for the wireless) AddrParams set domain_num_ 2

#Number of clusters in each of these domains #which indicates the first domain (wired) to have 1 clusters and #the second (wireless) to have 5 cluster. AddrParams set cluster_num_ {1 5}

#the number of nodes in each of these clusters AddrParams set nodes_num_ {1 1 3 1 1 1}

心得: 在 mobiwan 中,bs 可以當 rt 用, 因此 bs 也有路由功能

每個 bs 都可以當 HA, 因此 mobiwan 裡不必指定 HA, mobile attach 上的那個點就自動做 HA.

所以 set mobile_ [create-mobile 1.4.1 1.4.0 1000 200 0 0 0.01] 表示 mobile 會把 1.4.0 這節點當作 HA

create-mobile 來自 proc-mipv6-config.tcl 啟動 def_mobile_config 來處理

base-station: create-base-station 啟動 def_bs_config 來處理 讓 bs 可以處理 wired&wireless 的重點是 #have wired routing mechanism turned on -wiredRouting ON 開啟 MIPv6 功能 -mipv6 ON

router: def_transit_config -mipv6 ON -mipagent CN

NS2 上的 RO 即是把 CN 當作 HA, 接收 BU, 然後作 tunnel 欲啟動 RO , 則在檔案最前頭宣告: Agent/MIPv6/MN set rt_opti_ 1 ; # 0 if routing optimization OFF

11th. day of porting INET6

· One min read

20th. Part: IPv6suite 的 IPProccessing 用的是 IPv4d 資料夾中的架構.

21th. Part: Mac 層要加入 0x86DD 代表 IPv6 訊息

UML

· One min read

一個有經驗的 Developer 對於剛接手的已存在的只有程式碼軟體開發專案,要能 了解這個軟體的架構是什麼至少要花數個小時,如果這個軟體專案有 Model Diagram,則這個 Developer 則很快就可以了解這個軟體架構。

一般而言 Diagramming Language 都應該提供下列資訊:

 ‧Overall architecture of the system  ‧System dependencies  ‧Complexity  ‧Flow of information through a system  ‧Business requirements  ‧Database organization and structure  ‧Source code – including almost every aspect of object-oriented development  ‧Deployment configurations

一個軟體專案如果有使用 Visual Models,我們就能從比較高的層次去看這個 Project, 藉由從較高層次圖去找尋 Fine-Grained Diagram。 這樣的方法可以幫助 Architect 和 Engineer 直覺地 (Intuitively) 掌握住問題並解決它, 軟體問題容易掌握 ,時間自然縮短,品質自然提高。

10th day of porting INET6

· One min read

18th. Part: NetworkLayer6.ned: disable OSPF, RSVP 原 protocolMapping = "6:0,17:1,1:2,2:3,46:4,89:5"; 表示 TCP (6):0, UDP (17):1, ICMP (1):2, IGMP (2):3, RSVP (46):4, OSPF (89):5 考慮到保證將來 DualStack 相容性,因此不更改原對應數字,而從後面再繼續補加.

暫時補加 ICMPv6 (58):2, ROUTING (43), MOBILITY (135) protocolMapping 後添上 58:6,43:7,135:8

  • 應再找資料確認 Neighbor Discovery -- ND 模組是否應包含在 ICMPv6 模組裡

19th. Part: 照著 Winodws 步驟,以 TicToc10 為基礎編譯. OMNET++/Sample/INET6Test: 修改 IP6Datagram.msg 以通過 compiler.

這次是針對 "模擬" 來做修正:

  • 因為 20 bits 不好宣告 (RFC 中是連 version, Traffic Class 一同宣告在一起), 因此 flow label 欄位訂的較 RFC 小 (20->16) (反正沒在用,應該沒什麼關係)
  • 在訂 IPv6 options message struct 時,Padding 不加似乎也沒關係
  • IP6FRAGMENT identification 欄位訂的較 RFC 小 (32->16)

目前採用方式 -> 全改用 int , short, long 來宣告,皆遠大於所需位元數