close

 為了達成HDLC規範,我們定義一個函式集service primitives(服務基礎呼叫),

 其中裡面包含:

 四個函式:

        要求,request()

        通知,indicate()

        回應,response()

        確認,confirm()

 和

三種服務參數:

1. 給對等層(對方的data lnk layer)的參數(成為frame封包的一部分,例:address, control information)

2. 傳給應用層(不加密)

3. 區域變數(local variable)

本規範僅規定第1種參數,包含:

# 對等層之間交換資訊的過程

# 控制資訊的正確解碼過程

# 層的行為

 

LLC與MAC

基本上所有的service都由 MAC layer 提供,LLC 則提供使用者和 mac layer 間透明的傳輸 (如 DL-connect,DL-disconnect )

---------------------------------------------------------------------------------------------------------

DL-CONNECT

 .req(request 請求):

    #僅在 client 端產生,由 User Layer 向 LLC Layer 請求建立連結。
    #參數:
    (
        destination_MSAP (目的端 MAC 的 SAP)       // 相當於HDLC地址    
        source_MSAP (來源端 MAC 的 SAP)
        User_information                        // 本文件不包含此資訊規定
    )

 .ind(indicated 通知):
    #僅在 server 端產生,由 LLC layer 向 User Layer 通知要求建立連結。
    #參數:
    (
        Destination_MSAP (目的端 MAC 的 SAP)       // 相當於HDLC地址    
        Source_MSAP (來源端 MAC 的 SAP)
        User_information                        // 本文件不包含此資訊規定
    )
    
 .res(response):
    #僅在 server 端產生,由 User Layer 回應 LLC Layer 此資料連結是否被 User Layer 接受。
    #參數:
    (
        Destination_MSAP (目的端 MAC 的 SAP)       // 相當於HDLC地址    
        Source_MSAP (來源端 MAC 的 SAP)
        Result
        User_information                        // 本文件不包含此資訊規定
    )
        result = OK,連線請求可被 User Layer 接受
        result = NOK,   ""  不被 User Layer 接受
        result = NO_RESPONSE,    User layer 無回應
    #User_Information 僅在 result = NOK 時才存在。
    #Result 僅指出連結請求是否被 server 端的 User Layer 接受,DL Layer本身還是可以拒絕所提出的連結 (例如在某一時刻只能接受一個連結,不能接受第二個)

 .cnf(confirm):
    #僅在 Client 端提供,他可以在 Client 或 Server 端產生,DL Layer 利用該原語回應之前 DL-CONNECT.req 的結果。
    #參數:
    (
        Destination_MSAP (目的端 MAC 的 SAP)       // 相當於HDLC地址    
        Source_MSAP (來源端 MAC 的 SAP)
        Result
        User_information                        // 本文件不包含此資訊規定
    )
        result = OK,連線請求可被 Server 端接受
        result = NOK-REMOTE,   ""  不被 Server 端接受
        result = NOK-LOCAL,    ""  本地出現差錯,例如,User Layer 試圖建立已有的資料連結
        result = NO_RESPONSE,    User layer 無回應
    #User_Information 僅在 result = NOK 時才存在。
    #若User Information存在,其中包含為何遠端站不接受連結要求。

LLC Layer 使用此原語向 User Layer 指出 MAC Layer 層的接收。
---------------------------------------------------------------------------------------------------------
DL-DISCONNECT

 .req(request)
    #僅由 client 端提出 request
    #參數:
    (
        Destination_MSAP (目的端 MAC 的 SAP)       // 相當於HDLC地址    
        Source_MSAP (來源端 MAC 的 SAP)
        User_information                        // 本文件不包含此資訊規定
    )
 .ind(indicated)
    #
    #參數:
    (
        Destination_MSAP (目的端 MAC 的 SAP)       // 相當於HDLC地址    
        Source_MSAP (來源端 MAC 的 SAP)
        Reason
        Unnumbered Send Status
        User_information                        // 本文件不包含此資訊規定
    )
        Reason = REMOTE ,表示server端從client端接收到diconnect指令
        Reason = LOCAL_DL ,表示有嚴重的 DATA LINK 故障
        Reason = LOCAL_PHY ,表示有Physic Layer 連結故障
        
        Unnumbered Send Status = 1,有待決的UI消息
        Unnumbered Send Status = 0,沒待決的UI消息
 .res(response)
    #參數:
    (
        Destination_MSAP (目的端 MAC 的 SAP)       // 相當於HDLC地址    
        Source_MSAP (來源端 MAC 的 SAP)
        result
    )
        result = OK ,表示收到一個 disconnect 要求對應到已存在的連結
        result = NOK ,表示收到一個 disconnect 要求對應到一個不存在的連結
 .cnf(confirm)
    #參數:
    (
        Destination_MSAP (目的端 MAC 的 SAP)       // 相當於HDLC地址    
        Source_MSAP (來源端 MAC 的 SAP)
        result
    )
        result = OK , 表示斷開請求被接受
        result = NOK , 表示斷開沒有被遠端接受
        result = NO_RESPONSE , 表示遠端無回應
-----------------------------------------------------------------------------
DL-DATA
 .req(request)
    #僅由 client 端提出 request
    #參數:
    (
        Destination_LSAP (目的端 LLC 的 SAP)           
        Source_LSAP (來源端 LLC 的 SAP)
        LLC_Quality(屬性)
        Destination_MSAP (目的端 MAC 的 SAP)       // 相當於HDLC地址    
        Source_MSAP (來源端 MAC 的 SAP)
        Frame_type
        Data
    )
    
    參照到COSEM,Destionation_LSAP 是常數通常為" E6H ",Source_LSAP 則根據是命令或是回應,"E7H" "E6H"
    Destination_MSAP可以是一個獨立的位址,一組位址或一個特殊的HDLC位址
    Frame_type、Data在之後會說明。
 .ind(indicated)
    #參數:
    (    Destination_LSAP (目的端 LLC 的 SAP)       // 相當於HDLC地址    
        Source_LSAP (來源端 LLC 的 SAP)
        LLC_Quality(屬性)
        Destination_MSAP (目的端 MAC 的 SAP)       // 相當於HDLC地址    
        Source_MSAP (來源端 MAC 的 SAP)
        Frame_type
        Data                // 本文件不包含此資訊規定
    )
    
 .res(response)
    #參數:
    (
        Destination_MSAP (目的端 MAC 的 SAP)       // 相當於HDLC地址    
        Source_MSAP (來源端 MAC 的 SAP)
        result
    )
        result = OK ,表示收到一個 disconnect 要求對應到已存在的連結
        result = NOK ,表示收到一個 disconnect 要求對應到一個不存在的連結
 .cnf(confirm)
    #參數:
    (
        Destination_LSAP (目的端 LLC 的 SAP)       // 相當於HDLC地址    
        Source_LSAP (來源端 LLC 的 SAP)
        Destination_MSAP (目的端 MAC 的 SAP)       // 相當於HDLC地址    
        Source_MSAP (來源端 MAC 的 SAP)
        Frame_type
        result
    )
        result = OK , 表示斷開請求被接受
        result = NOK , 表示斷開沒有被遠端接受

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 tommychou1229 的頭像
    tommychou1229

    tommychou1229的部落格

    tommychou1229 發表在 痞客邦 留言(0) 人氣()