Computer Networking Computer Networking... 0 Lesson 0. Addressing... 1 Lesson 1. HTML/HTTP... 2 Lesson 2. SMTP... 3 Lesson 3. HTML... 4 Lesson 0. Addressing First, you will use the ifconfig command to retrieve the IP address of the computer you are using: Step 0. Click 'Applications' -> 'System Tools' -> Terminal Step 1. Click on the command window that appears and type ifconfig. Step 2. What is the IP address of your computer? Next, you will use the traceroute command to determine the route taken by a message sent from your computer to one of your favorite websites: Step 0. Choose a website (like facebook.com or google.com). Step 1. At the command window, type traceroute website, replacing website with the domain name of the website you chose (e.g, tracert google.com). Step 2. How many routers forward messages sent from your computer to the website you chose? Step 3. Switch users and try a different website. Step 4. Do you see the same number of routers for the new website? Step 5. Do you think you would see the same number of routers if you tried this at home?
Now, you will use the nslookup command to determine the IP address of the websites you chose in the previous exercise: Step 0. At the command window, type nslookup website, again replacing website with the website you chose. Step 1. How many IP addresses did you find for your website? Step 2. Repeat the traceroute command, replacing the domain name (e.g., google.com), with one of the IP addresses you found for that website. Step 3. Do you see the same set of routers as you did when you used the domain name instead of the IP address? Step 4. Switch users and try a different website. Lesson 1. HTML/HTTP First, you will use the netstat command to look at the status of your computer s network connections, then you will telnet into a web server and view the changes to the network connections: Step 0. At the command window, type netstat. Step 1. Open a second command window ('Applications' -> 'System Tools' -> Terminal). At the prompt, type telnet google.com 80. You may replace google.com with the domain name of another website, or with the IP address of another website if you like, but be sure to include the 80 in any case. Step 2. Go back to the first window and type netstat again. Step 3. Do you notice any new connections? Can you identify the connection you just made? Now, you will retrieve a web page by speaking HTTP directly with a web server.: Step 0. In the window where you typed telnet, type GET /index.html.
Step 1. Open a browser window. In the URL bar, type the same domain name and click enter. When the page loads, go to the View menu and select Page Source. Compare the output of the GET command with the output you see in the Page Source window. Are they the same? Step 2. Switch users and start from the beginning using a different website. Next, you will retrieve a web page by using telnet to talk directly to a web server, and compare the HTML you get back from the web server with what you see in your browser window. Step 0. In your browser, open the following web page: http://www.cs.usfca.edu/~sep2009/htmlexercise.html Step 1. In one of your command windows, type telnet www.cs.usfca.edu 80. Step 2. Type GET /~sep2009/htmlexercise.html. Step 3. Compare the HTML you retrieve in the command window with what you see in the browser. Step 4. How do you make text bold? Step 5. How do you make text italic? Step 6. How do you specify the title that appears at the top of the window? Step 7. How do you include text that is not shown by the browser? Lesson 2. SMTP For this exercise, you will telnet directly into a mail server and use SMTP to send an email without using a mail client. For each instruction, replace the portion in italics with the appropriate information (e.g, replace your_email with something like president@usa.edu). Make sure to include the pointy brackets where specified. Step 0. At the command window, type telnet mail 25.
Step 1. Type HELO your_login_name. Step 2. Type MAIL FROM: <your_email>. Step 3. Type RCPT TO: <receivers_email>. Step 4. Type DATA and hit return. Type as much text as you want in the message, and then hit return, type a period, and hit return again. This will send your message. Step 5. Type QUIT. Step 6. Switch users and try again. Step 7. Now, try misspelling some of the commands (HELO, MAIL FROM, etc) and see what happens. Next, search the web for more information about the SMTP protocol. See if you can figure out how to do the following tasks: Step 0. Specify the Subject in a message. Step 1. Cc another recipient. Step 2. Send the message to three or more people. Lesson 3. HTML This is the sample html we saw in Part 2. <html> <body> <h1>html sample </h1>
<p>para with link</p> <a href="http://www.facebook.com.com"> This is a link for Facebook</a> <p>para with image</p> <!-- insert image here --> </body> </html> Step 0. Create a new file: -- 'Applications' --> 'Accessories' --> Text Editor -- Select the above html lines, copy (right click, copy ) and paste(right click, paste) above lines in it. -- 'Save As' --> samplehtmlsep10.html (note directory where you are saving it Step 1. Open this file by double clicking file. -- Your web browser will open the file -- Click on the link -- Does it open 'facebook'? -- if not, what is the error and how to fix it? Step 2. Insert image -- what is the line below ' <p>para with image</p>'? -- Does it appear in your browser? if not, why not? -- below this line ' <p>para with image</p>' insert an image -- refer this link for how to do it: http://www.w3schools.com/html/default.asp Step 3. 'View Source': -- Go to browser that is displaying your file samplehtmlsep10.html -- Right click: Choose 'View Source' -- What is this? -- Change something here and save -- Does it appear in your browser? -- If not, why not?