2023年9月8日 星期五

Q.931 Call States

Q.931 Call Stats,在 Q.931 提到的 calls 有 circuit-switched、packet-mode、temporary signalling、和 global call reference。

null state 不存在
c(U0): No call exists.
c(N0): No call exists.
p(U0): No access connection exists.
p(N0): No access connection exists.
t(U0): No call exists.
t(N0): No call exists.
g(Rest 0): No transaction exists.
call initiated 撥出,user 送出請求或 network 收到請求
c(U1): This state exists for an outgoing call, when the user requests call establishment from the network.
c(N1): This state exists for an outgoing call when the network has received a call establishment request but has not yet responded.
p(U1): This state exists for an outgoing access connection when the user requests access connection establishment from the network.
p(N1): This state exists for an outgoing access connection when the network has received an access connection establishment request but has not yet responded.
t(U1): This state exists for an outgoing call when the user requests call establishment from the network.
t(N1): This state exists for an outgoing call when the network has received a call establishment request but has not yet responded.
overlap sending 撥出,user 收到認可後送 overlap 訊息或 network 認可請求可接收 overlap 訊息
c(U2): This state exists for an outgoing call when the user has received acknowledgement of the call establishment request which permits the user to send additional call information to the network in overlap mode.
c(N2): This state exists for an outgoing call when the network has acknowledged the call establishment request and is prepared to receive additional call information (if any) in overlap mode.
t(U2): This state exists for an outgoing call when the user has received acknowledgement of the call establishment request which permits the user to send additional call information to the network in overlap mode.
t(N2): This state exists for an outgoing call when the network has acknowledged the call establishment request and is prepared to receive additional call information (if any) in overlap mode.
outgoing call proceeding
c(U3): This state exists for an outgoing call when the user has received acknowledgement that the network has received all call information necessary to effect call establishment.
c(N3): This state exists for an outgoing call when the network has sent acknowledgement that the network has received all call information necessary to effect call establishment.
p(U3): This state exists for an outgoing access connection when the user has received acknowledgement that the network has received all access connection information necessary to effect access connection establishment.
p(N3): This state exists for an outgoing access connection when the network has sent acknowledgement that the network has received all access connection information necessary to effect access connection establishment.
t(U3): This state exists for an outgoing call when the user has received acknowledgement that the network has received all call information necessary to effect call establishment.
t(N3): This state exists for an outgoing call when the network has sent acknowledgement that the network has received all call information necessary to effect call establishment.
call delivered
c(U4):This state exists for an outgoing call when the calling user has received an indication that remote user alerting has been initiated.
c(N4): This state exists for an outgoing call when the network has indicated hat remote user alerting has been initiated.
t(U4): This state exists for an outgoing call when the calling user has received an indication that remote user alerting has been initiated.
t(N4): This state exists for an outgoing call when the network has indicated that remote user alerting has been initiated.
call present
c(U6)"This state exists for an incoming call when the user has received a call establishment request but has not yet responded.
c(N6): This state exists for an incoming call when the network has sent a call stablishment request but has not yet received a satisfactory response.
p(U6): This state exists for an incoming access connection when the user has received an access connection establishment request but has not yet responded.
p(N6): This state exists for an incoming access connection when the network has sent an access connection establishment request but has not yet received a satisfactory response.
t(U6): This state exists for an incoming call when the user has received a call establishment request but has not yet responded.
t(N6): This state exists for an incoming call when the network has sent a call establishment request but has not yet received a satisfactory response.
call received
c(U7) This state exists for an incoming call when the user has indicated alerting but has not yet answered.
c(N7): This state exists for an incoming call when the network has received an indication that the user is alerting but has not yet received an answer.
p(U7): This state exists for an incoming access connection when the user has indicated alerting but has not yet answered.
p(N7): This state exists for an incoming access connection when the network has received an indication that the user is alerting but has not yet received an answer.
t(U7): This state exists for an incoming call when the user has indicated alerting but has not yet answered.
t(N7): This state exists for an incoming call when the network has received an indication that the user is alerting but has not yet received an answer.
connect request
c(U8) This state exists for an incoming call when the user has answered the call and is waiting to be awarded the call.
c(N8): This state exists for an incoming call when the network has received an answer but the network has not yet awarded the call.
p(U8): This state exists for an incoming access connection when the user has accepted the access connection and is waiting to be awarded the access connection.
p(N8): This state exists for an incoming access connection when the network has received an answer but the network has not yet awarded the access connection.
t(U8): This state exists for an incoming call when the user has answered the call and is awaiting to be awarded the call.
t(N8): This state exists for an incoming call when the network has received an answer but the network has not yet awarded the call.
incoming call proceeding
c(U9) This state exists for an incoming call when the user has sent acknowledgement that the user has received all call information necessary to effect call establishment.
c(N9): This state exists for an incoming call when the network has received acknowledgement that the user has received all call information necessary to effect call establishment.
p(U9): This state exists for an incoming access connection when the user has sent acknowledgement that the user has received all access connection information necessary to effect access connection establishment.
p(N9): This state exists for an incoming access connection when the network has received acknowledgment that the user has received all access connection information necessary to effect access connection establishment.
t(U9): This state exists for an incoming call when the user has sent acknowledgement that the user has received all call information necessary to effect call establishment.
t(N9): This state exists for an incoming call when the network has received acknowledgement that the user has received all call information necessary to effect call establishment.
active
c(U10) This state exists for an incoming call when the user has received an acknowledgement from the network that the user has been awarded the call. This state exists for an outgoing call when the user has received an indication that the remote user has answered the call.
c(N10): This state exists for an incoming call when the network has awarded the call to the called user. This state exists for an outgoing call when the network has indicated that the remote user has answered the call.
p(U10): This state exists for an incoming access connection when the user has received an acknowledgement from the network that the user has been awarded the access connection. This state exists for an outgoing access connection when the user has received an indication that the local network has completed the access connection.
p(N10): This state exists for an incoming access connection when the network has awarded the access connection to the called user. This state exists for an outgoing access connection when the local network has indicated that the access connection has been completed.
t(U10): This state exists for an incoming call when the user has received an acknowledgement from the network that the user has been awarded the call. This state exists for an outgoing call when the user has received an indication that the remote user has answered the call.
t(N10): This state exists for an incoming call when the network has awarded the call to the called user. This state exists for an outgoing call when the network has indicated that the remote user has answered the call.
disconnect request
c(U11) This state exists when the user has requested the network to clear the end-to-end connection (if any) and is waiting for a response.
c(N11): This state exists when the network has received a request from he user to clear the end-to-end connection (if any).
p(U11): This state exists when the user has requested the local network to clear the access connection and is waiting for a response.
p(N11): This state exists when the network has received a request from the user to clear the access connection.
disconnect indication
c(U12) This state exists when the user has received an invitation to disconnect because the network has disconnected the end-to-end connection (if any).
c(N12): This state exists when the network has disconnected the end-to-end connection (if any) and has sent an invitation to disconnect the user-network connection.
p(U12): This state exists when the user has received an invitation to disconnect because the network has disconnected the access connection to end connection (if any).
p(N12): This state exists when the network has sent an invitation to disconnect the user-network access connection.
suspend request
c(U15) This state exists when the user has requested the network to suspend the call and is waiting for a response.
c(N15): This state exists when the network has received a request to suspend the call but has not yet responded.
resume request
c(U17) This state exists when the user has requested the network to resume a previously suspended call and is waiting for a response.
c(N17): This state exists when the network has received a request to resume a previously suspended call but has not yet responded.
release request
c(U19) This state exists when the user has requested the network to release and is waiting for a response.
c(N19): This state exists when the network has requested the user to release and is waiting for a response.
p(U19): This state exists when the user has requested the network to release the access connection and is waiting for a response.
p(N19): This state exists when the network has requested the user to release the access connection and is waiting for a response.
t(U19): This state exists when the user has requested the network to release and is waiting for a response.
t(N19): This state exists when the network has requested the user to release and is waiting for a response.
call abort
c(N22): This state exists for an incoming call for the point-to-multipoint configuration when the call is being cleared before any user has been awarded the call.
p(N22): This state exists for an incoming access connection for the point-to-multipoint configuration when the access connection is being cleared before any user has been awarded the access connection.
t(N22): This state exists for an incoming call for the point-to-multipoint configuration when the call is being cleared before any user has been awarded the call.
overlap receiving
c(U25) This state exists for an incoming call when the user has acknowledged the call establishment request from the network and is prepared to receive additional call information (if any) in overlap mode.
c(N25): This state exists for an incoming call when the network has received acknowledgement of the call establishment request which permits the network to send additional call information (if any) in the overlap mode.
t(U25): This state exists for an incoming call when the user has acknowledged the call establishment request from the network and is prepared to receive additional call information (if any) in overlap mode.
t(N25): This state exists for an incoming call when the network has received acknowledgement of the call establishment request which permits the network to send additional call information (if any) in the overlap mode.
restart request
(Rest 1): This state exists for a restart transaction when the user has sent a restart request but has not yet received an acknowledgement response from the network.
(Rest 1): This state exists for a restart transaction when the network has sent a restart request but has not yet received an acknowledgement response from the user.
restart
(Rest 2): This state exists when a request for a restart has been received from the network and responses have not yet been received from all locally active call references.
(Rest 2): This state exists when a request for a restart has been received from the user and a response has not yet been received from all locally active call references.
circuitpackettempglobal
U0N0U0N0U0N0Rest0
U1N1U1N1U1N1-
U2N2--U2N2-
U3N3U3N3U3N3-
U4N4--U4N4-
U6N6U6N6U6N6-
U7N7U7N7U7N7-
U8N8U8N8U8N8-
U9N9U9N9U9N9-
U10N10U10N10U10N10-
U11N11U11N11---
U12N12U12N12---
U15N15-----
U17N17-----
U19N19U19N19U19N19-
-N22-N22-N22-
U25N25--U25N25-
------Rest1 (61)
------Rest2 (62)

Q.931 STATUS IE Call state 3.1.16, 3.2.10, 3.3.11. 3.4.3. 4.5.7

Call state value (octet 3) Bits 6 5 4 3 2 1 User State Network state 0 0 0 0 0 0 U0 – Null N0 – Null 0 0 0 0 0 1 U1 – Call initiated N1 – Call initiated 0 0 0 0 1 0 U2 – Overlap sending N2 – Overlap sending 0 0 0 0 1 1 U3 – Outgoing call proceeding N3 – Outgoing call proceeding 0 0 0 1 0 0 U4 – Call delivered N4 – Call delivered 0 0 0 1 1 0 U6 – Call present N6 – Call present 0 0 0 1 1 1 U7 – Call received N7 – Call received 0 0 1 0 0 0 U8 – Connect request N8 – Connect request 0 0 1 0 0 1 U9 – Incoming call proceeding N9 – Incoming call proceeding 0 0 1 0 1 0 U10 – Active N10 – Active 0 0 1 0 1 1 U11 – Disconnect request N11 – Disconnect request 0 0 1 1 0 0 U12 – Disconnect indication N12 – Disconnect indication 0 0 1 1 1 1 U15 – Suspend request N15 – Suspend request 0 1 0 0 0 1 U17 – Resume request N17 – Resume request 0 1 0 0 1 1 U19 – Release request N19 – Release request 0 1 0 1 1 0 – - - - - - N22 – Call abort 0 1 1 0 0 1 U25 – Overlap receiving N25 – Overlap receiving Global interface state value (octet 3) Bits 6 5 4 3 2 1 State 0 0 0 0 0 0 REST0 – Null 1 1 1 1 0 1 REST1 – Restart request 1 1 1 1 1 0 REST2 – Restart All other values are reserved

2023年7月16日 星期日

locale

locale:事情發生的場景。程式的地區設定。區域化環境類別

區域類別的環境變數有:

  • LC_CTYPE:字元分類及處理方式。
  • LC_COLLATE:字元順序與字串比較。
  • LC_MESSAGES:訊息顯示的語文。
  • LC_MONETARY:貨幣顯示的語文。
  • LC_NUMERIC:數字顯示的語文。
  • LC_TIME:日期時間的語文。
  • LANG:LC_ALL 以外,未設時預設的語文。
  • LC_ALL:覆蓋所有設定的語文。

程式啟動時,系統預設給的初始 locale 是 POSIX 或 C,此時程式的表現和傳統的 C 語言一樣,使用英文做訊息輸出,只能處理英文。支援 I18N 的程式,啟動時會按照程式所處的環境變數來改變它的 locale,處理該地區語文。

公用程式 locale 可看目前系統的 locale 設定狀態,設定值以雙引號括起來表示沒有設定值,而從 LANG 而來的。

參考

  1. https://www.csie.ntu.edu.tw/~r95053/samples/collection/backup/locale2.html

2023年7月2日 星期日

10Base-T1S

  • 一對無屏蔽雙絞線匯流排,最長 25 公尺,支援最少八個節點。名稱中的「S」代表是短距版,另有遠距版 10Base-T1L 針對工業應用。
  • 10Mbps 半雙工。採用差動式曼徹斯特編碼 (DME),時脈週期內未出現轉換,資料是 0;出現轉換,資料為1。
  • 使用實體層衝突規避 (PLCA) 避免多個裝置發生資料衝突,來縮短失效時間。
  • 支援供電。
  • 2020 發布的 IEEE 802.3cg 2019 標準中的一部分。讓乙太網路應用在汽車低速資料通訊,以便使用相同的軟體堆疊及通訊機制。

