Sei sulla pagina 1di 6

Engineering for Internet Applications Lab 1 Tooba Aamir - 396447

University of Melbourne (Semester-2 2011) Department of Computer Science and Software Engineering

Course title Engineering for Internet Applications

Submitted by: Tooba Aamir 396447

Dated August, 5 2011

Engineering for Internet Applications Lab 1 Tooba Aamir - 396447 1. Write in your lab report a paragraph describing the drawbacks of using
network address translation, as opposed to using a unique IP address for every host.

Network Address Translation(NAT) translates private IP addresses and ports to public routable IP addresses. Foremost disadvantage in NAT is in usage of protocols in which the IP address is embedded within the packets, or with those where there is a need for a remote host to initiate a connection to the host behind the NAT because rewriting of packet headers has the potential to cause problems. In such cases IP forwarding is to be enabled before using NAT to make an Internet connection. [1] Also NAT provides minimum logging services. So because of the short-lived nature of the stateful translation tables in NAT routers, devices on the internal network lose IP connectivity typically within a very short period of time unless they implement NAT keep-alive mechanisms by frequently accessing outside hosts. This shortens the power reserves on battery-operated hand-held devices and decrease popularity of such Internet-enabled devices. Similarly, NAT is not adept in detecting attacks. [2]
2. Include the output of your program for the "www.unimelb.edu.au", "yahoo.com","google.com".
import java.net.*; import java.io.*; public class Main { public static void main(String[] args) { try{

following

inputs:

InetAddress localA = InetAddress.getLocalHost(); InetAddress add = InetAddress.getByName(args[0]); String Hostname = add.getCanonicalHostName(); String HostIP = add.getHostAddress(); System.out.println("Host Name is: "+ args[0]); System.out.println("Complete Host Name is: "+ Hostname); System.out.println("IP ADDRESS is: "+ HostIP);

} catch( UnknownHostException e){} } }

www.unimelb.edu.au

www.yahoo.com

Engineering for Internet Applications Lab 1 Tooba Aamir - 396447

www.google.com

3. Include your entire source code in your report. Show the output for each of the same inputs from (2).
import java.net.*; import java.io.*; public class Main { public static void main(String[] args) { int timeout = 5000; try{ InetAddress localA = InetAddress.getLocalHost(); InetAddress add = InetAddress.getByName(args[0]); System.out.println("Host Name is: "+ args[0]); try { if(add.isReachable(timeout)) { System.out.println("IP ADDRESS is reachable!"); } else { System.out.println("IP ADDRESS is not reachable!"); } } catch (IOException e) {e.printStackTrace();} } catch( UnknownHostException e){} } }

www.unimelb.edu.au

www.yahoo.com

www.google.com

Engineering for Internet Applications Lab 1 Tooba Aamir - 396447

4. Include your lab1.html file in your lab report. CODE:


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Jhang, Pakistan</title> <center> <h1>Jhang, Pakistan (My City)</h1> </center> <p>Jhang is the principal city of Jhang District, known historically as Sandal Bar in the Punjab province of Pakistan. It is situated on the east bank of the Chenab river, about 210 kilometres from Lahore and 35 kilometres from Gojra. According to the 1998 census of Pakistan it had a population of 387,418</p> <table align="right" border="1"> <tr> <td><img src="images.jpg" alt="Jhang Map" width="300" height="300" /></td> <td><img src="Pakistan.jpg" alt="Pakistan Map" width="300" height="300" /></td> </tr> <tr> <td>Country</td> <td>Pakistan</td> </tr> <tr> <td>Province</td> <td>Punjab</td> </tr> <tr> <td>Population (1998)</td> <td>387,418</td> </tr> <tr> <td>Time Zone</td> <td>PST (UTC + 5)</td> </tr> </table> <h2>History</h2> <p>The area was inhabited at the time of Alexander but the present city of Jhang is said to have been founded in the twelwth century by syed jalal-ud-din bukhari (in 1134 AD according to some sources).Its first inhabitants were sials who were followers ( mureed) of syed jalal-uddin bukhari.It was then destroyed by the river and re-founded during the reign of Aurangzeb by syed Mehboob alam ( shah jewna) who asked his (mureeds) followers to settle again in that area in year1402 AD .Under Mughal rule, the city flourished and was notable for commerce and trade. During British Rule, the towns of Jhang and Maghiana, lying two miles apart, became a joint municipality, then known as Jhang-Maghiana. Jhang-Maghiana became a municipality in 1867[citation needed]. The income during the ten years ending 1902-3 averaged Rs.46,800 and the expenditure Rs. 44,200, in 1903-4 the

Engineering for Internet Applications Lab 1 Tooba Aamir - 396447


income was Rs. 49,700 mainly derived from octroi. Maghiana lies on the edge of the highlands, overlooking the alluvial valley of the Chenab, while the older town of Jhang occupies the lowlands at its foot. <p>Commerce declined in Jhang, which was no longer considered a place of importance. Maghiana, however, had a considerable trade in grain and country cloth, and manufactured leather, soap, locks and other brass-work[citation needed]. Maghiana also contained a civil hospital, whilst Jhang had a high school and a dispensary. The population in 1901, according to the 1901 census of India, was 24,381 of whom 12,189 were Hindus and 11,684 were Muslims.</p> <h2>Culture</h2> <p>Jhang is the burial place of Heer and Ranjha, of Punjabi folklore. Punjabi folk dances such as Jhummar and Sammi are from this area. Jhummar is a dance for men while Sammi is danced by women. Traditionally men wear turbans and dhotis (like a kilt) though in recent years people have started wearing the national dress which is shalwar kameez. Historically there was a considerable weaving industry in Jhang, but this has since declined. <p>Punjabi folk dances such as Jhummar and Sammi originated in Jhang District. Jhummar is a dance for men while Sammi is for women. The district also originated a well-known form of folk music known as "Dhola", or "Jhang da Dhola". <p>Traditionally men wear turbans and dhotis (similar to a skirt or kilt) though in recent years people have started wearing the national dress, the shalwar kameez. Some older women also wear dhotis. When women wear dhotis, the style is referred to called "Majhla" in Jhangochi; th male style is called "Dhudder". However, it is more common for women to wear shalwar kameez. <p>Street sports are important in Jhang District and include tent pegging (naiza baazi), kabaddi, volleyball, cricket and football (soccer). <P>In the past, women wove cloth with spinning wheels, known as Teeyan and Trinjan, but now that the area is industrialized the practice is no longer common. <P>The northwestern Jhang District, particularly the area at the west bank of the Jhelum River, is somewhat different in its culture because it is more influenced by the Thalochi culture emanating from the neighboring districts of Mianwali and Bhakkar . <h2>References</h2> <p> 1. <a href="http://dsal.uchicago.edu/reference/gazetteer/pager.html? objectid=DS405.1.I34_V14_141.gif"> Jhang-Maghiana article in the "Imperial Gazetteer of India", v. 14, p. 134.</a> <p> 2. <a href="shttp://en.wikipedia.org/wiki/Jhang"> wikipedia, Jhang, Pakistan</a> <h2>See Also</h2> <table align="left" border="1"> <tr> <td>Dr. Abdus Salam, Nobel laureate</td> <td><a href="http://en.wikipedia.org/wiki/Abdus_Salam"> <img src="DAS.jpg" alt="Dr. Abdus Salam" width="32" height="32" /> </a></td> </tr> <tr> <td>Allama Tahir-ul-Qadri, Islamic scholar and politician</td> <td><a href="http://en.wikipedia.org/wiki/Tahir-ul-Qadri"> <img src="ATQ.jpg" alt="Allama Tahir-ul-Qadri" width="32" height="32" /> </a></td> </tr> <tr>

Engineering for Internet Applications Lab 1 Tooba Aamir - 396447


<td>Aleem Dar, ICC Cricket Umpire</td> <td><a href="http://en.wikipedia.org/wiki/Aleem_Dar"> <img src="ICC.png" alt="Aleem Dar" width="32" height="32" /> </a></td> </tr> </table> </head> </html>

Potrebbero piacerti anche