Professional Documents
Culture Documents
12.1 Introduction VxWorks Network Configuration Routing Protocols Remote Access Services
12-1
Network Protocols
Machines on a network must agree to exchange data in some standard way. Internet protocol suite (also called TCP/IP) provides system independent protocols. VxWorks provides an implementation of TCP/IP protocol suite based on the 4.4BSD release Features include:
Increased configurability and scalability MUX layer Support for contemporary Internet features
12-2
Network Components
12-3
Network Scalability
TCP/IP parameters can be set by setting properties of individual components. Examples: TCP Connection Timeout, IP Time-to-Live value, TCP/UDP receive and send buffer sizes, and tuning of internal buffers. (See VxWorks Network Programmers Guide.)
12-4
Network Services
12-5
Networking
Introduction 12.2 VxWorks Network Configuration Routing Protocols Remote Access Services
12-6
Host Names
hostShow ()
The name of the boot host is automatically added to the table from the boot parameters.
12-7
Domain Name System (DNS) is a distributed client/server application supporting host names being stored in a distributed database. DNS requires a name server and, on the client side, a resolver. VxWorks supports resolver functionality in resolvLib. resolvLib resolvLib includes the following routines:
resolvGetHostByName() -- send a DNS query to the name server for the IP address of a host. resolvGetHostByAddr() -- send a DNS query to the name server for the host name of an IP address.
12-8
The DNS resolver component (/network components/networking applications/DNS resolver) must be added to VxWorks. The resolver must be initialized before use. Required information includes RESOLVER_DOMAIN and RESOLVER_DOMAIN_SERVER. This can be done through the project facility or by calling resolvInit().
12-9
DHCP Basics
Dynamic Host Configuration Protocol (DHCP) allows a host to acquire an IP address, and possibly boot parameters, from a remote host. A DHCP client can obtain a temporary lease of an IP address from a DHCP server, which maintains a database of available addresses and other parameters. A DHCP relay agent is necessary to support DHCP operation across subnet boundaries.
12-10
DHCP Configuration
12-11
Networking
Introduction VxWorks Network Configuration 12.3 Routing Protocols Remote Access Services
12-12
Routing Overview
VxWorks supports two routing protocols: Routing Information Protocol (RIP) and Open Shortest Path First (OSPF).
12-13
To add multiple routes to the same location, use Can use a destination/gateway internet address in dot notation. Specify destination subnet mask and IP type-ofservice. See routeLib help page for details. To add a route to the 90.0.0.0 /24 network through the router gatehost: mRouteAdd (90.0.0.0, gatehost, 0xffffff00, 0, 0) Routing table show routines, mRouteShow() or routeShow() require the component /network
components/networking protocols/network debugging/ Network show routines.
12-14
Are used to display network statistics and debugging information. Configuration information and statistics can be shown for protocols (IP, ICMP, TCP, etc.) , buffering, network interfaces, etc. Example (ARP table entries): >arptabShow
LINK LEVEL ARP TABLE destination gateway flags Refcnt Use Interface -------------------------------------------------------------------------147.11.12.14 08:00:20:7b:06:fb 405 0 45 ei0 147.11.12.165 00:60:97:4f:d5:16 405 0 0 ei0 -------------------------------------------------------------------------value = 75 = 0x4b = K
12-15
Dynamic routing protocols allow hosts (typically routers) to exchange routing information. Advantages over statically created routing tables include:
Faster update as link states change Ability to calculate the most efficient route if there are multiple routes to a destination Easier maintenance
These protocols do not affect the Internet routing algorithm, but instead impose a routing policy when constructing the routing table. VxWorks supports RIP versions 1 and 2 and OSPF (an optional component).
12-16
RIP uses UDP to exchange routing information. RIP is a distance vector protocol -- each route includes a number of hop counts. If multiple paths to a destination exist, RIP chooses the most efficient route by minimizing this count. RIPv2 updates RIPv1 by including:
support for classless addressing ability to use multicasting and broadcasting support for authentication
use ping( ) for testing routes See ripLib in the VxWorks Reference Manual for details.
12-17
Networking
Introduction VxWorks Network Configuration Routing Protocols 12.4 Remote Access Services
12-18
12-19
rlogin and telnet offer an alternative to cross-development using the Tornado target server.
12-20
Allows remote hosts to access a targets DOS file systems using NFS protocol. By default no authentication is performed. Add the component /network components/networking protocols/network filesystems/NFS server. NFS server configuration supports: 1. Create a mountable DOS file system: dosFsDevInitOptionsSet (DOS_OPT_EXPORT); 2. Export DOS file system: nfsExport (name, fsId, rdOnly, notUsed); 3. Mount file system on remote host.
12-21
The FTP server component is included by configuring When target is booted, should see tFtpdTask (server daemon) running.
FTP security, which will require a valid user name and password from clients, can be included by configuring
The RLOGIN/TELNET password protection component allows a single user name and encrypted password. Additional users can be added by calling loginUserAdd() in application initialization code.
12-22
NFS Advantages:
Efficient file access. Configurable number of servers pre-spawned.
FTP Advantages:
Can access file systems other than DOS. All network hosts have FTP client.
12-23
Network File System (NFS) was developed by Sun Microsystems. Allows efficient access to files. NFS transfers and buffers files in pieces (usually 8 Kbytes). Remote file systems are mounted, then accessed as if they were local file systems. VxWorks provides NFS client and server. The NFS client component can be found under /network
components/networking protocols/network filesystems/NFS client.
12-24
0. Export servers file system: Makes the local file system available to remote host with appropriate access permissions 1. Mountthefilesystemontheclient. nfsMount (host, fileSystem, localName) 2. Settheclientsauthenticationparameters:
12-25
is not supported.
dirLib routines opendir / readdir do not work on netDrv directories. stat / fstat are only partially implemented.
12-26
Local name of device to create. By ends with :. Name of remote machine (from previous hostAdd( )). Protocol to transfer files to/from VxWorks (0= RSH or 1= FTP).
12-27
VxWorks programs can invoke remote shell (RSH) commands on a UNIX host. A file descriptor called a socket is created. Can read( ) from this socket to get command output.
12-28
Host name or inet number. Remote port number to connect to, typically 514 (RSH server). Name of local user. User name on remote host. Shell command string to execute. If non-zero, a socket for stderr is foreach I (*.o)returned through this pointer.
12-29
12-30
12-31
Summary
Internet Protocol for node-to-node routing. MUX layer decouples link-layer driver and network protocol. Configuring the network
Configure host name table using hostAdd() or use DNS resolver. Configure hosts routing table using mRouteAdd() or use RIP/OSPF.
12-32
Summary
DHCP allows a host to obtain IP address leases and boot parameters from a remote server. DHCP components:
DHCP Server DHCP Relay Agent DHCP Client
rlogin (UNIX Host) and telnet support. FTP and NFS servers allows local VxWorks files to be accessed by a remote machine.
12-33
Summary
12-34