UNIX Database Files Multiplexing

Figure 15.3: Dynamically allocated port numbers. The source host has requested the telnet service from the designated host. The source host randomly generated the source port number for the user who initiated this request port 3408 in this case and sent out the TCP segment with this source port number; the destination port number is 23 the well−known service for telnet. The destination host has received the sent TCP segment on its port 23 and responded back to the remote hosts destination port 3408. A network−wide unique connection has been established. A combination of an IP address and a port number is called a socket. A socket uniquely identifies a single network process throughout the entire Internet. Sometimes the terms socket and port number are used interchangeably; well−known services are often referred as well−known sockets. However, this is not correct and should be avoided.

15.1.3.2 UNIX Database Files

UNIX database files store all of the protocol and port numbers that the system needs. These files are uniform among different UNIX flavors. We will discuss them with examples from SunOSSolaris and HP−UX. The etcprotocols file — The etcprotocols file is a simple table containing the protocol names and the protocol numbers associated with those names. The format of the table is a single entry per line; each entry consists of the official protocol name separated by white space from the protocol number; the protocol number is separated by white space from the alias if any exists for the protocol name, and comments begin with the symbol. cat etcprotocols SunOSSolaris protocols 1.9 900103 SMI Internet IP protocols This file is never consulted when the NIS are running ip 0 IP internet protocol, pseudo protocol number icmp 1 ICMP internet control message protocol igmp 2 IGMP internet group multicast protocol ggp 3 GGP gateway−gateway protocol tcp 6 TCP transmission control protocol pup 12 PUP PARC universal packet protocol udp 17 UDP user datagram protocol 348 The etcservices file — The other database file, etcservices, is very similar in its format to the etcprotocols file. Each single−line entry starts with the official name of the service, separated by white space from the port numberprotocol name pair associated with that service. The port numbers are paired with transport protocol names, because different transport protocols may use the same port number. An optional list of aliases for the official service name may be also provided, and comments start with the symbol. cat etcservices services 1.16 900103 SMI Network services, Internet style This file is never consulted when the NIS are running tcpmux 1tcp rfc−1078 echo 7tcp echo 7udp ..... ftp 21tcp telnet 23tcp smtp 25tcp mail time 37tcp timserver time 37udp timserver name 42udp nameserver whois 43tcp nicname usually to sri−nic domain 53udp domain 53tcp hostnames 101tcp hostname usually to sri−nic sunrpc 111udp sunrpc 111tcp Host specific functions tftp 69udp rje 77tcp finger 79tcp ..... pop−2 109tcp Post Office uucp−path 117tcp nntp 119tcp usenet Network News Transfer 349 ..... .....

15.2 Address Resolution ARP

The designated IP address and the routing table are the cornerstones in forwarding a datagram to a specific physical network. However, when a datagram travels across a network, it must obey the physical layer protocols used by that network. The physical layer does not understand the IP addressing scheme; it only respects its own addressing and its own rules. To make everything operational, one of the basic tasks of the network access layer of the TCPIP stack is to map IP addresses into appropriate physical network addresses. The most common physical local network is the Ethernet network often used as a generic name for all CSMACD networks. The Ethernet network has its own addressing scheme, with Ethernet addresses to identify each Ethernet interface device connected to the network. An Ethernet address often specified as a MAC address; MAC stands for the media access control sublayer in the data link layer of the ISO OSI Reference Model should not be mistaken for an Internet IP address; these are two completely different addressing schemes. Six two−digit hexadecimal numbers separated by a colon : specify an Ethernet address. A unique Ethernet address is assigned to each Ethernet network interface, hardwired or firmwired during its manufacture. Consequently, the Ethernet address remains hidden from users and is outside of any administrative control. However, currently some vendors put Ethernet addressing under program control, also allowing local programming of physical Ethernet addresses. The protocol that performs IP address mapping to the physical Ethernet address is known as the address resolution protocol ARP, and it belongs to the network access layer. The ARP software maintains a table of IP addresses translated into Ethernet addresses. ARP itself builds the table dynamically and automatically. When ARP receives a request to translate an IP address, it first checks if the specified IP address is already in the table. If the IP address is found, ARP returns the corresponding Ethernet address to the requesting software. If the address is not found in the table, ARP broadcasts an Ethernet query to all hosts on the local Ethernet network, asking the host with the corresponding IP address to reply with its Ethernet address. Please note that the requested IP address must be a directly reachable IP address of the host, or a router on the local network otherwise data delivery is not possible. Note also that Ethernet addresses cannot go over the boundaries of the local network. Both the broadcasted Ethernet query and the requested IP address remain in the local network. Each host in the local network is familiar with its own IP and Ethernet addresses, and the queried host will respond with its Ethernet address. The received response is then cached in the ARP table. Even though the ARP table is dynamically updated, the static entries can be also created; there is a way to specify specific InternetEthernet 350