⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 net_design.nr

📁 早期freebsd实现
💻 NR
📖 第 1 页 / 共 3 页
字号:
allbox, tab(+);l l l l.Option+Send+Forward+Receive=Padding+may be set+-+-Security+reject+ignore+discardSource Route+\fIclnp_srcroute()\fR+\fIclnp_srcroute()\fR+-Record Route+-+\fIclnp_dooptions()\fR+-QOS+added+congestion bit set+tpclnp_ctlinput()Priority+reject+ignore+-.TE.)b.sh 2 "DT NPDU Segmentation".ppSegmentation is the process by which initial NPDUs are segmented into smaller derived NPDUs when the initial NPDU is too large for transmissionon a network interface.Segmentation is accomplished by \fIclnp_fragment()\fR. This function chops the NPDU into pieces and individually places the piecesin the appropriate network interface's output queue. Each piece is made as large as possible. Note: The phrase "fragmentation" is used synonymously with "segmentation"throughout this prose and the CLNP fragmentation code. This is due to this author's familiarity with the DoD Internet Protocol which usesthe term "fragment.".sh 2 "DT NPDU Reassembly".ppDerived NPDUs are put back together by the process called reassembly. Reassembly is performed only at the destination end system.When a derived NPDU arrives, it is passed to \fIclnp_reass()\fR. This function scans a linked list of NPDUs awaiting reassembly. Each packet in the list is represented by a fragment listdescriptor, which is stored in an \fImbuf\fR:.(b\fC.TStab(+);l s s s.struct clnp_fragl {.T&l l l l.+struct iso_addr+cfl_src;+/* source */+struct iso_addr+cfl_dst;+/* destination */+u_short+cfl_id;+/* id of the pkt */+u_char+cfl_ttl;+/* time to live */+u_short+cfl_last;+/* offset of last +++byte of packet */+struct mbuf +*cfl_orighdr;+/* ptr to +++original header */+struct clnp_frag+*cfl_frags;+/* linked list +++of fragments */+struct clnp_fragl+*cfl_next;+/* next pkt be-+++ing reassembled */};.TE\fR.)bThe fields \fIcfl_src\fR, \fIcfl_dst\fR, and \fIcfl_id\fR are used tomatch an incoming derived NPDU with a fragment list. \fICfl_orighdr\fR contains a copy of the NPDU header of the first fragment received. The linked list of fragments pertaining to the packet is stored in the\fIcfl_frags\fR field. Each NPDU fragment represented by a \fIclnp_frag\fR structure, stored in an \fImbuf\fR:.(b\fC.TStab(+);l s s s.struct clnp_frag {.T&l l l l.+u_int+cfr_first;+/* offset of +++first byte of this frag */+u_int+cfr_last;+/* offset of last +++byte of this frag */+u_int+cfr_bytes;+/* bytes to shave */+struct mbuf+*cfr_data;+/* ptr to data */+struct clnp_frag+*cfr_next;+/* next frag */};.TE\fR.)bThe fields \fIcfr_first\fR and \fIcfr_last\fR indicate the first andlast octet of the fragment. \fICfr_data\fR points to an mbuf chainwhich contains the data for the fragment..ppIf \fIclnp_reass()\fR finds a \fIclnp_fragl\fR structure matching theincoming derived NPDU, \fIclnp_insert_frag()\fR is called to createa \fIclnp_frag\fR structure and insert it in the linked list ofpacket fragments. If no \fIclnp_fragl\fR structure is found, \fIclnp_newpkt()\fR is invoked to create a new fragment list structure..ppThe last task \fIclnp_reass()\fR performs is to check if the fragmentthat just arrived completes the reassembly of the initial NPDU. If it does, the reassembled NPDU is rearranged to look like it just arrived intact.It accomplishes this by linking the \fImbuf\fRs holdingthe fragments into one \fImbuf\fR chain that represents the initialNPDU.A pointer to this \fImbuf\fR chain is returned by \fIclnp_reass()\fR..ppIf the newly arrived fragment does not complete an initial NPDU, \fIclnp_reass()\fR returns NULL..sh 3 "Reassembly Lifetime Control".ppOne function of the CLNP is to preventa proliferation of fragments awaiting reassembly fromconsuming buffers in an end system for indefinite periods of time.This function is called reassembly lifetime control.It is accomplished by periodic traversal ofthe list of \fIclnp_fragl\fR structures, decrementing the \fIcfl_ttl\fR field. This field is a copy of the NPDU time-to-livefield. If \fIcfl_ttl\fR reaches zero, all resources associated with thefragment are released.The procedure\fIclnp_slowtimo()\fR, which is called by the systemclock every 500 milliseconds (every half-second),performs the CLNP reassembly lifetime control..sh 2 "ER NPDU".ppAn ER NPDU is sent to the originator of a packet when a DT NPDU isdiscarded and the error report function is not suppressed. Suppressionof the error report function is accomplished by setting the "no ER"bit in the CLNP header.A packet is discarded by \fIclnp_discard()\fR. Before itreturns the \fImbufs\fR used to store the the discarded packet to the \fImbuf\fR free list,\fIclnp_discard()\fR determines if the error report function is suppressed. If not, an ER NPDU will be sent to the originator of the discarded packet bycalling \fIclnp_emit_er()\fR..pp\fIClnp_emit_er()\fR will create an ER NPDU, address it to the originator of the discarded packet, route the NPDU, and transmit it, sending the header of the discarded NPDU as data. ER NPDUs may not be segmented. If the ER NPDU is too large for the outgoing network interface, the packet is truncated..sh 2 "Raw CLNP".ppIn order to test CLNP in isolation from higher layerprotocols, ARGO provides a \*(lqraw\*(rq interface to CLNP.This raw interface is selected with the \fISOCK_RAW\fR parameter tothe\fIsocket()\fRsystem call.When a \*(rqraw\*(rq socket is open,and CLNP receives an NPDU,CLNP must determine whether the incoming NPDU is destined forthe \*(rqraw\*(rq interface or for the interface to the OSI transport protocol entity.ARGO addresses this problem by using non-standard NPDU typesfor packets sent on \*(rqraw\*(rq sockets.The type field in the CLNP NPDU headeris set to \fICLNP_RAW\fR (hex 1d) rather than \fICLNP_DT\fRin NPDUs that originate from \*(rqraw\*(rq sockets.This non-standard type value is used by \fIclnp_input()\fRto decide which upper layer protocol should receive the packet.See \fIclnptest(8)\fR for more information about the.\*(rqraw\*(rq CLNP interface..sh 2 "CLNP Echo".ppIn the DoD world, ICMP supports an \fIecho\fR service. This allows one to \*(lqping\*(rq a distant gateway and to receive an echo response (a packet in return) if the gateway is working.There is no counterpart to \*(lqecho\*(rq in ISO 8473 (CLNP). ARGO provides this non-standard feature in its connectionlessnetwork layer..ppLike raw CLNP, implementing an echo function requires a non-standardNPDU type value to allow\fIclnp_input()\fR to differentiate between a DT NPDU to be forwardedor passed to a higher layer protocol, and an NPDU that is to be echoed.When requesting an echo, the CLNP type field is set to \fICLNP_EC\fR (hex 1E) ratherthan CLNP_DT. When \fIclnp_input()\fR receives a packet with type\fICLNP_EC\fR, it swaps the source and destination addresses, sets thetype field to \fICLNP_ECR\fR (hex 1F) and forwardsthe packet back to the sender. See also \fIclnpping(8)\fR..sh 2 "Timers".ppThe only timer used by CLNP is the 500 millisecond timer, which is user for reassembly lifetime control.See the section \*(lqReassembly Lifetime Control.\*(rq.sh 1 "End System to Intermediate System Routing Protocol (ES-IS)".\" ROB.sh 2 "Overview".ppThis section describes the implementation of the ES-IS routing protocol.This protocol is used primarily to resolve NSAP address to SNPA address translations. It is also used to identify end systemsand intermediate systems onthe local subnetwork. All of this work is accomplished by transmittingpackets of the type End System Hello (ESH), Intermediate System Hello (ISH)and Request Redirect (RD)..ppFor the purpose of this section, the following definitions of end system (ES)and intermediate system (IS) apply..ip \(bu 5An \fIend system\fR is an open system thatis an OSI end system in the standard OSI sense(that it supports a full OSI protocol suite in addition to the network layer)and thatimplements the functions of thethe ES-IS protocol that are mandatory for end systems,such as the Query Configuration function and the Record Redirectfunction,but that does not implementthe functions of the ES-IS protocol that are for intermediate systems..ip \(bu 5An \fIintermediate system\fR is an open system thatis an OSI intermediate system in the standard OSI sense(that it performs packet routing in the network layer)and thatimplements the functions of thethe ES-IS protocol that are mandatory for intermediate systems,such as the Request Redirect function, but not the functions of the ES-IS protocol that are for end systems..ppWhile system may be an ES or an IS or both according to thestandard OSI definitions, this is not the case in the context ofthe ES-IS protocol..ppAn ARGO system is by default an end system, by the definitions given above.An ARGO system can be made to function as an intermediate systeminstead of an end system with the \fIclnlutil\fR program. See \fIclnlutil(8)\fR for more information..sh 2 "Report Configuration Function".ppThe report configuration function is used by end systems and intermediatesystems to inform each other of their reachability and current subnetworkaddresses. This function is invoked whenever the configuration timerexpires. This timer fires at a frequency of once every\fIesis_config_time\fR seconds. By default, this value is 60 (seconds), but it may be changed with the \fIclnlutil\fR program..ppThe report configuration function is contained in the C function \fIesis_config()\fR. Called every \fIesis_config_time\fR seconds, \fIesis_config()\fR searches the list of active network interfacescalling \fIesis_shoutput\fR for each interface that is up, hasbroadcast ability and has an ISO address configured..ppThe function \fIesis_shoutput()\fR has the responsibility of building and transmitting ESH and ISH packets.It takes several arguments, including  a pointer to a network interfaceanda packet type (ESH or ISH).If the packet type is ESH, theneach NSAP address configured on the specified interface is added tothe ESH NPDU. ISH NPDUs may only contain a single NSAP address\**..(f\** Actually, ISH packets contain Network Entity Titles (NETs). ARGOdoes not make a distinction between NETs and NSAPs..)fAfter the packet is built, it is transmitted on the subnetwork. ESH packetsare sent to the multicast address \fIall intermediate systems\fR, whereasISH packets are sent to the multicast address \fIall end systems\fR..ppEach ISH and ESH NPDU contains a holding timer setting. This setting (specified in seconds) is used by the receiver of the NPDU to set itsholding timer. When its holding timer expires, the information fromthe NPDU is erased. The holding timer value sent on each ISH and ESH NPDUis contained in the variable \fIesis_holding_time\fR. By default, thistimer setting is 120 seconds. This value may be changed with the \fIclnlutil\fR utility program..sh 2 "Record Configuration Function".ppThe Record Configuration function receives ESH or ISH NPDUs, extracts theconfiguration information, and updates kernel-resident tables. The two functions \fIesis_eshinput()\fR and \fIesis_ishinput()\fR process incoming ESH and ISH NPDUs, respectively..ppThe ES-IS entity maintains a table thatassociates a SNPA-addresses with NSAP-addresses.This table is called the \fISNPA cache\fR..ppWhenever an ESH or ISH NPDU is received, an entry is made in the SNPA cachevia the \fIsnpac_add()\fR function. This entry is kept in the cache until the holding timer expires. In addition to adding an entry to the SNPA cache, \fIsnpac_add()\fR createsa default ISO route toward the sender of the ISH.One such route is kept so that the ES-IS entity has at most oneroute to an IS at any time.Note that ISHs from different sources will cause the route to the source of the earlier ISH to be overwritten.The default routewill be removed when the ISH holding timer expires..ppIf, at the time an ESH or ISH NPDU is received, the SNPA cachecontains no entry for the NSAP address in the NPDU just received, an ESH or ISH (depending on the system type) NPDU istransmitted to the sender of the NPDU just received..sh 2 "Resolving NSAP addresses to SNPA addresses: Query Configuration Function".ppWhenever a device driver needs to resolve an NSAP address to an SNPA address, it calls \fIiso_snparesolve()\fR. This function first looksup the NSAP address in the SNPA cache. If a match is found, thecorresponding SNPA address is returned. If a match is not found and thesystem is an end system, and there is a known intermediate system, thenthe SNPA address of the intermediate system is returned. It is assumed thatthe intermediate system will forward the packet and transmit a redirect back(see "Redirection Generation", below).If a match is not found and the system is an end system, but there is noknown intermediate system, then \fIiso_snparesolve()\fR will return the multicast address \fIall end systems\fR. In all other cases, \fIiso_snparesolve()\fR will return an error.This is known as the query configuration function. .sh 3 "Configuration Response Function".ppIn order for the query configuration function to be effective, the networkentity that receives a CLNP DT sent to the \fIall end system\fRmulticast address must transmit an ESH back to the sender of the DT.This is called the configuration response function and is accomplished bycalling \fIsh_output()\fR from within \fIclnp_input()\fR..sh 2 "Redirection Generation".ppWhen an intermediate system forwards a packet onto the same interface upon which the packet arrived, a redirect (RD) NPDU is generated. This NPDU istransmitted by calling \fIesis_rdoutput()\fR from within \fIclnp_forward()\fR.Note that end systems may forward packets but they do not generate RD PDUs..sh 2 "Redirection Receipt".ppRD NPDUs direct an end system to create an SNPA cache entry for an NSAP address, or, if such an entry exists, to changethe SNPA address associated with the NSAP address.The receipt of RD NPDUs is handled by \fIesis_rdinput()\fR. This functionparses the RD NPDU and adds an entry to the SNPA cache for the correspondingdestination NSAP address.If the redirect is toward an intermediate system,meaning that the RD NPDU contains an SNPA addressof an intermediate system (gateway),a route is created for the destination NSAP with the intermediate system asthe first hop, or gateway, in the route..sh 2 "Multicast Addresses".ppAs specified by the December 1987 NBS agreements, the address\fIall end systems\fR is {0x09, 0x00, 0x2B, 0x00, 0x00, x04} and the address\fIall intermediate systems\fR is {0x09, 0x00, x02B, 0x00, 0x00, 0x05}. These multicast addresses are only used on the 802.3 subnetwork (baseband).Broadcast addresses are used on the 802.5 subnetwork (token ring). Seethe comment in \fC/sys/netargo/iso_snpac.c\fR for more information on multicast addresses..sh 1 "Connection Oriented Network Service and Subnetwork Service".ppThe following sections describe the design of the Connection Oriented Network Service (CONS) and the Connection Oriented Subnetwork Service(COSNS).The CONS and COSNS are provided by two functionally separate but relatedmodules, a connection manager and the ISO 8208 (X.25) protocols.The connection manager is also known in OSI terminology as a subnetwork dependent convergence function, or SNDCF.In ARGO it is used for more than an SNDCF, and it is a sort of "glue" that binds a transport service, a network service, asubnetwork service, and a device driver together, so hereinafter it is called "the glue".This code performs the some of the functions of ISO 8878,which specifies how ISO 8208 (X.25) can be used to provide the OSI 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -