2021年3月20日 星期六

SIP P-Early-Media header

RFC5009: Private Header (P-Header) Extension to the Session Initiation Protocol (SIP) for Authorization of Early Media

P-Early-Media 是 ETSI TISPAN 為了在 3GPP IMS authorizing early media flows 所採用的 private SIP P-header,也用在其它 SIP 網路。

ETSI
European Telecommunications Standards Institute
TISPAN
Telecommunications Internet-converged Services and Protocols for Advanced Networks
3GPP
Third Generation Partnership Project
IMS
IP Multimedia Subsystems
Early Media
應答前的 media,目的是協助用戶完成呼叫,通常不是兩端用戶間直接交換資訊,包括彩鈴、或告訴主叫端「您撥的號碼通話中」等聲音訊息。
Unfortunately, a SIP network interconnected with another SIP network may have no means of assuring that the interconnected network is implementing a compatible early media policy, thus allowing the exchange of user data within early media under some circumstances. For example, if a network "A" allows all early media with user equipment as UAC and an interconnected network "B" allows all early media with user equipment as UAS, any session established between user equipment as UAC in "A" and user equipment as UAS in "B" will allow bidirectional user data exchange as early media. Other combinations of early media policies may also produce similar undesirable results. The purpose of the extension is to allow a SIP network interconnected to other SIP networks with different early media policies to correctly identify and enable authorized early media according to its policies.
Backward Early Media
由 terminating switch 往主叫端方向,例如提供回鈴音。
Forward Early Media
由主叫端往 terminating switch 方向,例如二次撥號的 DTMF digit collection。

authorize the cut-through of backward and/or forward early media when permitted by the early media policies of the networks involved. 用在有下列特性的 SIP 網路:兩端用戶間透過其它 SIP 網路連接,兩端用戶間無法直接交換 early media,但可以 "gate" (enable/disable) the flow of early media to/from user equipment.

在一個 isolated SIP 網路,可以自己決定是否開啟內部兩個用戶間的 early media。但如果兩個用戶間需要透過其它 SIP 網路連接,只有連到外部 SIP 網路的 boundary node 可以決定 which early media policy。The P-Early-Media header field provides a means for this boundary node to communicate this early media policy decision to other nodes within the network.

P-Early-Media 只應用 inside 定義在 RFC 3325 的 "Trust Domain". Nodes in such a Trust Domain are explicitly trusted by its users and end-systems to authorize early media requests only when allowed by early media policy within the Trust Domain.

This document does NOT offer a general early media authorization model suitable for inter-domain use or use in the Internet at large. Furthermore, since the early media requests are not cryptographically certified, they are subject to forgery, replay, and falsification in any architecture that does not meet the requirements of the Trust Domain.

An early media request also lacks an indication of who specifically is making or modifying the request, and so it must be assumed that the Trust Domain is making the request. Therefore, the information is only meaningful when securely received from a node known to be a member of the Trust Domain.

Although this extension can be used with parallel forking, it does not improve on the known problems with early media and parallel forking, as described in RFC 3960, unless one can assume the use of symmetric RTP.


待整理

Section 4.1 以後

P-Access-Network-Info[RFC7315]
P-Answer-State [RFC4964]
P-Asserted-Identity [RFC3325]
P-Asserted-Service [RFC6050]
P-Called-Party-ID [RFC7315]
P-Charge-Info [RFC8496]
P-Charging-Function-Addresses [RFC7315]
P-Charging-Vector [RFC7315]
P-DCS-Trace-Party-ID [RFC5503]
P-DCS-OSPS [RFC5503]
P-DCS-Billing-Info [RFC5503]
P-DCS-LAES [RFC5503]
P-DCS-Redirect [RFC5503]
P-Media-Authorization [RFC3313]
P-Preferred-Identity [RFC3325]
P-Preferred-Service [RFC6050]
P-Private-Network-Indication [RFC7316]
P-Profile-Key [RFC5002]
P-Refused-URI-List [RFC5318]
P-Served-User [RFC5502] [RFC8498]
P-User-Database [RFC4457]
P-Visited-Network-ID[RFC7315]

 

2021年3月13日 星期六

SIP PRACK

PRACK (Provisional Response ACKnowledgement)  是 SIP 用來確認暫時回應 (Provisional Response) 有順利送達,定義在 RFC3262

INVITE 的最後回應會間隔重送直到收到 ACK,其中成功回應和 ACK 的可靠機制是端對端的。但 180 Ringing 等暫時回應,在 RFC3261 並沒有重送機制,沒送到對方就不知道有振鈴。PRACK 模仿 ACK,暫時回應會主動間隔重送直到收到 PRACK。不同的是,PRACK 和一般 SIP Method (如 BYE) 同款,是獨立的 Transaction 而有自己的回應確認收到。

使用 PRACK 機制,每個暫時回應帶 RSeq 封頭放序號。PRACK 帶 RAck 封頭放要確認暫時回應對應的 RSeq 序號。PRACK 確認並不是 cumulative,為了 congestion control 建議暫時回應 PRACK 後才送下一個。

是否支援或啟用 PRACK 依照 Option Tag 機制,Tag 名稱是 100rel,步驟如下:

  1. UAC 發一開始的 INVITE:Require 或 Supported 放 100rel 表示強制或選用 PRACK。
  2. UAS:
    • 如果強制使用 PRACK 但不支援,回 420 Bad Extension (Unsupported 放 100rel) 後結束。
    • 如果要啟用 PRACK,送非 100 的暫時回應時,放 Require: 100rel 和 RSeq。(exponential backoff?) 重送暫時回應直到收到 PRACK。最後沒收到 PRACK 則回 5xx 拒絕原始請求。重送回應
  3. UAC 收到有啟用 PRACK 的暫時回應:一樣建立 dialog,並送 PRACK 含 RAck,內容是要 acknowledge 的 RSeq 和 CSeq。照一般 Transaction 重送 PRACK。
  4. UAS 收到 PRACK:回 200 OK 並停止重送暫時回應。
新增兩個封頭:RSeq 和 RAck
  • RSeq:只用在可靠的暫時回應,值是 1 ~ 232 - 1 數字。
    Example: RSeq: 988789
  • RAck:只用在 PRACK 請求,內容包括要 acknowladge 的暫時回應的 RSeq 和 CSeq。
    Example: RAck: 776656 1 INVITE
說明
  • PRACK 像一般 SIP 訊息 hop-by-hop 傳送和自己的 response。
  • 100 Trying 是 hop-by-hop,PRACK 是 end-to-end 的機制。
  • 如果有 INVITE 以外需要 100 以外暫時回應的 SIP Method,PRACK 應該也適用。
  • UAS 送 18x 時啟用 PRACK,如果最後成功接聽,除非暫時回應有 SDP 外,可以收到 PRACK 前送最後回應。最後回應後才收到 PRACK 該回 481 還是 200?
  • 重送 ACK 由收到 2xx 驅動,但重送 PRACK 獨立於收到暫時回應,所以暫時回應重送的 exponential backup 毋限 T2。

BNF

PRACKm       = %x50.52.41.43.4B ; PRACK in caps
Method       = INVITEm / ACKm / OPTIONSm / BYEm
               / CANCELm / REGISTERm / PRACKm
               / extension-method
RAck         = "RAck" HCOLON response-num LWS CSeq-num LWS Method
response-num = 1*DIGIT
CSeq-num     = 1*DIGIT
RSeq         = "RSeq" HCOLON response-num

參考

  • 能和 Transaction 整合?
  • exponential backoff (指數型退讓)

BeagleBone Cape Expansion

BeagleBone 有兩組 46 pin headers (P8, P9) 可以接 Cape (披肩)。

P8, P9 pinmux 表

  • P9-5:6 (VDD_5V):可供電給 BeagleBone,跟 DC input jack (P1) 接在一起。
    • 其它可能電力來源:P4 USB-B 插座或電池接點 TP5~8。
  • P9-7:8 (SYS_5V):BeagleBone 電源控制晶片輸出 5V (max. 250 mA),同時供電給 BeagleBone 上的 Host USB、HDMI、和內部 LED,以及轉換成內部其它電壓。
  • P9-3:4 (VDD_3V3B):BeagleBone LDO 輸出 3.3V (max. 250 mA)。
  • P9-9 (PWR_BUT):Power 按鍵。
  • 數位 I/O 訊號是 3.3V,不能用 5V ,且只能在 SYS_RESET high 之後才能驅動
  • P9-10 (SYS_RESETn):通電 (??) 前,避免灌電到其 I/O 接腳,直到 SYS_RESETn 變 high,不然有可能損壞處理器。
    • 按鍵 S1
    • AM335x nRESET_INOUT:Any global reset source (internal or external) causes nRESETIN_OUT to be driven and maintained at the boundary of the device for at least the amount of time configured in the PRCM.PRM_RSTTIME.RSTTIME1 bit field.
    • LAN8710A JTAG
  • 65 GPIO
    • AM335x 有 4 個 GPIO 模組,每個模組有 32 個 GPIO,總共 128 個 GPIO,透過 GPIO 暫存器,可存取資料、設定為中斷等。
  • PWMs and Timers
  • Analog Inputs: ≤1.8V, 12-bit ADC
  • UART1, UART2, UART3 (Tx only), UART4, UART5
  • I2C
    • P9-19:20 預留給 Cape 辨識用,讀取 Cape 堆疊上的 EEPROM,讓軟體辨識,知道用接腳及電源使用情形。每個 Cape 上的 EEPROM 可以設不同位址,讓 Cape 可以堆疊。
    • 註:AM335x 總共有?個 I2C,I2C0 用在電源管理 IC 及 eeprom
  • SPI0, SIP1

  • lcd_xxx 接到 HDMI,其中 lcd_data[15:0] 亦為 SYSBOOT
  • mmc1_xxx 接到 eMMC
  • spi0_cs0, spi0_d1, spi_d0, spi0_sclk 可作為 SPI flash 開機用的 CS, MOSI, MISO, CLK (參考:spruh73k.pdf 4945 頁 26.1.7.6.4 Pins Used)

cap manager

Cape

  • PowerBar:供電

參考

cap manager
cat /sys/devices/bone_capemgr.*/slots

export SLOTS=/sys/devices/bone_capemgr.*/slots
echo BB-BONE-AUDI-02 > $SLOTS



停用 cape
編輯 uEnv.txt 新增
optargs=capemgr.disable_partno=BB-BONELT-HDMI
to disable BB-BONELT-HDMI





dtc -O dtb -o BB-BONE-AUDI-02-00A0.dtbo -b 0 -@ BB-BONE-AUDI-02-00A0.dts



http://elinux.org/Beagleboard:BeagleBoneBlack#Expansion_Header_Usage
http://elinux.org/Beagleboard:Cape_Expansion_Headers



HDMI 透過 I2C0 將內建的 HDMI framer put in low power mode
eMMC


https://groups.google.com/forum/#!msg/beagleboard/AKHfQIuDdZI/S3-F0ZM-39IJ
http://e2e.ti.com/support/arm/sitara_arm/f/791/t/305744.aspx

Shortest Path Bridging

Shortest Path Bridging/fabric networks 101 - part 1, part 2, part 3, part 4, part 5, part 6

https://www.linkedin.com/pulse/shortest-path-bridgingfabric-networks-101-part-4-johnny-hermansen

2021年3月9日 星期二

NiMH 鎳氫電池

鎳氫電池 (NiMH) 由鎳鎘電池 (NiCd) 改良而來的,以能吸收氫的金屬代替鎘 (Cd)。特性
  • 額定電壓 = 1.2V
  • 剛充滿電時電壓(充電電壓) = 約1.4~1.45V
  • 終止電壓 = 0.9~1.0V
  • 能量∕重量 = 60~120 Wh/kg(瓦特小時/公斤)
  • 能量∕體積 = 140~300 Wh/L(瓦特小時/公升)即 504~1188kJ/kg(千焦耳/公斤)
  • 功率∕重量 = 250~1000 W/kg
  • 自放電率 = 一般為每月 20~30%,見溫度而定,低自放電型號為每年10~30%
  • 充放電效率 = 66%
  • 充放電循環次數 = 500~5000次
  • 電池常見型號 = AAAA,AAA,AA,A,S,D,SC
比較
  • 舊款自我放電反應較高,新款已相當低 (與鹼電相當),且可在 -20℃ 低溫下使用。
  • 鎳氫電池比碳鋅或鹼性電池有更大的輸出電流,相對地更適合用於高耗電產品,某些特別型號甚至比普通鎳鎘電池有更大輸出電流。鹼性電池在長期不使用後可能會漏出具輕微腐蝕性及有害液體(會對人體有害又或損壞使用該電池的裝置)。
  • 以相同的價格和鎳鎘電池比較:更高的電容量 (AA 電池可達2900mAh、,而鹼性電池只有~2100mAh(不過鹼性電池初始放電電壓一般高於鎳氫電池),當然也遠高於鎳鎘電池的1100mAh。)、較不明顯的記憶效應、以及較低的環境污染 (不含有毒的鎘)。
  • 和鋰離子電池比較:回收再用效率較好,卻有一定的記憶效應。電容量未及。鋰電池在不適當使用時有機會燃燒或爆炸。
https://zh.wikipedia.org/wiki/鎳氫電池

2021年3月6日 星期六

SIP Authentication

 SIP 認證

--> INVITE/REGISTER

<-- 401 Unauthorized 或 407 Proxy Authentication Required 含 WWW-Authenticate 或 Proxy-Authenticate

--> 請求含  Authorization 或 Proxy-Authorization

RFC 3261 Section 22.2 概述 Authorization 的使用,Section 22.4 說明和 HTTP 認證一起使用時的語法和語意。 Authorization (和 Proxy-Authorization) 多個信頭欄位值不能合併成逗號分隔的列表,要分成多個信頭欄位行。

Authentication-InfoAuthorizationProxy-Authenticate

2021年3月1日 星期一

Intel 處理器比較

處理器速度 GHz快取核心/處理緒TDP製程顯示產品晶片組
i7-1260P????????
i7-1255U????????
i5-1240P4.4, 3.3
124+8/16?????
i5-1235U4.4, 3.3
122+8/1215/55??Asus B1400CBA?
i5-1155G7?84/828~1210???
i5-1135G7 2.4~4.28MB4/828~1210
Iris® XᵉAsus B1400CEAE
i5-1031U 1.7~4.46MB4/81514UHD Asus B9450FA
i5-10210U 1.6~4.26MB4/81514UHDThinkpad X1C 7th
i7-7700 3.6~4.28MB4/86514HD 630 VivoMini VC66
i5-7400 3.0~3.56MB4/46514HD 630 VivoMini VC66
i7-7500U 2.7~3.54MB2/41514HD 620VivoMini VM65N
i5-7200U 2.5~3.13MB2/41514HD 620 VivoMini VM65N
i5-6400T2.2~2.86MB4/43514HD 530 VivoMini VC65RH170
i5-4210U1.7~2.73MB2/41522HD 4400VivoMini UN62
i5-4200U1.6~2.63MB2/41522HD 4400Asus PU301LA
i5-3210M2.5~3.13MB2/43522HD 4000Sony S13HM76

ASUS VivoMini UN62

  • 0.6L 主機 i5-4210U 4G 128GSSD (2016/03/15 $12900) 6.95W
  • half-size mini-PCIe 無線網路卡模組 AW-CB161H 採用 802.11a/b/g/n/ac + Bluetooth v4.0 (Realtek 8821AE 雙頻)
  • 滿載運作噪音 26.3dB
  • USB Charge+ 快速充電功能 (Battery Charging 1.2)
  • 晶片組商用版配置 QM87,家用版配置 HM87。
  • HDMI
    • 沒支援 CEC (ASUS VivoMini UN66 有 CEC 接頭)
    • SUNIX HDMI to VGA轉換器 (H2V37C0) (2016/03/15 $580)
    • 聲音不會自動從 HDMI 輸出:執行 pavucontrol 設定
  • 安裝 Linux
    • 製作 USB 開機碟:µSD 卡插到另一台 Linux 電腦,用 UNetbootin 安裝發行版 Ubuntu 15.10_NetInstall [參考]
    • USB 開機:DEL 或 F2 進入 BIOS 設定啟用 Full USB 功能重開機,硬碟是空的時候直接會選 USB 開機,不然需要進 BIOS 選擇。
    • 安裝:選擇一般的 Ubuntu,最後要完成重開機前有個寫入 MBR 的步驟,預設寫到 USB 是不對的,要進入選擇
  • 設定自動登入
  • 安裝 flashplugin
  • 輸入法 http://liaozi.blogspot.tw/2015/04/ubuntu-1504-ubuntu-1504-chinese-input.html
  • Synergy
  • 2016/12/31 用 UNetbootin 透過 Ubuntu 16.10 mini.iso 改安裝 Lubuntu Desktop
  • http://lirobo.blogspot.tw/2014/06/asus-nb-pu301la-lubuntu-1404.html
  • http://lirobo.blogspot.tw/2013/12/lubuntu-1310.html
  • ASUS VivoMini VC65R
  • 2021/02 開機 (BIOS 版本 1307 2016/12/23)
  • NEWSUN CR2032HF-62 Lithium Battery 3V 210mAh

HDMI CEC

  • Consumer Electronics Control
  • 透過 HDMI 控制電視
  • CEC 是傳輸,使用 DDC 

USB to CEC Adapters:透過 USB 控制 CEC-enabled devices.

一些 HDMI-CEC 指令

  • One Touch Play:單鍵播放
  • System Standby:所有連接的設備 standby
  • Preset Transfer: transfers the tuner channel setup to another TV set
  • One Touch Record:單鍵錄影
  • Timer Programming: allow one device (e.g. a TV set or HTPC) to set the timer programming of another (e.g. a PVR/DVR or DVD-recorder)
  • System Information: checks all components for bus addresses and configuration
  • Deck Control: playback control
  • Tuner Control: control the tuner of another device
  • OSD Display: use the OSD of the TV set to display text
  • Device Menu Control: use the menus of another device
  • Routing Control: control the switching of signal sources
  • Remote Control Pass Through: pass through remote control commands
  • Device OSD Name Transfer: transfer the preferred device names to the TV set

顯示器使用 physical 位址 0.0.0.0 及 logical 位址 0
所有啟用 CEC 的設備會有 physical 及 logical 位址,而非 CEC 裝置只有 physical 位址。Physical 位址是基於設備相對於 root 位置產生。例如:接到 TV 的 HDMI 1 的 A/V receiver physical address 會是 1.0.0.0。接到 A/V receiver 的 HDMI 1 輸入的設備 physical 位址會是 1.1.0.0,接到 HDMI 2 輸入會是 1.2.0.0。

邏輯位址依據功能。
* 0:顯示器
* 15:廣播

When the HDMI device menu is brought up on the display (On a Sony KDL46EX720, this is achieved by pressing the Sync Menu button), the display sends a broadcast over the CEC wire to all the downstream devices. It then collects the responses arriving over the CEC wire and presents the user with a list of CEC enabled devices. Choosing one of them ensures that future remote key presses are transferred by the TV to that particular address.

深入了解:QuantumData's excellent [CEC whitepaper](http://www.quantumdata.com/pdf/CEC_White_Paper.pdf) 及 CEC 規範

Media center systems XBMC 和 MythTV 透過 libCEC 支援 HDMI-CEC; libCEC 在 v1.8.0 支援 Raspberry Pi
http://elinux.org/CEC_(Consumer_Electronics_Control)_over_HDMI
[HDMI CEC protocol](http://kezeodsnx.pixnet.net/blog/post/28219224)
[HDMI CEC 的一點補充](http://www.cash.idv.tw/wordpress/?p=8411)
[CEC Addressing - Quantum Data](www.quantumdata.com/pdf/CEC_HDMI_Conference_Final.pps)

BRAVIA Sync

 

遙控器修理

用數位相機看發光二極體有沒有動作
  • 人的眼睛看不到紅外光,數位相機可接收到的光譜範圍比眼睛還廣,只要按下遙控器的按鍵並同時用數位相機對準遙控器的發射端拍攝,就可以看到紅外線發射二極體有沒有發光了

振盪器
紅外線發光二極體
按鍵不靈光

參考:

SIP header Via

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