📄 rfc1329.txt
字号:
RFC 1329 Address Resolution for Dual MAC FDDI Networks May 1992 by Provider: TIMER_response(Timer_id : timer_name_type; subscript : integer);10.3. The Module Header and Interaction Points module LS_module systemprocess; ip LS_ARPSAP : SAPchn(Provider); LS_IPSAP : SAPchn(Provider); SNAP1_ARPSAP : SAPchn(User); SNAP1_LSSAP : SAPchn(User); SNAP1_IPSAP : SAPchn(User); SNAP2_ARPSAP : SAPchn(User); SNAP2_LSSAP : SAPchn(User); SNAP2_IPSAP : SAPchn(User); LS_System_Access_Point : System_Access_Point_chn(User); end;10.4. The Modulebody of the Load Sharing Entity body LS_body for LS_module; module multiplexer_module process; ip LS_IPSAP : SAPchn(Provider); SNAP1_IPSAP : SAPchn(User); SNAP2_IPSAP : SAPchn(User); end; module cache_administration_module process; ip LS_ARPSAP : SAPchn(Provider); SNAP1_ARPSAP : SAPchn(User); SNAP1_LSSAP : SAPchn(User); SNAP2_ARPSAP : SAPchn(User); SNAP2_LSSAP : SAPchn(User); LS_System_Access_Point : System_Access_Point_chn(User); end; body cache_administration_body for cache_administration_module; (* defined later *) end; body multiplexer_body for multiplexer_module; (* defined later *) end; modvar cache_administration : cache_administration_module;Kuehn [Page 15]RFC 1329 Address Resolution for Dual MAC FDDI Networks May 1992 multiplexer : multiplexer_module; initialize begin ethernet := 1; ip := 2048; fddi_addr_length := 6; ip_addr_length := 4; init cache_administration with cache_administration_body; init multiplexer with multiplexer_body; attach LS_IPSAP to multiplexer.LS_IPSAP; attach SNAP1_IPSAP to multiplexer.SNAP1_IPSAP; attach SNAP2_IPSAP to multiplexer.SNAP2_IPSAP; attach LS_ARPSAP to cache_administration.LS_ARPSAP; attach SNAP1_ARPSAP to cache_administration.SNAP1_ARPSAP; attach SNAP1_LSSAP to cache_administration.SNAP1_LSSAP; attach SNAP2_ARPSAP to cache_administration.SNAP2_ARPSAP; attach SNAP2_LSSAP to cache_administration.SNAP2_LSSAP; attach LS_System_Access_Point to cache_administration. LS_System_Access_Point; end; end;10.5. The Modulebody for the Multiplexerbody multiplexer_body for multiplexer_module;type Type_of_addr_type = (individual, multi, broad); ring_type = (primary, secondary);var act_S_MAC_addr : HW_addr_type;function determ_addrtype(HW_addr: HW_addr_type): Type_of_addr_type;primitive;(* Returns the type of a hardware address. (Individual, multicast or broadcast address)*)function get_cacheentry(prtype: integer; P_MAC_addr: HW_addr_type; var S_MAC_addr : HW_addr_type): boolean;primitive;(* Returns the associated secondary MAC address for a given primary MAC address and protocol type. If an entry exists, the value TRUE is returned.*)Kuehn [Page 16]RFC 1329 Address Resolution for Dual MAC FDDI Networks May 1992function ls_criteria : ring_type;(* Returns the ring on which the actual frame should be transmitted.*)primitive;transwhen LS_IPSAP.UNITDATA_request(Source_addr,Dest_addr,QoS,PDU) begin if determ_addrtype(Dest_addr) <> individual then output SNAP1_IPSAP.UNITDATA_request(Source_addr,Dest_addr,QoS,PDU); else begin if get_cacheentry(ip,Dest_addr,act_S_MAC_addr) and (ls_criteria=secondary) then output SNAP2_IPSAP.UNITDATA_request(My_S_MAC_addr, act_S_MAC_addr,QoS,PDU); else output SNAP1_IPSAP.UNITDATA_request(Source_addr,Dest_addr,QoS,PDU); end;end;when SNAP1_IPSAP.UNITDATA_indication(Source_addr,Dest_addr,QoS,PDU)begin output LS_IPSAP.UNITDATA_indication(Source_addr,Dest_addr,QoS,PDU);end;when SNAP2_IPSAP.UNITDATA_indication(Source_addr,Dest_addr,QoS,PDU)begin if determ_addrtype(Dest_addr) = individual then begin Dest_addr := My_P_MAC_addr; output LS_IPSAP.UNITDATA_indication(Source_addr,Dest_addr,QoS,PDU); end;end;10.6. The Modulebody for the Cache Administrationbody cache_administration_body for cache_administration_module;type arp_pdu_type = record hwtype : integer; prtype : integer; HW_length : integer; PR_length : integer; operation : (request,reply); HW_sender : HW_addr_type; PR_sender : PR_addr_type; HW_receiver : HW_addr_type;Kuehn [Page 17]RFC 1329 Address Resolution for Dual MAC FDDI Networks May 1992 PR_receiver : PR_addr_type; end; dmarp_operation_type = (request,reply,error,search,found,query,hold); dmarp_pdu_type = record hwtype : integer; prtype : integer; HW_length : integer; PR_length : integer; operation : dmarpoperation_type; HW_1 : HW_addr_type; HW_2 : HW_addr_type; PR_sender : PR_addr_type; PR_receiver : PR_addr_type; end;var arp_pdu : arp_pdu_type; dmarp_pdu : dmarp_pdu_type; send_pdu : dmarp_pdu_type; act_P_MAC_addr : HW_addr_type;function my_pr_address(prtype : integer ; praddr : PR_addr_type):boolean;(* Returns TRUE, if praddr is my station address, the protocol type is prtype. (2048d for the Internet protocol)*)primitive;function get_my_pr_addr(prtype : integer) : PR_addr_type;(* Returns my station address, the protocol has the number prtype.*)function extract_arp_pdu(PDU : PDU_type) : arp_pdu_type;(* Returns the data contained in an ARP PDU as a record.*)primitive;function extract_dmarp_pdu(PDU : PDU_type) : dmarp_pdu_type;(* Returns the data contained in an DMARP PDU as a record.*)primitive;Kuehn [Page 18]RFC 1329 Address Resolution for Dual MAC FDDI Networks May 1992function assemble_dmarp_pdu(dmarp_pdu : dmarp_pdu_type): PDU;(* Returns a DMARP PDU from the data in the record.*)primitive;procedure create_entry(prtype: integer; P_MAC_addr: HW_addr_type; S_MAC_addr: HW_addr_type; LS_Bit: flag; OR_Bit: flag; H_Bit: flag; Q_Bit: flag; R_Bit: flag; V_Bit: flag);(* Creates a new entry in the address cache, if no entry with the given primary MAC address or R-bit set to one exists. The protocol type has the number prtype. The control bits are set as given in the parameters, the LS-bit is set last.*)primitive;function search_entry(prtype : integer; P_MAC_addr : HW_addr_type):boolean;(* Returns TRUE if an entry with the primary MAC address P_MAC_addr and the given protocol type was found in the address cache.*)primitive;procedure update_entry(prtype: integer; P_MAC_addr: HW_addr_type; S_MAC_addr: HW_addr_type);(* Searches an entry with the given primary MAC address P_MAC_address and updates the secondary MAC address in the entry if the R-bit is set to zero.*)primitive;procedure reset_LS_bit(prtype: integer; P_MAC_addr : HW_addr_type);(* Searches an entry with the given primary MAC address P_MAC_address and resets the LS-bit if the R-bit is reset.*)primitive;procedure set_Q_bit(prtype: integer; P_MAC_addr : HW_addr_type);(* Searches an entry with the given primary MAC address P_MAC_address and sets the Q-bit if the R-bit is reset.*)primitive;Kuehn [Page 19]RFC 1329 Address Resolution for Dual MAC FDDI Networks May 1992function H_bit_set(prtype: integer; P_MAC_addr : HW_addr_type):boolean;(* Returns TRUE if an entry exists with H-bit set to one and the given P-MAC address.*)primitive;function OR_bit_set(prtype: integer; P_MAC_addr : HW_addr_type):boolean;(* Returns TRUE if an entry exists with OR-bit set to one and the given P-MAC address.*)primitive;function LS_bit_set(prtype: integer; P_MAC_addr : HW_addr_type):boolean;(* Returns TRUE if an entry exists with LS-bit set to one and the given P-MAC address.*)primitive;function Q_bit_set(prtype: integer; P_MAC_addr : HW_addr_type):boolean;(* Returns TRUE if an entry exists with Q-bit set to one and the given P-MAC address.*)primitive;function get_subscript(prtype: integer; P_MAC_addr : HW_addr_type):integer;(* Returns the subscipt number of an entry with the given primary MAC address.*)primitive;function get_broadcast_addr(prtype : integer): PR_addr_type;(* Returns the broadcast protocol address for the given protocol type.*)function get_P_MAC_addr(subscript : integer) : HW_addr_type;(* Returns the primary MAC address of the entry with the given subscriptKuehn [Page 20]RFC 1329 Address Resolution for Dual MAC FDDI Networks May 1992 number.*)primitive;function get_S_MAC_addr(prtype: integer; P_MAC_addr: HW_addr_type): HW_addr_type;(* Returns the secondary MAC address of the station with the given primary MAC address.*)primitive;procedure delete_entry(subscript : integer);(* Deletes the entry with the given subscript number if the R-bit is reset.*)primitive;function get_pr_type(subscript : integer) : integer;(* Returns the protocol type for the entry with the given subscript number.*)primitive;function get_pr_length(prtype : integer) : integer;(* Returns the length of a protocol address.*)primitive;transwhen LS_ARPSAP.UNITDATA_request(Source_addr,Dest_addr,QoS,PDU)begin arp_pdu := extract_arp_pdu(PDU); output SNAP1_ARPSAP.UNITDATA_request(Source_addr,Dest_addr,QoS,PDU); dmarp_pdu.hwtype := ethernet; dmarp_pdu.prtype := arp_pdu.prtype; dmarp_pdu.HW_length := fddi_addr_length; dmarp_pdu.PR_length := arp_pdu.PR_length; dmarp_pdu.operation := reply; dmarp_pdu.HW_1 := My_P_MAC_addr; dmarp_pdu.HW_2 := My_S_MAC_addr; dmarp_pdu.PR_sender := arp_pdu.PR_sender; dmarp_pdu.PR_receiver := arp_pdu.PR_receiver;Kuehn [Page 21]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -