The purpose of this exercise is to find out about the connection of your computer (an End System) to the network. Most computers at the University 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.
Logon to a workstation and examine the connection to the local LAN
Telnet to sandbox and logon.Type:
The computers at the University use the IP network protocol to communicate. The details of the IP configuration for your computer may be found by using the "ifconfig" (interface configuration) program with a "-a" option to show the status all network interfaces.
/sbin/ifconfig -a
The command you typed was prefixed by "/sbin/" to indicate that the program was stored in the /sbin directory. You will find that many of the programs which examine the network require you to specify the directory where the program is stored.What information is displayed about the loop back interface on your computer?The information which is displayed by ifconfig 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) and another will be a software driver called the "loop back interface". A computer with additional network interface cards will have one entry for each network connection which may be used by IP.
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 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).
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:
/usr/sbin/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 packet and generates an echo reply packet. This is transported by the IP network back to the client program which, when the packet is received, displays a message telling you that the remote computer is "alive". If the packet is not received within a set period of time, the client program assumes that the remote computer did not reply.From the information returned when you typed "/etc/ifconfig -a" can you find out the primary IP address of your computer?In the information displayed when you typed "/etc/ifconfig -a", 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 labeled le0:, ie0: 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.
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:
/usr/sbin/ping followed by the required IP number.
Did you receive a reply? (i.e. a line of text showing that the interface is "alive").Can you use the subnet mask to find out the network address of the local IP network?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.
Look back at the information previously displayed by the ifconfig -a command which you typed.Does your host use an all 1's or all 0's host part for its IP broadcast address?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 from ifconfig 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 broadcast 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.
We will use the IP broadcast address in exercise 2.