To get a better understanding of the Mac OS X network architecture, you need to see how the pieces fit together. Look at what happens when you make a network setting change.
Adapting to External ChangesNetworking is dynamic in nature. Let's look at an example of how Mac OS X adapts to an external change.
Using ifconfigMac OS X includes the standard UNIX tool for configuring network interfaces, ifconfig. Both ifconfig and System Preferences make system calls to change the interface configuration. However, ifconfig and System Preferences do not communicate with each other. Warning ifconfig changes the network interface settings. If you use ifconfig, your system will be out of sync and will revert back to the contents of preferences.plist after a reboot. Also, while the terminal may be able to communicate with the network after editing with ifconfig, GUI applications may not work. This is why ifconfig should not be used to edit network configurations. In early versions of Mac OS X, ifconfig was the only way to set the speed and duplex of a particular interface manually. As you learned in the previous lesson, users can now adjust their speed and duplex settings directly within System Preferences. These changes are written to preferences.plist and incorporated as a variable in a network location. This new feature does not make ifconfig obsolete. ifconfig is the only way to view the entire interface configuration in one place, allowing easy examination of the current duplex state, speed, and MTU settings. This is particularly beneficial when your system is using an auto-negotiated Ethernet connection. Note Duplex mismatches are a common cause of poor network performance and connectivity issues. When troubleshooting network issues, make sure to run ifconfig and verify that the problem is not auto-negotiation. Configuration DataThe majority of network configuration information is stored in preferences.plist. This file contains the various sets of configuration information that a user creates, such as different locations and interface configurations. NetworkInterfaces.plist is a database that gives persistent names to network interfaces. Both of these configuration files are unique to Mac OS X and are located in /Library/Preferences/SystemConfiguration. One important note about hostconfig: Not all the information in hostconfig is useful, as some parameters are no longer used. In particular, the ROUTER property is still present yet has no function. It's a legacy attribute. The /etc/hostconfig file is a standard UNIX configuration file and contains information about the status of some services. In addition, the /etc/hostconfig file contains network configuration information. The /etc/services file is a text file that contains the default port numbers designated to different services registered with the Internet Assigned Numbers Authority (IANA). Some network configuration information is stored in the local NetInfo database, local.nidb. Note that the contents are not plaintext, so you need a tool such as NetInfo Manager or one of the NetInfo command-line tools to edit the local NetInfo database, such as nicl or dscl. It is important to back up the local NetInfo database along with the other configuration files. The local.nidb database is located in /var/db/netinfo. Warning It is best to maintain these files through System Preferences. If you make mistakes when you edit the configuration files manually, it may cause your system to be unstable and will be difficult to troubleshoot. |