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

📄 c-tcpip7.html

📁 Vxworks网络编程指南
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<div class="Anchor"><a name="87524"> </a><img class="figure" border="0" src="images/c-tcpipa2.gif"></div></dl></div></p><dd><p class="Body"><a name="87525"> </a>If the datagram originates from a main network (and the port is enabled), the server forwards the broadcasts to all the main network's proxy networks.  For example, in <a href="c-tcpip7.html#87506">Figure&nbsp;4-11</a>, a datagram from <b class="symbol_lc">ln0</b> is forwarded to both <b class="symbol_lc">sm0</b> and <b class="symbol_lc">sm1</b>.  To prevent forwarding loops, broadcasts forwarded onto proxy networks are given a time-to-live value of 1.</p><dd><p class="Body"><a name="87529"> </a>Although forwarding broadcasts between interfaces is potentially dangerous (due to broadcast storms and forwarding loops), the restrictions put on the configuration make these situations unlikely.  Even so, forwarding broadcasts between proxy and main interfaces is not recommended.  Therefore, forward broadcasts only on necessary ports.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="87530">4.7.6  &nbsp;&nbsp;Special Configuration Needs for Multi-Homed Proxy Clients</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="87532"> </a>Using multi-homed proxy clients requires that you make changes to the routing and broadcast configuration of your VxWorks system. These changes are described in the following subsections. </p></dl></dl><dl class="margin"><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="87533">Routing Configuration Considerations for Multi-Homed Proxy Clients</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="87535"> </a>If a proxy client also has an interface to the main network, some additional configuration is required for optimal communications. The proxy client's routing tables must have network-specific routes with netmask <b class="symbol_UC">0xFFFFFFFF</b> for nodes on the proxy network, and a network-specific route for the main network. Otherwise traffic travels an extra unnecessary hop through the proxy server. </p><dd><p class="Body"><a name="87539"> </a>In the example shown in <a href="c-tcpip7.html#87543">Figure&nbsp;4-12</a>,<b> vx1</b> is the proxy server and <b>vx2 </b>is a proxy client with an interface on the main network. <b>vx2</b> must be configured to have network-specific routes with mask <b class="symbol_UC">0xFFFFFFFF</b> to each of the other proxy clients (<b>vx4</b> and <b>vx5</b>), and a network-specific route to the main network. Otherwise any traffic from <b>vx2 </b>to <b>vx4</b> (or <b>vx5</b>) unnecessarily travels over the main network through the proxy server (<b>vx1</b>).<div class="frame"><h4 class="EntityTitle"><a name="87543"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 4-12:&nbsp;&nbsp;Routing Example</font></a></h4><dl class="margin"><div class="Anchor"><a name="87606"> </a><img class="figure" border="0" src="images/c-tcpipa4.gif"></div></dl></div></p><dd><p class="Body"><a name="87607"> </a>The following is an example of <b>vx2</b>'s routing table. The routing table is manipulated using <b class="routine"><i class="routine">routeAdd</i></b><b>(</b>&nbsp;<b>)</b> and<b class="routine"><i class="routine"> routeDelete</i></b><b>(</b>&nbsp;<b>)</b>. For more information, see the reference entry for<b class="library"> routeLib</b>.</p><dl class="margin"><dd><pre class="Code2"><b><a name="91918">Destination&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gateway </b><tt class="output">150.12.0.4&nbsp;(network&nbsp;with&nbsp;netmask&nbsp;</tt><b>&nbsp;&nbsp;</b><tt class="output">0xffffffff)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;150.12.0.6 150.12.0.5&nbsp;(network&nbsp;with&nbsp;netmask&nbsp;</tt><b>&nbsp;&nbsp;</b><tt class="output">0xffffffff)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;150.12.0.6 150.12.0.0&nbsp;(network)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt><b>&nbsp;&nbsp;&nbsp;</b><tt class="output">&nbsp;</tt><b>&nbsp;</b><tt class="output">&nbsp;</tt><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b><tt class="output">150.12.0.7 </tt><b></a></b></pre></dl></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="87613">Broadcasts Configuration Considerations for Multi-Homed Proxy Clients</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="87615"> </a>A proxy client that also has an interface connected to the main network must disable broadcast packets from the proxy interface.  Otherwise, it receives duplicate copies of broadcast datagrams (one from Ethernet and one from the shared-memory network).  Broadcasts can be disabled on an interface using <b class="routine"><i class="routine">ifFlagChange</i></b><b>(</b>&nbsp;<b>)</b>. (See the reference entry.)</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="87618">4.7.7  &nbsp;&nbsp;Single-Tier Configuration for Shared-Memory Networks under Proxy ARP</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="87620"> </a>Proxy ARP works only for a single tier of shared-memory networks.  That is, only interfaces directly attached to the proxy server are supported. Example configurations that work are shown in <a href="c-tcpip7.html#87630">Figure&nbsp;4-13</a> and <a href="c-tcpip7.html#87804">Figure&nbsp;4-15</a>. <div class="frame"><h4 class="EntityTitle"><a name="87630"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 4-13:&nbsp;&nbsp;Single-Tier Example Using Proxy ARP with Two Branches</font></a></h4><dl class="margin"><div class="Anchor"><a name="87698"> </a><img class="figure" border="0" src="images/c-tcpip8.gif"></div></dl></div>However, the configuration shown in <a href="c-tcpip7.html#87712">Figure&nbsp;4-14</a> does not work because ARP requests are not forwarded over proxy networks, and there can be only one proxy server per shared-memory network.  This single-tier restriction means that problems such as network circles, broadcast storms, and continually forwarded ARP requests are avoided.</p><dd><p class="Body"><a name="87705"> </a>To work, the configuration in <a href="c-tcpip7.html#87712">Figure&nbsp;4-14</a> requires a combination of proxy ARP and IP (or standard subnet) routing.  The modified configuration is shown in <a href="c-tcpip7.html#87887">Figure&nbsp;4-16</a>, where Proxy Network 1 has become an IP routing network with a different network address.  For <b>vx6</b> to send to <b>h2</b> in the modified configuration, it requires the following entry in its routing table: <div class="frame"><h4 class="EntityTitle"><a name="87712"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 4-14:&nbsp;&nbsp;Multi-Tier Configuration that <i class="i">CANNOT</i> Be Used with Proxy ARP</font></a></h4><dl class="margin"><div class="Anchor"><a name="87790"> </a><img class="figure" border="0" src="images/c-tcpip13.gif"></div></dl></div></p><dl class="margin"><dd><pre class="Code2"><b><a name="87791">Destination&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gateway </b><tt class="output">150.12.0.0 (network)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;161.27.0.1 </tt><b></a></b></pre></dl><dd><p class="Body"><a name="87793"> </a>For <b>h2</b> to send to <b>vx6</b>, it requires the following entry in its routing table:</p><dl class="margin"><dd><pre class="Code2"><b><a name="87794">Destination&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gateway </b><tt class="output">161.27.0.0 (network)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;150.12.0.6</tt><b></a></b></pre></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="87798">4.7.8  &nbsp;&nbsp;Proxy ARP and Its Consequences for Subnet Configuration</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="87800"> </a>If the main network on which the proxy server is connected is subnetted, then all the interfaces (both proxy and main) must reside on the same subnet as the main network.  That is, the main network interface and the proxy network interface on the proxy server and all the proxy clients must have the same subnet mask.<div class="frame"><h4 class="EntityTitle"><a name="87804"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 4-15:&nbsp;&nbsp;Another Single-Tier Example Using Proxy ARP</font></a></h4><dl class="margin"><div class="Anchor"><a name="87861"> </a><img class="figure" border="0" src="images/c-tcpipa3.gif"></div></dl></div></p><dd><p class="Body"><a name="87863"> </a>To enable proxy ARP for the shared-memory network, reconfigure VxWorks and rebuild it with the proxy server.  The relevant configuration macro is  <b class="symbol_UC">INCLUDE_PROXY_SERVER</b>.  If the target is processor zero (the shared-memory network master), the proxy server is enabled using the boot parameter <b class="symbol_lc">inet on ethernet (e)</b> as the main network, and the boot parameter <b class="symbol_lc">inet on backplane&nbsp;(b)</b> as the proxy network.  From the example in <a href="c-tcpip7.html#87804">Figure&nbsp;4-15</a>,<i class="i"> </i><b>vx1</b>'s corresponding boot parameters are as follows:</p><dl class="margin"><dd><pre class="Code2"><b><a name="87868"></b><tt class="output">inet&nbsp;on&nbsp;ethernet&nbsp;(e)    :</tt><b>&nbsp;150.12.7.3:ffffff00 </b><tt class="output">inet&nbsp;on&nbsp;backplane&nbsp;(b)   :</tt><b>&nbsp;150.12.7.4</a></b></pre></dl></dl></dl><dl class="margin"><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="87869">Proxy ARP Server Configuration </a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="87870"> </a>The proxy server for the shared-memory network must be the master board.  As previously mentioned, the server must be configured for proxy servers.  The relevant configuration macro is  <b class="symbol_UC">INCLUDE_PROXY_SERVER</b>.  If sequential addressing is not used, then the master backplane inet address must be specified as well as the slaves' backplane and gateway inet addresses.  This configuration gives you greater control over the addresses that are assigned to the target boards.  </p></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="87871">Sequential and Default Addressing</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="94402"> </a>If such control is not required, it is possible to have the proxy server assign the inet addresses to the proxy clients. When VxWorks is configured for sequential addressing, the proxy server assigns incremental inet addresses to the slave boards based on the proxy server's backplane inet address.  <b class="symbol_UC">The relevant configuration macro is INCLUDE_SM_SEQ_ADDR</b>.  For example, if the proxy server has a backplane inet address of 150.12.0.4, the inet address assigned to the first slave is 150.12.0.5, to the second slave 150.12.0.6, and so on. (See <a href="c-tcpip7.html#87887">Figure&nbsp;4-16</a>.)</p><dd><p class="Body"><a name="87878"> </a>Using sequential addressing frees you from having to specify a backplane or a gateway inet address for each proxy client.  All the addresses are assigned by the proxy server at boot time.</p><dd><p class="Body"><a name="87879"> </a>It is also possible to have the proxy server's backplane address configured by default.  This allows for greater flexibility in the assignment of backplane inet addresses.  You are only required to assign the inet address for the proxy server's interface to the main network.  The backplane address is assigned automatically by adding 1 (one) to the network interface address.  </p><dd><p class="Body"><a name="87881"> </a>To assign the proxy server's backplane address by default, you must use a configuration with default addressing as well as sequential addressing. The relevant configuration macro is  <b class="symbol_UC">INCLUDE_PROXY_DEFAULT_ADDR</b>.  This frees you from having to specify the backplane inet address of the proxy server and the proxy clients, and the gateway address of the proxy clients.</p><dd><p class="Body"><a name="87883"> </a>For example, with VxWorks so configured:  if the proxy server is given the inet network address of 150.12.0.3, its backplane address is 150.12.0.4.  The first proxy client is assigned the inet address 150.12.0.5, the second 150.12.0.6, and so on.<div class="frame"><h4 class="EntityTitle"><a name="87887"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 4-16:&nbsp;&nbsp;Multi-Tier Example Using Proxy ARP and IP Routing</font></a></h4><dl class="margin"><div class="Anchor"><a name="87974"> </a><img class="figure" border="0" src="images/c-tcpipa6.gif"></div></dl></div></p><dd><p class="Body"><a name="87975"> </a>Note that with proxy ARP it is no longer necessary to specify the gateway. Each target on the shared-memory network (except the proxy server) can register itself as a proxy client by specifying the proxy ARP flag, <b class="symbol_UC">0x100</b>, in the boot flags instead of specifying the gateway.  For additional information on booting with proxy ARP, see <a href="c-booting5.html#84862"><i class="title">13.5&nbsp;Booting from the Shared-Memory Network</i></a>.</p></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="87979">VxWorks Images for Proxy ARP with Shared Memory and IP Routing</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="87981"> </a>Even if you are using the same board for the master and the slaves, the master and slaves need separate BSP directories because they have different configurations.  For more information on configuring VxWorks, see the <i class="title">Tornado User's Guide: Projects</i>.</p><dl class="margin"><b class="BulletHead"><li><a name="87982"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Proxy ARP and Shared Memory Definition in the VxWorks Configuration: <b class="file"></b></font></li></b></dl></dl><dl class="margin"><p><ol class="List"><li value="1)"><a name="94635"> </a>PING client (configuration constant: <b class="symbol_UC">INCLUDE_PING</b>)</li></ol></p><p><ol class="List"><li value="2)"><a name="94654"> </a>Shared memory network initialization (<b class="symbol_UC">INCLUDE_SM_NET</b>)</li></ol></p>

⌨️ 快捷键说明

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