2023年6月30日 星期五

Linux Kernel Networking

參考

2023年6月23日 星期五

ASCII

ASCII, American Standard Code for Information Interchange, US-ASCII:7-bit,128 字元,其中 33 控制字元、95 可列印字元。


0x000x100x200x300x400x500x600x70
0x0NULDLESP0@P`p
0x1SOHDC1!1AQaq
0x2STXDC2"2BRbr
0x3ETXDC3#3CScs
0x4EOTDC4$4DTdt
0x5ENQNAK%5EUeu
0x6ACKSYN&6FVfv
0x7BELETB'7GWgw
0x8BSCAN(8HXhx
0x9HTEM)9IYiy
0xALFSUB*:JZjz
0xBVTESC+;K[k{
0xCFFFS,<L\l|
0xDCRGS-=M]m}
0xESORS.>N^n~
0xFSIUS/?O_oDEL

Unicode 前t 128 碼是 ASCII。

參考

2023年6月17日 星期六

LoRa

LoRa 是一種用在低功率廣域網路 (LPWAN) 的無線技術,意思是 extremely Long-Range data links、長距離傳輸。

  • 物聯網是一種「物」相互「聯繫」的「網路」,「物」有唯一辨識碼、並有網路傳輸能力,其無線連接方式可分成三種:Short-range wireless、Cellular、和 LPWAN。其中 LPWAN 特性就是低功率 (LP) 且長距離 (WAN),這種情況相對位元率不會太高,屬於此類的有 NB-IoT、Sigfox、和 LoRa。
  • 20mW 功率沒有阻礙可達 15 公里,城市 2~5 公里。
  • 媽媽是法國新創公司 Cycleo,2012 繼父半導體公司 Semtech 買下 Cycleo,並命名 LoRa、將所有相關技術專利註冊,授權給其它晶片廠商。
  • LoRa 頻段
  • LoRa 簡單講是一種無線模組。LoRa 端點通常有控制器跑一些協定來使用 LoRa 無線模組,最簡單的是讓兩者直接互通,另外有 LoRaWAN、Meshtastic等。
  • LoRaWAN 是網路層,LoRa 是實體層跟連接層。LoRaWAN 分為 A 類、B 類、C 類。網路架構有四大部分:終端節點 (行動或固定裝置),閘道器 (可無線互通的基地台?),網路服務器 (Join Server 也算嗎?),應用服務器。LoRaWAN 並不支援兩個端點不透過 Gateway 直接通訊。LoRa 兩端點可以直接通訊,但和 LoRaWAN 網路無關。

是一種用無線電傳輸文字訊息的通訊協約,最常見的使用方式是利用免執照無線電頻率 433MHz 或 ISM 頻率 902-932MHz 傳輸資料。必要時也可以透過網際網路中繼到更遠的地方。

免執照的頻段有 2.4GHz 和 Sub-GHz。其中 2.4GHz 屬於短距離無線傳輸,大量應用於 Wi-Fi、Bluetooth 等 (容易相互干擾,節點少,不適合多點佈建?)。Sub-GHz 頻段傳輸距離遠、干擾少、功耗低,適合工業製造領域。

Sub-GHz 部份,433 MHz頻段 (全球通用),915 MHz (北美和澳洲)、868 MHz (歐洲)、315 MHz (北美、亞洲和日本)。

5G、802.11aj、LoRa、NB-IoT、BLE到Zigbee等各種規格;LPWA

Meshtastic 使用 LoRa 傳輸技術,推薦購買兩種裝置,手持的 Meshtastic 裝置與 Meshtastic 太陽能節點裝置。: 手持的 Meshtastic 裝置

參考

  1. https://www.facebook.com/groups/meshtastictw/posts/434624832280048/
  2. LORA vs LORAWAN (Good)
  • 有些 LoRa 機器上面自己有 OLED 顯示與鍵盤,有些則可以透過藍牙或 Wi-Fi 用手機或電腦顯示與打字,也可以用 Arduino 做。由於發射功率只有100mW ,兩顆18650鋰電池就可以用撐一整天,不過它只適合雙方互相可以看得到的視線範圍內通訊。
  • https://www.2cm.com.tw/2cm/zh-tw/tech/A5243AF698324D07BB8C3BD9D98FED60:陞特 (Semtech) 在 2013 年 8 月發表 LoRa 晶片,特色是基於 1GHz 以下,接受靈敏度達到 -148dbm,相較於當時其它 sub-GHz 晶片提升了 20dB 的接收靈敏度,傳輸距離超過15公里,且基地台可處理多達一百萬個節點,具備著低功率與遠距離的兩大優點,因此即便最大數據傳輸率限制於50kbps也能廣被應用。LoRa 實體層是用 SSM (Spread Spectrum Modulation) 調變技術,是一種廣頻頻率調變的正弦訊號,將較高的頻率序列針對基礎訊號進行編碼,然後在更寬廣的頻寬上將基礎訊號展開,藉由此調變降低功耗,同時提升訊號在電磁干擾下的耐受能力,因此線性調變適合用於低功率下的低數據傳輸率(小於1Mbps)應用。LoRa允許六種展頻因數(SF7至SF12)與三種不同的頻寬(125kHz、250kHz、500kHz)。選擇可允許的展頻因數和頻寬都是由使用國家的相關機關做決定的。以美國為例,頻寬規定用500kHz,而展頻因數規定用7至10。LoRaWAN的網路架構採用延伸星狀拓撲(Star-of-Star),當中每一個終端節點的訊息可以同時直接或間接傳給多個基地台站,基地台則進而與網路伺服器通訊。

Automatic Packet Reporting System

APRS(Automatic Packet Reporting System)字面翻是「自動封包回報系統」,其實是「自動位置回報系統』,是業餘無線電結合全球衛星定位系統 (GPS),以 AFSK AX.25 通訊模式回報給世界各地的 APRS 接收電台,電台再透過網際網路上傳到 APRS 伺服器。全世界各地的 APRS 伺服器將資料彙整供使用者讀取,其中最常使用的就是 aprs.fi 網站。

只能回報位置?

參考

SIP header Via

所有 SIP 訊息 都要有 Via,縮寫 v。一開始的 UAC 和後續途經的每個 proxy 都會疊加一個 Via 放傳送的位址,依序作為回應的路徑。 格式 sent-protocol sent-by [ ;branch= branch ][ ; 參數 ...] s...