473,795 Members | 2,766 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTTP Protocol question

I'm trying to learn how the HTTP protocol works. When aserver has many
clients accessing it at the same time. Say 200 people. How does it maintain
connection with 200 different concurrent client using only port 80? From
what I've read and if I understand this correctly, a TCP/UDP port a maintain
connection with one client at a time. Can someone explain it to me? I
believe FTP works the same way right?
Thanks in advance
Aaron
Nov 22 '05 #1
5 1648
Hi Aaron,

Here are some of the basics:

You can only open a single *passive* connection on a port. A passive
connection is a 'connection' that waits and listens for incoming
active connections. Once the web server starts listening on port 80 -
then no one else will be allowed to listen for incoming connections on
port 80 - this is why each server program listens on a different port.

You can have multiple *active* connections on a single port, as long
as each connection is unique, as determined by these 4 pieces of
information:

1) Host IP address
2) Host port
3) Client IP address
4) Client port

So for instance, if I run "netstat" from the command line I see my
computer has 2 concurrent connections open to a web server on my
network, but these connections originate from different local ports
(that IE picked at random):

Proto Local Address Foreign Address
TCP mycomputer:4239 10.10.10.10:htt p
TCP mycomputer:3927 10.10.10.10:htt p
(Also note Netstat replaces IP and PORT numbers with names when it
can).
As long as each connection is unique, there is never any confusion as
to where to send a packet. You can imagine 200 concurrent users
working because those 200 will all have different ClientIP:Port
address portions - and because each connection is *uniquely
identifiable* - the web server will always know where to send the
response.

Make sense?

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Mon, 23 May 2005 21:58:46 -0700, "Aaron" <ku*****@yahoo. com> wrote:
I'm trying to learn how the HTTP protocol works. When aserver has many
clients accessing it at the same time. Say 200 people. How does it maintain
connection with 200 different concurrent client using only port 80? From
what I've read and if I understand this correctly, a TCP/UDP port a maintain
connection with one client at a time. Can someone explain it to me? I
believe FTP works the same way right?
Thanks in advance
Aaron


Nov 22 '05 #2
Hi Aaron,

Here are some of the basics:

You can only open a single *passive* connection on a port. A passive
connection is a 'connection' that waits and listens for incoming
active connections. Once the web server starts listening on port 80 -
then no one else will be allowed to listen for incoming connections on
port 80 - this is why each server program listens on a different port.

You can have multiple *active* connections on a single port, as long
as each connection is unique, as determined by these 4 pieces of
information:

1) Host IP address
2) Host port
3) Client IP address
4) Client port

So for instance, if I run "netstat" from the command line I see my
computer has 2 concurrent connections open to a web server on my
network, but these connections originate from different local ports
(that IE picked at random):

Proto Local Address Foreign Address
TCP mycomputer:4239 10.10.10.10:htt p
TCP mycomputer:3927 10.10.10.10:htt p
(Also note Netstat replaces IP and PORT numbers with names when it
can).
As long as each connection is unique, there is never any confusion as
to where to send a packet. You can imagine 200 concurrent users
working because those 200 will all have different ClientIP:Port
address portions - and because each connection is *uniquely
identifiable* - the web server will always know where to send the
response.

Make sense?

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Mon, 23 May 2005 21:58:46 -0700, "Aaron" <ku*****@yahoo. com> wrote:
I'm trying to learn how the HTTP protocol works. When aserver has many
clients accessing it at the same time. Say 200 people. How does it maintain
connection with 200 different concurrent client using only port 80? From
what I've read and if I understand this correctly, a TCP/UDP port a maintain
connection with one client at a time. Can someone explain it to me? I
believe FTP works the same way right?
Thanks in advance
Aaron


Nov 22 '05 #3
In message <uP************ **@tk2msftngp13 .phx.gbl>, Aaron
<ku*****@yahoo. com> writes
I'm trying to learn how the HTTP protocol works. When aserver has many
clients accessing it at the same time. Say 200 people. How does it maintain
connection with 200 different concurrent client using only port 80? From
what I've read and if I understand this correctly, a TCP/UDP port a maintain
connection with one client at a time. Can someone explain it to me? I
believe FTP works the same way right?
Thanks in advance
Aaron


In addition to Scot's excellent explanation ...

A web server normal deals with many clients by maintaining a Thread
Pool. The server determines whether it should Accept the incoming
connection and then passes the request, along with the client socket
details, to the thread pool. The thread pool then deals with the request
while the main Thread goes back to waiting for the next request.

This approach enables the web server to handle potentially thousands of
requests (seamingly simultaneously) .

--
Andrew D. Newbould E-Mail: ne********@NOSP AMzadsoft.com

ZAD Software Systems Web : www.zadsoft.com
Nov 22 '05 #4
In message <uP************ **@tk2msftngp13 .phx.gbl>, Aaron
<ku*****@yahoo. com> writes
I'm trying to learn how the HTTP protocol works. When aserver has many
clients accessing it at the same time. Say 200 people. How does it maintain
connection with 200 different concurrent client using only port 80? From
what I've read and if I understand this correctly, a TCP/UDP port a maintain
connection with one client at a time. Can someone explain it to me? I
believe FTP works the same way right?
Thanks in advance
Aaron


In addition to Scot's excellent explanation ...

A web server normal deals with many clients by maintaining a Thread
Pool. The server determines whether it should Accept the incoming
connection and then passes the request, along with the client socket
details, to the thread pool. The thread pool then deals with the request
while the main Thread goes back to waiting for the next request.

This approach enables the web server to handle potentially thousands of
requests (seamingly simultaneously) .

--
Andrew D. Newbould E-Mail: ne********@NOSP AMzadsoft.com

ZAD Software Systems Web : www.zadsoft.com
Nov 22 '05 #5
This makes perfect sense. Thank you guys so much.

Nov 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1615
by: Elaine Jackson | last post by:
I want to run an http server but I don't know how to get started. I've read through the documentation for the relevant modules, but I don't have enough http knowledge to get the initial spark I need, and I can't seem to track down the knowledge in question on the web or at the library. Maybe somebody can point me toward some resources? In case you feel like answering a specific question, here's one: How does http addressing work? I...
8
10651
by: turnit \(removethis\) | last post by:
I have a login form that uses the post method to carry the information to the next page. The form works just fine in ie6.0, but fails in mozilla and fails in ie5.2 on a mac. "HTTP/1.1 400 Bad Request" was the original error msg now that I reinstalled iislockdown and urscan I get "The parameter is incorrect." If I use the get method with this form it works just fine on everything. I can't say for certain but I think this problem started...
14
2010
by: DaveC | last post by:
I know this is the wrong group but I need a little pointing in a direction please. I need to write an implementation of a yet to be published protocol. It is transported over the internet via IP. Can any one help me with ideas of how to write such drivers in Windows? or if that's not doable should I develop it in Linux? This is just for testing. Thanks DaveC
16
2603
by: Andy Lai | last post by:
Hi, I am writing a C++ program which needs to post an XML to an HTTP server periodically and the program will run on different platforms including w32, linux, and unix. I see that there are some library available out there including cURL and Libwww from w3c. I will spend some time on them myself but if anyone are familiar with them, please share know how good they compile/run on different platforms. Also, if there is a better HTTP
0
1121
by: Dde | last post by:
Hi, Sorry for re-posting on a similar subject. The problem I have is that my webmethods using complex objects as parameters are not exposed in the WSDL under the HTTP Post protocol section but are present in the SOAP protocol section. Of course I enabled HTTP Post in the web.config and it works since other webmethods are exposed. Final question is does HTTP Post protocol support complex types ? Thanks Dominique
4
2482
by: Bob Badger | last post by:
Hi, Simple question (although I guess with a complicated answer). Is HTTP an async protocol? For instance, if I send a message to a c# webservice via http what is the protocol actually doing? Thanks in advance Steffan
1
2692
by: Benry | last post by:
Hi guys. I hope I can discuss Twisted here. If not, direct me to the correct place please. My question(s): I'm working on a custom network protocol (application layer in TCP/IP model) for a custom network. Please don't try to talk me out of this. I'm limiting many of the other protocols, because this is in a highly secure network, and latency/bandwidth is key. The packet sizes are minimized by the protocol design, which is ideal. ...
10
3239
by: rup | last post by:
Hello, This is my first application on socket programming in vc++. I am facing problem that how to make connection to server, & make GET/POST request by HTTP. Please help me. Its urgent.... Thanks
5
1239
by: =?Utf-8?B?Q2hhcmxlc0E=?= | last post by:
hi folks does anyone know of any articles on the web that explain clearly what is happening (in detail) when you post an .aspx page to the web server and when it returns a new page to your browser? I'd just like to know this sort of thing as I think it will make me a better ASP.net programmer Regards and many thanks in advance CharlesA
2
1997
by: rn5a | last post by:
Using CDO.MESSAGE, can e-mails in ASP be sent using the HTTP protocol instead of the SMTP protocol? If yes, then how? If no, then is there any other way to send e-mails in ASP using the HTTP protocol?
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10213
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.