INtime SDK Help
Legacy TCP/IP
INtime SDK v6 > Legacy components > Legacy TCP/IP

This lists common operations related to TCP/IP tasks and the INtime kernel system calls that do the operations:

To . . . Use this system call . . .
Accept a connection on a socket accept
Assign a name to an unnamed socket bind
Execute binary string operations bstring (bcmp, bcopy, bzero)
Convert short and long quantities between network byte order and host byte order byteorder (htonl, htons, ntohl, ntohs)
Initiate a connection on a socket connect
Get and set the local host name gethostname, sethostname
Return the socket name of the connected remote socket getpeername
Return the current name for the specified socket getsockname
Return or sets options associated with a socket getsockopt, setsockopt
Manipulate Internet addresses inet
(inet_addr, inet_lnaof, inet_makeaddr, inet_netof, inet_network, inet_ntoa)
Listen for connection requests on a socket listen
Receive a message from a socket recv, recvfrom
Send a message from one socket to another send, sendto
Shut down all or part of a full-duplex connection shutdown
Check whether sockets are ready to receive or send, or have out-of-band data pending select
Create an endpoint for communication socket
Set a timeout for completion of calls on a socket socktout
Get host by host name gethostbyname (see gethostent)
Get host by host address gethostbyaddress (see gethostent)
Open resolver connection sethostent (see gethostent)
Close resolver connection endhostent (see gethostent)
Get next network entry getnetent
Get next network entry by name getnetbyname (see getnetent)
Get next network entry by address getnetbyaddr (see getnetent)
Open/rewind networks database setnetent (see getnetent)
Close networks database endnetent (see getnetent)
Get next protocol entry getprotoent)
Get next protocol entry by name getprotobyname (see getprotoent)
Get next protocol entry by number getprotobynumber (see getprotoent)
Open/rewind protocols database setprotoent (see getprotoent)
Close the protocols database endprotoent (see getprotoent)
Get next service entry getservent)
Get next service entry by name getservbyname (see getservent)
Get next service entry by port getservbyport (see getservent)
Open/rewind services database setservent (see getservent)
Close services database endservent (see getservent)

Overview

TCP/IP programs are based on a set of protocols called Transmission Control Protocol/Internet Protocol (TCP/IP). The TCP/IP suite of networking protocols makes it possible for different brands of computers, running different operating systems, to supply resources to network users.

This describes how to install, use, and maintain TCP/IP networking software with your INtime software. This software allows you to communicate across a network with any other computer running TCP/IP software, regardless of its operating system.

Connecting to network resources

TCP/IP software lets you connect to various hosts on a network so that you can use their resources. The computer you use to make your original connection to the network is the local host. Any other computer on the network, regardless of its location, is a remote host.

Each host on a network is identified by a number, called an Internet address or IP address, and an official name. Hosts can also have symbolic names, called aliases. To access a remote host, you must specify either its Internet address, official name, or a valid alias to network software.

The computer and software that originate a network command are the client, because they request a network service. The computer and software responding to the request are the server, because they provide the network service. Servers provide sharable resources; the network gives shared access to many users.

The figure below illustrates network connections and possible resources. Print Servers and File Servers have special responsibilities: they provide network printer and file storage resources. INtime systems cannot function as print servers. The host labeled Gateway acts as a connection, or router, to other networks, whose resources can also be accessed.

Programming with TCP/IP

The INtime software implementation provides a Berkeley Unix-style socket interface. You can write applications that make both INtime software system calls and socket calls, or you can port existing socket applications to this interface.

Understanding Internet Addresses

To make entries in the configuration files you need to understand the format of Internet addresses. You will also use either Internet addresses or host names (and aliases) that represent addresses when communicating with remote systems.

The Defense Advanced Research Projects Agency (DARPA) Internet protocol family is a collection of protocols that utilize the Internet address format. This family includes the Transmission Control Protocol (TCP), Internet Protocol (IP), Internet Control Message Protocol (ICMP), and User Datagram Protocol (UDP). A raw interface is also provided to IP and ICMP.

Internet addresses are also called IP addresses; they use the IP routing protocol. An IP address is a 4-byte quantity. It is a (net,host) pair, where net identifies a network and host identifies a host on that network. There are three basic classes of address, as distinguished by the high-order bits of the address. Class A addresses use an 8-bit net and a 24-bit host; the high-order bit is 0. Class B addresses use a 16-bit net and a 16-bit host; the high-order bits are 10. Class C addresses use a 24-bit net and an 8-bit host; the high-order bits are 110.

