Networking tidbits, Operating System

There is a very small amount of networking background required for Project 2. In Project 2, we want our computer (or our "host") to request information over the Internet from a remote webserver (another Internet "host"). On our computer, from within our Project 2 ap-plication, we will open a "socket", which on many operating systems acts like a ?le which you can read or write. Moving down the network stack into the operating system, a socket uses a transport protocol to communicate with the remote host. The application-layer HTTP protocol which webservers use is built on top of the transport-layer TCP protocol, which provides reliable, in-order, stream-based delivery between your socket and the remote socket. A socket also has a "port" number associated with it. When we open our socket, we will request that it opens port 80 on the remote host, since this is the port number on which almost all webservers listen for re-quests.  Finally, when opening the socket, we need to specify which remote webserver we want to communicate with, such as www.cnn.com, etc. Moving down one more layer, every host (laptop, server, cell phone, etc) which is directly accessible on the Internet has a unique network-layer IP address, such as 128.119.240.19, and most of those have hostnames, such as www.cs.umass.edu; the Domain Name Service (DNS) translates from hostnames to IP addresses.

Note that the sock.read() method is in a while-loop, since reading from a socket will return between one byte and the maximum number of bytes requested ((MAX READ-1-size) in the code above). You'll need to keep repeatedly reading from the socket again until you get all the bytes you want. sock.read() will block until it has at least one byte to return, unless its request times out (set by sock.setTimeout(5) to be 5 seconds), or unless the connection is closed.

Posted Date: 3/12/2013 5:20:42 AM | Location : United States







Related Discussions:- Networking tidbits, Assignment Help, Ask Question on Networking tidbits, Get Answer, Expert's Help, Networking tidbits Discussions

Write discussion on Networking tidbits
Your posts are moderated
Related Questions
Q. More than one disk drive is able to be attached to a SCSI bus. Especially a fast wide SCSI-II bus can be connected to at most 15 disk drives. Remember that this bus has a bandw

What is an operating system process? How is it different from a program? Why do we need the concept of a process, rather than simply talk about programs running in memory? The e

General Graph Directory A serious trouble with using an acyclic graph structure is making sure that there are no cycles. When links are further added to an existing tree struc

What does the last four digits '0010' of the above dump represent? What action will the Destination node takes when it receives this packet? The last four digits '0010' denotes

Locality of reference entails that the page reference being made by a process  Locality of reference entails that the page reference being made by a process is similarly to be

What is meant by arm-stickiness? If one or a few processes have a high access rate to data on single track of a storage disk, then they might be monopolizing the device by repe

What are the features of Operation Research approach?

You have been requested by your Senior Engineer to design an Engine Control Unit (ECU) and prepare a report detailing your proposed solution. The client requires a design for a mic

Explain the Resource Ownership by Platform Ownership of data items may further be complicated by concepts defined in certain operating systems. Each operating system defines "p

Determine the task of the Pass II In a two-pass assembler Synthesize the target program is the task of the Pass II