The purpose of this exercise is to find out about the connection of your computer (an End System) to the network. Most computers at a University or Company are directly connected to one or another type of Local Area Network. The exercise will consider only the protocol layers at, and below, the network layer.
Examine the connection to the local LAN
The computers use the IP network protocol to communicate. The details of the IP configuration for your computer may usually be found by using the "ifconfig" (interface configuration) program with a "-a" option to show the status all network interfaces. (On a PC use the alternative command "ipconfig -all" .)
Type:
/sbin/ifconfig -a
You will find that many of the programs which examine the network require you to specify the directory where the program is stored.
The information which is displayed consists of a series of lines, with one entry for each network interface connected to the computer. All computers will have at least two interfaces. One will be an interface to a network interface card (e.g. an Ethernet card). A computer with additional network interface cards will have one entry for each network connection which may be used by IP.
Another interface will be a software driver called the "loop back interface". The loop back interface is used by the computer to route IP packets from a client program on a computer to a server program which is running on the same computer. The information displayed by ifconfig will include an entry for the loop back interface (normally called lo0:). This output may look something like:
lo0: flags=49(UP,LOOPBACK,RUNNING) inet 127.0.0.1 netmask ff000000
This example information shows that some options have been set (49) that the interface is connected (UP), it is running in loop back (LOOPBACK) and that it is currently operational (RUNNING). The internet (IP) network address is 127.0.0.1 (in dotted decimal notation) and the IP netmask is 0xff000000 (in hexadecimal).
This is not shown by the ipconfig command on a PC, but the loopback interface is still there!
What information is displayed about the loop back interface on your computer?
The information probably looks similar and shows that the loop back interface is also running on your computer.
Verify that the loop back interface is indeed working!
Type:
ping 127.0.0.1
The ping command sends an ICMP echo request packet from the client (your computer) to another IP network node. The ICMP server program at the specified destination (which in this case is also your computer, but is more normally another system) receives the echo request message and generates an echo reply message. This is transported by the IP network (in an IP packet) back to the client program. When the message is received, the client displays a line of text telling you that the remote computer is "alive". If the message is not received within a set period of time (i.e., the IP packet was discarded or corrupted within the network), the client program assumes that the remote computer did not reply.
In the information displayed when you typed "ifconfig -a" or "ipconfig -all", there should be information about the main or primary IP address of your computer. This is the network interface which connects your computer to the LAN. This will probably be labelled le0:, ie0:, eth0:, en0:, hme0:. ed0:, or something similar. An example for a computer with a primary IP addresses of 139.133.254.1 (in dotted decimal notation) is shown below:
le0: flags=63 (UP,BROADCAST,NOTRAILERS,RUNNING) inet 139.133.254.1 netmask ffffff00 broadcast 139.133.254.0
Some computers have more than one network interface, in this case the first entry in the table is usually identified as the primary interface. (Some computers also support IPv6, the latest version of the Internet Protocol. You should ignore IPv6 for the moment, since it is not covered by this exercise.)
From the information returned when you typed "ifconfig -a" can you find out the primary IP address of your computer?
Remember that the convention for specifying an IP address is to use dotted decimal notation. In this notation, the decimal value of each of the four bytes of address is separated by a decimal point. An address such as 139.133.254.1 corresponds to the 32-bit hexadecimal value 0x8685FE01.
Now use the Ping program to check that this interface is working.
Type:
ping followed by the required IP number.
Did you receive a reply? (i.e. a line of text showing that the interface is "alive").
You should have.
In fact, no packet was ever sent on the Ethernet LAN! Since the destination IP address of the ICMP Echo request packet (which was specified by you) was the same as your own computer's IP address, this packet would not be sent to the network. Instead it would be routed via the software loopback driver which you have previously used.
Can you use the subnet mask to find out the network address of the local IP network?
Look back at the information previously displayed by the ifconfig -a command that you typed.
The IP network address is the bit-wise logical AND of the netmask and the IP address. (N.B. The IP address of the computer and the IP network address are different things which are easily confused. Make sure you know the difference.)
The primary IP address of your computer probably connects the computer to the local LAN. Since most LANs support broadcast (i.e. one-to-many) transmission, the information about the interface probably shows that the interface is capable of broadcast communication.
An IP network broadcast address is specified for each LAN interface to allow the computer to communicate with all other computers directly connected to the same local IP network. The IP network broadcast address is the same as the IP network address with all the bits of the host number part of the address set to 1's or 0's.
Does your host use an all 1's or all 0's host part for its IP network broadcast address?
We will use the IP network broadcast address in exercise 2.
http://www.erg.abdn.ac.uk/users/gorry Date: 10/11/1995 Revised: 7/10/2003