Because of the size of the host part of an address, the different classes of address correspond to networks of varying size. The format of the addresses is shown below, along with the number of hosts possible in each class:

The dot notation form of an Internet address consists of one to four numbers separated by dots (.). Each number can be expressed in decimal, octal (leading 0), or hexadecimal (leading 0x).

The most common format is a four-part address (a.b.c.d), consisting of four 8-bit decimal numbers in the range 0-255. This is called dotted-decimal notation. The four parts are assigned, in order, to the four bytes in the Internet address.

You can distinguish between the classes of address by the first number of a dotted-decimal address. Class A addresses begin with numbers in the range 1-126. (Value 127 is a special case used for the loopback device.) Class B addresses begin with numbers in the range 128-191. Class C addresses begin with numbers in the range 192-223 (there are other special classes of network in the range 224-255).

Once you know the class of an address, you can tell which part of the address specifies the network and which specifies the host. For example, in a Class A address, the first byte is the network number and the last three bytes specify the host. In the address 89.3.240.9, the network is number 89, and the host is number 3.240.9 on that network. The host address is 89.3.240.9, because it must be specified in terms of its network. The network address is 89.0.0.0, which can be interpreted as any host on that network.

Subnet Addresses

Sites may implement subnet addressing to accommodate a cluster of local networks. Subnet addressing further divides the local host portion of the address into a subnet part and a host part. Within the local cluster, each subnet appears to be an individual network; externally, the entire cluster appears to be a single network. In the example address 89.3.240.9, you might choose to use one byte of the host part to designate subnets. In that case, you would interpret the host to be number 240.9 on subnet 3 of network 89.

You enable subnet addressing by specifying a subnet mask for a network interface and by using the subnet mask when setting up the routes to each subnet.

Special Addresses

Addresses of all 0s or all 1s are special cases and are not assigned to hosts. The address 0.0.0.0 means the local host. The address 255.255.255.255 broadcasts to all hosts on the network to which you are directly connected. An address with the host part set to all 1s broadcasts to all hosts on a specific network.

Obtaining an Internet Address

On any network that is connected to the Internet, you must obtain a block of Internet addresses from a central authority, the InterNIC Registration Services. This prevents you from using the same Internet address as someone else on the Internet.

The InterNIC issues a network number whose class is appropriate for the size of your local network. Your organization is responsible for issuing and maintaining the host ID part of the address on local systems.

CAUTION:   Do not use any of the example Internet addresses shown in this manual as your host address. Always use addresses in the network range assigned to you.

Because of the growing popularity of the Internet, available addresses are becoming scarce. It may be necessary for you to have a sponsoring organization that is already on the Internet. The sponsor would assign your organization a subnet address within the sponsor's network address.

You can use TCP/IP software without an official Internet address on a network that is not connected to the Internet. However, it is a good precaution to proceed as if you intend to connect to the Internet. These are the numbers and addresses for the InterNIC Registration Services:

User Assistance Service 1-703-742-4777
On-line Mailboxes HOSTMASTER@RS.INTERNIC.NET
Host, domain, network changes, and updates
ACTION@RS.INTERNIC.NET
Computer operations
MAILSERV@RS.INTERNIC.NET
Automatic mail service
Anonymous FTP RS.INTERIC.NET IP address 198.41.0.7
log in as ANONYMOUS, with password GUEST
Postal address Network Solutions
Attn: InterNIC Registration Services
505 Huntmar Park Drive
Herndon, VA 22070

Request For Comment (RFC) Reports

The Internet community uses RFCs to discuss and define TCP/IP. This manual refers to certain RFCs by number for protocol definitions and details. You can get RFCs in electronic format from the InterNIC Information Services.

Anonymous FTP NIS.NSF.NET IP address 35.1.1.48
RFC index /internet/documents/rfc/INDEX.rfc
NISC.JVNC.NET IP address 128.121.50.7
VENERA.ISI.EDU IP address 128.9.0.32
WUARCHIVE.WUSTL.EDU
IP address 128.252.135.4
NIC.DDN.MIL IP address 192.112.36.5
On all hosts, log in as ANONYMOUS, with password GUEST or, if requested, your net address.
On-line Mailboxes rfc-info@ISI.EDU Send the message
"help: ways_to_get_rfcs". For example:
To: rfc-info@ISI.EDU
Subject: getting rfcs
help: ways_to_get_rfcs
Info@is.internic.net