Networking tidbits, Operating System

Assignment Help:

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.


Related Discussions:- Networking tidbits

Deadlock detection, Deadlocks can be detected while the program is running,...

Deadlocks can be detected while the program is running, by running cycle detection algorithms on the graph that de?nes the current use of resources. De?ne this graph as follows:

What is the use of system programs, Q. What is the use of system programs? ...

Q. What is the use of system programs? Answer: System programs are able to be thought of as bundles of useful system calls. They provide fundamental functionality to users so

What is a client server system, What is a client server system? Central...

What is a client server system? Centralized systems proceed as server systems to satisfy request generated by client systems Server system is able to be broadly div

Network operating system, what is network operating? explain about it desig...

what is network operating? explain about it design issues?

Define properties of time sharing operating system, Define properties of Ti...

Define properties of Time sharing operating system Time sharing:- T his systems uses CPU scheduling and multiprogramming to provide economical interactive use of a system. The

What are the various disk-scheduling algorithms, What are the various disk-...

What are the various disk-scheduling algorithms? The several disk-scheduling algorithms are a. First Come First Served Scheduling b. Shortest Seek Time First Scheduling

Define different multithreading models, DIFFERENT MULTITHREADING MODELS ...

DIFFERENT MULTITHREADING MODELS Multithreading Models the majority multithreading models fall into one of the following categories of threading implementation: 1.      M

What is multiprogramming, Q. What is Multiprogramming? Multiprogrammin...

Q. What is Multiprogramming? Multiprogramming When two or more programs are in memory at the same instance, sharing the processor is referred to multiprogramming opera

Operating system structure, Problem: (a) Modern operating systems are i...

Problem: (a) Modern operating systems are interrupt driven. If there are no processes to execute, no I/O devices to service, and no users to whom to respond, an operating syste

Dynamic scheduling, Dynamic scheduling : The number of thread in a program...

Dynamic scheduling : The number of thread in a program may be changed during the course of operation. Dynamic priority scheduling is a kind of scheduling algorithm in which the pr

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd