# P4 MIDTERM # 01 * SDN 可以區分 priority * 應用 * Seamless Mobility * Server Load Balancing # 03 ## OpenFlow Port * Physical Ports * Logical Ports * Packet Encapsulation * abstraction * Reserved Ports * OpenFlow Port * Flood * action list != aciotn set * 每一個 table (meter, flow, group) 都有自己的 counter, 但是 meter table 可以用來做流量監測 ## Controller 和 Switch 的互動方式 * Controller to switch * Asychronous * Symmetric ## Message Handling * Delivery: Switch 一定會收到 controller 寄來的 msg * Processing: Switch 一定會處理 controller 送來的每一個封包,否則會回傳 error;但是 controller 只必須回 HELLO 和 ECHO * Ordering: 在 barrier 之前的 packet 必須先做完。 * Bundle: 從 controller 來的 atomic operation # 04 ## SDN * OFDPA - SDN 的 vendor 要照這個標準做。 * Switch 不會改 ethernet mac address 但 router 會 ## P4 * P4 可以: * 執行 middle box function * protocol independence should not tied to specific packet formats * target independence Programer need not know the detail of underlying switch * 自訂 header * inter table metadata * P4 包含 * Parser 會用到 metadata 和 header * Match + Action (Tables) * Queue (在中間的 buffer 中 -> 避免 multicast 時要複製太多份) Queueing discipline 是內建的 * Control program ## INT * INT 讓 data plane 自己產生可以帶著走的統計資料 像是 switch ID、hop latency、time stamp、queue occupancy 等等 # 05 ## mtag ### header * header types: declare header and metadata instances * valid() (if extracted) * unsigned and non-saturating * keyword: length、max_length (被放在 header 中,但是是 field 外) * 可以在 parsing 和 match + action 被 reference * valid 的 header 會再被重組成 egress packet * 想要用 payload 的資料,就要把她當作 header 來用 (但要 200 bytes 以內) * match+action 可以透過 `add_header` 和`remove_header` 來讓 header valid 或 invalid #### header stack * keyword: next (被 invoke 以後自動往後移), last (上一次 extract 的那個 index) * next 和 last 只能被用在 parser ### metadata * 一個 packet 在同一個 switch 可以用的資料 * 有一些系統保留的 metadata,有特別的動作 * Always valid * 只能在 match + action 被 reference * 有一些 intinsic metadata 以及 read-only 的 * egress_spec: physical port, locial port 或是 multicast group * egress_port: 出去的實體 port number ## MPLS * 省去 ip routing 的 LPM * 需要再 L2 的 ethernet type 被標明 ## field list * 把一些 **instance** 一起做計算,參數可以是 header 或是 metadata ``` field_list 13_hash_fields { ipv4.srcAddr; ipv4.dstAddr; ipv4.protocol; tcp.sport; tcp.dport; } ``` * 可以用 field_list_calculation 來把整包做計算做宣告 * calculated_field keyword: verify (在封包近來的時候計算), update (在封包出去的時候計算),然後再更新 header 的某個 field (如 ipv4.hdrChecksum) ## Parser * keyword: start、lastest (上一個 extract 出來的 header) * Parse Representation: set of valid header instances,再來會被 deparser 包一包傳出去 * 可以 return * 下一個 parser function * 要執行的 control function * explicit parse_error * implicit parse_error * Error handling case * drop: 直接丟掉 * process: special metadata is set and packet sent to control function
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up