Add Book to My BookshelfPurchase This Book Online

Appendix E - Accessing the Network at the Link Level

UNIX Systems Programming for SVR4
David A. Curry
 Copyright © 1996 O'Reilly & Associates, Inc.

Low-Level Protocol Interfaces
The socket and TLI functions provide the programmer with an interface to protocols designed for end-to-end communication. The underlying network, however, is hidden from the programmer by these interfaces. There is no way for the programmer to tell (and no need for her to know) whether the underlying network hardware is Ethernet, Fiber Distributed Data Interface (FDDI), Asynchronous Transfer Mode (ATM), or something else altogether.
This has advantages, in that the programmer need not worry about esoterica such as packet formats and other details that really have nothing to do with the task at hand—getting data from here to there. However, there are disadvantages too. Because the interfaces hide the underlying network from the programmer, there is no way to use those interfaces to send or receive data at the underlying network level.
There are valid reasons for doing this, however. One of them is shown in the in.rarpd command. When a diskless workstation is first turned on, it has no notion of what its network address is. Because it has an Ethernet chip, it has an Ethernet address, but this is not the same as an Internet Protocol address. And it needs to know its Internet Protocol address to talk to its server and begin the boot process. So, it sends out a special Ethernet broadcast packet using the Reverse Address Resolution Protocol (RARP), asking “Hey, does anybody know what my Internet Protocol address is?'' The in.rarpd program, running on a server, receives this packet, looks up the workstation's address in a database (usually the /etc/ethers file), and sends a RARP reply packet back to the workstation saying, “Yes, your address is AAA.BBB.CCC.DDD.''
The RARP protocol is not an Internet protocol like TCP and UDP are. The RARP protocol has its very own packet format that is defined differently for each network medium on which it is used. Thus, in.rarpd cannot use the socket or TLI interfaces to send or receive RARP packets. Instead, it must monitor the Ethernet directly waiting for these packets to arrive, and it must then format its own Ethernet packets in which to send its responses.

Previous SectionNext Section
Books24x7.com, Inc © 2000 –  Feedback