計算機網路_CH6

26 April 2020

802.11 frame

  • 一般來說payload最多裝到1500,配合IP封包大小
  • CRC 檢查bit error
  • Address 2 : source MAC,傳送此frame的device的MAC,如果送資料的是AP,則放AP的MAC
  • Address 1 : Destination MAC,接收資料的device
  • Address 3 : 因為bss是多個subnet,這個紀錄連接不同subnet的router的MAC
  • Address 4 : 用於ad hoc模式,送資料給其他host時

Adress 3詳細

如圖,AP連到一個router,再透過router連到internet,AP只是link layer的裝置,所以沒有IP的概念。

告訴Host router R1的MAC:

  • router知道host H1的IP,利用ARP查host H1的MAC address
  • router把source frame address設成自己R1 MAC,把destination frame address設成H1 Mac,router使用Ethernet frame(802.3)
  • AP收到訊息後,把frame轉成802.11的格式才能夠無線傳輸,把adress1~3填上給host H1
  • host H1就可以知道router的MAC了

Host H1傳送資料:

  • Host H1把資料填妥(802.11的frame)
  • AP收到後把資料轉成Ethernet frame(802.3)有線傳輸給Router R1

Sequence number and duration field

跟TCP依樣,傳送資料收到ACK,沒收到ACK就重傳,可能導致資料重複傳的問題,所以設定sequence number。 duration是用在reserve channel一段時間傳資料、RTS,CTS的時間

mobility between subnet

  • 為了擴大wireless能夠使用的範圍,在一個router的subnet內常建多個BSS,都由同一個router負責,共用IP。
  • 當station、end host從一個BSS到另一個BSS會有問題,因為變成不同AP負責,會導致原本存在的連線送到舊AP
  • 當endhost移動時,他會感測到原本的AP變弱,另一個的AP變強,所以到後來會嘗試斷掉就有AP連線去連新AP

    問題

    switch有一個forwarding table記住end host的MAC要怎麼到達(送給哪個AP),當使用者移動時要有辦法更新forwarding table

    解法

    接受新連接的AP broadcast這項資訊給switch,讓他知道連誰

Rate adaption

因為各種因素可能使SNR瞬間提高而BER降低,低到幾乎怎麼傳怎麼失敗。像是endhost移到離AP較遠處,SNR提高。因此提出方法來提高capability。距離AP近,SNR高,BER低。

作法

同TCP,如果連續很常收到ACK,那就提高transmission rate,沒收到ACK就降rate

Power management

end host通常電量是很大的問題,802.11有些方法能避免手機一直感測或傳輸 data,幫end host省電,幫助end host減少要sense的時間。

node-to-AP

  • node告訴AP要睡一段時間,透過802.11封包的power management bit = 1
  • 這時AP會把所有要傳給node的資訊buffer住
  • node自己有timer一段時間後把自己叫醒
  • node在AP送beacon frame前醒來
  • AP的beacon frame有list哪些node的資料被buffer
  • node醒來後若在list裡就收訊息,不在就回去睡

802.15(沒仔細看)

802.11是high power,medium range, higher rate

  • bluetooth,zigbe
  • 用於短距離傳輸、省錢、省能量
  • 用於周邊產品的溝通
  • ad hoc network,沒有infrastructure
  • 使用2.4GHz unlicensed radio band

Piconet/Bluetooth

master slave network

  • master最大,在網路裡的時間歸他控管
  • slave device只有在master跟他們講話時他們才能傳資料給master,slave不能互傳
  • parked device不能傳資料除非被master active

Zigbee

傳輸量小、短距離,適用於IoT溝通

Cellular network

名詞定義

不用靠近wifi 或hotspot來聯網。

  • cell : 一個BS負責的範圍,大小取決於很多因素
    • BS、手機傳訊息的強度
    • 障礙物
  • BS(base station) : 接收或傳送signal給手機(基地台)
  • MSC(Mobile switching center) : 決定手機是否能連到網路,有權限的手機透過MSC連接到實體網路

generation

  • 2G : voice communication, digital
  • 3G : voice + data traffic,可傳送聲音和資料,開始可以聯網

2G

支援voice transmission,利用FDM,TDM來做傳輸

  • BST : base station trasciever,負責接收、傳遞signal給手機
  • BSC : 負責控制數個base station trasciever(基地台)的資料傳輸
  • MSC(Mobile switching center) : 決定手機是否能連到網路,有權限的手機透過MSC連接到實體網路
  • FDMA/TDMA scheme

3G

保有2G的架構下(GSM cellular voice network),再多出一個分支可以傳送資料 利用SGSN和GSSN

  • Radioa access network(UTRAN) + core network(GPRS)

  • SGSN :
    • 連接Radio access network,接收、傳遞MSC傳來的資料
    • 負責mobile的使用者認證、handoff、維護user的location資訊
  • GGSN : 像是連接網路的router,負責數個SGSN與網路的連接
  • Radio access network :
    • 管理數個Base station trasciever(BST)
    • wireless的first hop
  • RNC :
    • 連接MSC傳送voice
    • 連接SGGN傳送data

4GLite

Evolved packet core

不再分成voice跟data的path,改成all ip,不管是datagram或者voice都是改成用ip packet刑事傳遞,要有效率避免congestion control

  • MME : 負責身份認證、安全性管理

LTE radio access network

Mobility

試圖解決當mobile node移動到不同network時,大家還是能夠找得到該mobile node

名詞

home network

network of cellular provider。

home agent

管理home network mobility,通常是在home network裡的router

foreign network

mobile node到外面的network

foreign(visited) agent

再foreign network幫助mobile node的mobility management

HLR(home location register)

home network的database儲存關於手機的所有資訊(像目前位置、電話號碼…..) HLR有足夠多的資訊讓home network知道封包要forward到哪裡

GSMC(Gateway mobile service switching center)

home network中處理correspondent和mobile node相連

VLR(visitor location register)

foreign network的database,紀錄現在在network裡的mobile node,所以是dynamic,很長修改,因為mobile node來來去去

法一: Propogation

當有人傳送資訊給mobile node的permanent address但mobile node人在外面連foreign network,home network會把她forward到foreign network。 做法是foreign network向周圍broadcast關於自己底下有哪些mobile node的資訊(可以再intradomain,interdomain routing的資訊交換時傳) 當mobile node離開此visited network到另一個時,另一個network也會broadcast

  • 優點:不用改變網路架構(routing info exchange時順便傳資訊),mobile node就算移到其他地方也找得到(透過home agent routing)
  • 缺點:scalability, agent可能要存超多的mobility node資訊

法二:利用home agent

home agent和mobile node有protocol讓home agent能得到mobile node所在的visited network資訊

  1. 如下圖,我們locate每個foreign agent
  2. foreign agent會發給每個mobile node一個COA(care of address, aka, foreign address)
  3. 每個mobile node有兩個address,permanent address和COA
  4. mobile node或foreign agent告訴home agent該mobile node的COA,home agent就知道mobile node在哪

Indirect routing

法二可以確定mobile node的位置,但對correspondent傳資訊給mobile node需要有forward的機制,流程如下:

  1. correspondent送資料給home agent
  2. home agent透過COA forward給foreign agent,此時為了卻表資料完整性而不因為forward而改變封包的欄位或值,所以home agent會用更大的datagram把資料封裝起來再傳給foreign agent。
  3. foreign agent收到資料後,先把封裝部份拆開,再把資料給mobile node
  4. mobile node把資料傳給correspondent
  5. mobile node直接把資料傳回給correspondent,之後維持這三角形資料傳遞
  6. 如果mobile node移到新的foreign network時會有新的COA更新home agent的資料
  7. 再mobile node network轉換不是大問題,因為只會有一點的packet loss(network congentsion也會有packet loss),反正TCP有ACK的機制

缺點

  1. triangle routing problem, 沒效率

direct routing

原本triangle routing改成correspondent記住mobile node的COA,第一次連線時詢問home agent特定mobile node的COA,之後就都傳到那個IP,不用再傳到home agent了

handoff handle

當mobile node移到另一個foreign network時,correspondent要更新mobile node的COA才能繼續通訊。但direct routing他並不會再去query home network,home network只有第一次建立connection時query取得COA,因此變成新的agent要inform舊的agent新的COA值為多少,然後correspondent連到舊的agent時會被redirect到新的agent

mobile IP

Internet mobility的standard,像是上述講到的COA之類的規範、home agent、foreign agent、encapsulation。

Agent discovery

mobile node換新的一個network時,壹定要取得該network agent的資訊,這樣mobile node才知道自己被加進新的network,agent告訴mobile node自己訊息的方法有兩種

agent advertisement

像現在的router discovery,agent定期送出ICMP封包(type 9)給目前所有connect的裝置,裡面會附上agent的IP和額外需要的資訊 H,F bit說明這個agent是home還是foreign R : 是否需要跟foreign agent註冊

Agent solicitation

步驟跟agent advertisement相同 差別在於第一步mobile node不是乾等agent broadcast,而是先broadcast一個ICMP封包(TYPE 10),agent收到後會跟mobile node連線

registration

當mobile node取得COA時,either mobile node或foriegn agent要告訴home agent 當完成agent advertisement取得COA後座以下事情

  1. mobile node送UDP封包給agent,內容包括home agent address, permanent address, valid time之類的
  2. foreign agent收到訊息後,得知以後某以後到permanent address的封包是給哪個device,並傳送一個UDP(mobile IP registration message)告訴home agent,內容包括registration time, home agent address, foreign agent address, COA
  3. home agent收到foreign agent的訊息後,bind住mobile node的permanent IP和COA,之後correspondent要傳訊息給mobile node,就會透過上述的encapsulate方式傳
  4. home agent收到mobile IP registration message後回傳reply(這裡的lifetime會比原本小)給foreign agent,foreign agent再forward給mobile node

GSM model

講述電話撥號是怎麼傳遞

  1. correspondent再PSTN(public switched telephone network)撥號碼,透過號碼特徵傳送到特定的home network的MSC
  2. home network收到後去HLR查詢roaming number(COA)
    • roaming number不等於電話號碼,這是暫時的,像COA,知道這個user在哪個網路內
    • HLR查不到roaming number MSC就去VLR查
  3. 得到該號碼的roaming number建立從correspondent到home network再到visited network,再到mobile user在的base station。

location update

同mobile IP,當mobile user移到foreign network後用一樣的update位置機制,mobile user和visited network建立連線後,其中一方送location update request傳回roaming number或VLR的位置給Home MSC。

handoff

mobile device會間歇性的測量現在beacon的強度,如果另一個base station的強度較大時會換去另一個base station,而這個測量結果會傳給base station

different base station same MSC

當base station收到有mobile user換base station的訊息時

  1. BS告訴visited MSC有個mobile user換到BS’
  2. visited MSC告訴BS’有handoff
  3. BS’ allocate channel給新的mobile user
  4. BS’送signal給MSC和舊的BS說path(MSC到新的BS)都建立好然後可以告訴mobile user
  5. mobile被告知handoff換到新的BS’,他完全不知道發生什麼事
  6. mobile user傳已完成handoff訊息給BS’,BS’ forward給MSC,MSC把correspondent資料傳到新的BS’
  7. 舊BS free掉資源

different base station different MSC

當mobile user很會跑,跑到一個不同MSC掌控的base station時

anchor MSC : call建立時的MSC 資料變成從home MSC forward到anchor MSC再forward到現在的MSC

因此不論怎麼移動,都是從home MSC -> anchor MSC -> current MSC

Wireless impact on TCP layer, App layer

大部分wireless和wired在這兩層是沒什麼差距

  1. 更多的packet loss或者bit error,congestion control會造成很大效能的問題
    • wireless不要congestion control
    • 更多checksum讓wireless能夠自己復原封包
    • split connection: end host到AP,AP到另一個end host(就是分成wireless部分跟wired部分),wireless部分可以用其他protocol
  2. bandwidth會是問題,所以網站有很多圖片的話,wireless user可能會load很久(尤其3G)
  3. real time traffic的impairment可能比較花時間

Mobile IP 和 cellular比較