📄 c-dll5.html
字号:
<td colspan="20"></td></tr></table></p></p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="85859">3.5.3 Sequential Addressing</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85861"> </a>Sequential addressing is a method of assigning IP addresses to processors on the network based on their processor number. Addresses are assigned in ascending order, with the master having the lowest address, as shown in <a href="c-dll5.html#85869">Figure 3-4</a>.<div class="frame"><h4 class="EntityTitle"><a name="85869"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 3-4: Sequential Addressing</font></a></h4><dl class="margin"><div class="Anchor"><a name="85898"> </a><img class="figure" border="0" src="images/c-dlla4.gif"></div></dl></div></p><dd><p class="Body"><a name="85899"> </a>Using sequential addressing, a target on the shared-memory network can determine its own IP address. Only the master's IP address need be entered manually. All other processors on the backplane determine their IP address by adding their processor number to the starting IP address. </p><dd><p class="Body"><a name="85900"> </a>Sequential addressing provides a more uniform environment for the shared-memory network. Because a target can determine both its own Internet address and the Internet addresses of all other targets on the shared-memory network, hardware-to-IP translation (ARP) is unnecessary over the VxWorks shared-memory network, and is therefore eliminated.</p><dd><p class="Body"><a name="85901"> </a>When setting up a shared-memory network with sequential addressing, choose a block of IP addresses and assign the lowest address in this block to the master. </p><dd><p class="Body"><a name="85902"> </a>When the shared-memory network driver is initialized by the master with <b class="routine"><i class="routine">smNetInit</i></b><b>(</b> <b>)</b>, the starting IP address is passed as a parameter and stored in the shared-memory pool. </p><dd><p class="Body"><a name="85905"> </a>Each target sets its interface address with <b class="routine"><i class="routine">ifAddrSet</i></b><b>(</b> <b>)</b>. This routine checks that the assigned address matches the expected address for its location on the backplane, based on the processor number from the boot parameters. If any other address is specified, the operation fails. To determine the starting address for an active shared-memory network, use <b class="routine"><i class="routine">smNetShow</i></b><b>(</b> <b>)</b>.</p><dd><p class="Body"><a name="85911"> </a>In the following example, the master's IP address is 150.12.17.1.</p><dl class="margin"><dd><pre class="Code2"><b><a name="85912"></b><tt class="output">-> </tt><b>smNetShow </b><tt class="output">value = 0 = 0x0</tt><b></a></b></pre></dl><dd><p class="Body"><a name="85914"> </a>The following output displays on the standard output device:</p><dl class="margin"><dd><pre class="Code2"><b><a name="85915"></b><tt class="output">Anchor Local Addr: 0x800000, SOFT TAS Sequential addressing enabled. Master address: 150.12.17.1 heartbeat = 453, header at 0x800170, free pkts = 235. cpu int type arg1 arg2 arg3 queued pkts ----- ----------- --------- --------- --------- -------------- 0 mbox-1 0x2d 0x803f 0x10 0 1 mbox-1 0x2d 0x813f 0x10 0 input packets = 366 output packets = 376 input errors = 0 output errors = 1 collisions = 0</tt><b></a></b></pre></dl><dd><p class="Body"><a name="85925"> </a>With sequential addressing, when booting a slave, the backplane IP address and gateway IP boot parameters are no longer necessary. The default gateway address is the address of the master. Another address can be specified if this is not the desired configuration.</p><dl class="margin"><dd><pre class="Code2"><b><a name="85926"></b><tt class="output">[VxWorks Boot]:</tt><b> p </b><tt class="output">boot device : sm=0x800000 processor number : 1 file name : /folk/fred/wind/target/config/</tt><b><i class="textVariable">bspname</i></b><tt class="output">/vxWorks host inet (h) : 150.12.1.159 user (u) : darger flags (f) : 0x0 [VxWorks Boot] : </tt><b>@ </b><tt class="output">boot device : sm=0x800000 processor number : 1 file name : /folk/fred/wind/target/config/</tt><b><i class="textVariable">bspname</i></b><tt class="output">/vxWorks host inet (h) : 150.12.1.159 user (u) : darger flags (f) : 0x0 Backplane anchor at 0x800000... Attaching network interface sm0... done. Backplane inet address: 150.12.17.2 Subnet Mask: 0xffffff00 Gateway inet address: 150.12.17.1 Attaching network interface lo0... done. Loading... 364512 + 27976 + 20128 Starting at 0x1000...</tt><b></a></b></pre></dl><dd><p class="Body"><a name="85950"> </a>Sequential addressing can be enabled during configuration. The relevant configuration macro is <b class="symbol_UC">INCLUDE_SM_SEQ_ADDR</b>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="85952">3.5.4 Shared-Memory Network Configuration </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85954"> </a>For UNIX, configuring the host to support a shared-memory network uses the same procedures outlined earlier in this chapter for other types of networks. In particular, a shared-memory network requires that:</p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="85955"> </a>All shared-memory network host names and addresses are present in <b class="file">/etc/hosts</b>.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="85956"> </a>All shared-memory network host names are present in <b class="file">.rhosts</b> in your home directory or in <b class="file">/etc/hosts.equiv</b> if you are using RSH.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="85957"> </a>A gateway entry specifies the master's Internet address on the Ethernet as the gateway to the shared-memory network. The gateway entry is not needed if you are using proxy ARP. For more information, see <a href="c-tcpip7.html#87225"><i class="title">4.7 ARP and Proxy ARP for Transparent Subnets</i></a>.</li></ul></p></dl><dl class="margin"><dd><p class="Body"><a name="85961"> </a>For Windows hosts, the steps required to configure the host are determined by your version of Windows and the networking software you are using. See that documentation for details.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="85962">Example Configuration</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85963"> </a>To illustrate the previous discussion, this section presents an example of a simple shared-memory network. The network contains a single host and two target processors on a single backplane. In addition to the target processors, the backplane includes a separate memory board for the shared-memory pool, and an Ethernet controller board. The additional memory board is not essential, but provides a configuration that is easier to describe.</p><dd><p class="Body"><a name="85967"> </a><a href="c-dll5.html#85971">Figure 3-5</a> illustrates the overall configuration. The Ethernet network is assigned network number 150, and the shared-memory network is assigned 161. The host <b class="symbol_lc">h1 </b>is assigned the Internet address 150.12.0.1.<div class="frame"><h4 class="EntityTitle"><a name="85971"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 3-5: Example Shared-Memory Network</font></a></h4><dl class="margin"><div class="Anchor"><a name="86009"> </a><img class="figure" border="0" src="images/c-dlla5.gif"></div></dl></div></p><dd><p class="Body"><a name="86010"> </a>The master is <b class="symbol_lc">vx1</b>, and functions as the gateway between the Ethernet and shared-memory networks. It therefore has two Internet addresses: 150.12.0.2 on the Ethernet network and 161.27.0.1 on the shared-memory network.</p><dd><p class="Body"><a name="86011"> </a>The other backplane processor is <b class="symbol_lc">vx2</b>; it is assigned the shared-memory network address 161.27.0.2. It has no address on the Ethernet because it is not, directly connected to that network. However, it can communicate with <b class="symbol_lc">h1</b> over the shared-memory network, using <b class="symbol_lc">vx1 </b>as a gateway. Of course, all gateway use is handled by the IP layer and is completely transparent to the user. <a href="c-dll5.html#86018">Table 3-6</a> shows the example address assignments.<p class="table"><h4 class="EntityTitle"><a name="86018"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 3-6: Network Address Assignments</font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeadingC" align="center"><a name="86024"> </a><b><font face="Helvetica, sans-serif" size="-1" class="sans">Name</font></b></div></th><td width="10"> </td><th rowspan="1" colspan="1"><div class="CellHeadingC" align="center"><a name="86026"> </a><b><font face="Helvetica, sans-serif" size="-1" class="sans">Inet on Ethernet</font></b></div></th><td width="10"> </td><th rowspan="1" colspan="1"><div class="CellHeadingC" align="center"><a name="86028"> </a><b><font face="Helvetica, sans-serif" size="-1" class="sans">Inet on Backplane</font></b></div></th><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="86030"> </a><b class="symbol_lc">h1</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="86032"> </a>150.12.0.1</div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="86034"> </a>- </div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="86036"> </a><b class="symbol_lc">vx1</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="86038"> </a>150.12.0.2</div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="86040"> </a>161.27.0.1</div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="86042"> </a><b class="symbol_lc">vx2</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="86044"> </a>-</div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBodyC" align="center"><a name="86046"> </a>161.27.0.2</div></td><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></p><dd><p class="Body"><a name="86047"> </a>To configure the UNIX system for our example, the <b class="file">/etc/hosts</b> file must contain the Internet address and name of each system. Note that the backplane master has two entries. The second entry, <b class="symbol_lc">vx1.sm</b>, is not actually necessary, because the host system never accesses that system with that address--but it is useful to include it in the file to ensure that the address is not used for some other purpose.</p><dd><p class="Body"><a name="86048"> </a>The entries in <b class="file">/etc/hosts</b> are as follows:</p><dl class="margin"><dd><pre class="Code2"><b><a name="86049">150.12.0.1 h1 150.12.0.2 vx1 161.27.0.1 vx1.sm 161.27.0.2 vx2 </a></b></pre></dl><dd><p class="Body"><a name="86050"> </a>To allow remote access from the target systems to the UNIX host, the <b class="file">.rhosts</b> file in your home directory, or the file <b class="file">/etc/hosts.equiv</b>, must contain the target systems' names:</p><dl class="margin"><dd><pre class="Code2"><b><a name="86051">vx1 vx2</a></b></pre></dl><dd><p class="Body"><a name="86052"> </a>To inform the UNIX system of the existence of the Ethernet-to-shared-memory network gateway, make sure the following line is in the file <b class="file">/etc/gateways</b> <i class="emphasis">at the time the route daemon </i><b class="command">routed</b><i class="emphasis"> is started</i>.</p><dl class="margin"><dd><pre class="Code2"><b><a name="86053">net 161.27.0.0 gateway 150.12.0.2 metric 1 passive</a></b></pre></dl><dd><p class="Body"><a name="86054"> </a>Alternatively, you can add the route manually (effective until the next reboot) with the following UNIX command:</p><dl class="margin"><dd><pre class="Code2"><b><a name="86055"></b><tt class="output">%</tt><b> route add net 161.27.0.0 150.12.0.2 1</a></b></pre></dl><dd><p class="Body"><a name="86059"> </a>The target system's configurations include the parameters shown in <a href="c-dll5.html#86078">Table 3-7</a>. The backplane master, <b class="symbol_lc">vx1</b>, uses the following boot parameters:</p><dl class="margin"><dd><pre class="Code2"><b><a name="86060">boot device : gn processor number : 0 host name : h1 file name : /usr/wind/target/config/bspname/vxWorks inet on ethernet (e) : 150.12.0.2 inet on backplane (b) : 161.27.0.1 host inet (h) : 150.12.0.1 gateway inet (g) : user (u) : darger ftp password (pw) (blank=use rsh) : flags (f) : 0 </a></b></pre></dl></dl></dl><dl class="margin"><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/note.gif"></td><td><hr><div class="CalloutCell"><a name="92994"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">NOTE: </font></b></a>For more information on boot devices, see the <i class="title">Tornado User's Guide: Getting Started</i>. To determine which boot device to use, see the BSP's documentation.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout><dl class="margin"><dd><p class="Body"><a name="86072"> </a>The other target, <b class="symbol_lc">vx2</b>, has the following boot parameters:<sup><a href="#foot"><b class="FootnoteMarker">1</b></a></sup></p><dl class="margin"><dd><pre class="Code2"><b><a name="86073">boot device : sm=0x800000 processor number : 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -