473,405 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

regarding TCP/IP

17
I have some doubts regarding Tcp/Ip.how one can identify packets belongs to a particular process.(ie)while browising we r simultaniously requesting for Yahoo.Google....,and so many.how the response packets r sending exacltly to those yahoo,Google in windows.Which part of OS is esponsible for it?
Jan 24 '07 #1
9 2458
Banfa
9,065 Expert Mod 8TB
I assume you mean if you have 2 Windows (or Tabs) open in IE (or Firefox or whatever browser you use).

it is part of how the connection works (not really a part of the OS but part of the specification of sockets).

When you request a page from Google your browser opens a socket on a specific port of your computer and then connects to the Google server using it's IP address to locate it and port 80 (because that is the normal listening port for HTTP traffic). The IP address of you computer and the port number of the application are embedded in the TCP/IP packets sent to Googles server so when it sends back the HTML page data it knows where to reply to. It sends the data to your IP address and port number, when your comupter receives the data the socket layer uses the port number to route the packet to the correct application.

So if you simultaneously request data from Yahoo in another browser window/tab another socket is open (because sockets are point to point connections) with a new port number. because the port number is different when the data is returned it gets routed to the new Window/tab with the new socket.



This of course all gets a little messed up if you are sat behind a router (which you are, either at home, or at your ISP or at work) because the router does IP address and port remapping, that is when it receives TCP/IP packets from your computer it may insert a different IP address or port number (or both) into the packet. The router then keeps a record of this so that when it receives the reply to the altered IP address/port number if re-writes the orginal IP address and port number into the reply packet and forwards this packet to tyour computer.

It is this method of IP address/port re-writing that allows a router to present a fix (small) number of IP addresses to the internet (or at least the next subnet up) while handling connections from many computers on the its private side (your home network).
Jan 24 '07 #2
Ushach
17
thanks for giving me the reply.Is it possible to identify the process based on the destination address and portno?Yahoo,Google all use HTTP, port80 only.So each has it's own socket Is this correct?
Jan 25 '07 #3
Banfa
9,065 Expert Mod 8TB
Thanks for giving me reply,u gave me reply as,
So if you simultaneously request data from Yahoo in another browser window/tab another socket is open (because sockets are point to point connections) with a new port number.

Yahoo is using HTTP protocol.So it has to use port 80.then why it creates another socket with different port number?what is the difference between socket and port?
. .
Jan 25 '07 #4
Banfa
9,065 Expert Mod 8TB
Remember there is a socket with it's own port number at each end of the link, so Yahoo and Google each have open listening sockets on port 80.

When you connect to Yahoo your computer creates a socket on a random(ish) port to connect to the Yahoo listening socket on port 80

You:PortX <-> Yahoo:80

When you connect to Google your computer creates another socket on another random(ish) port to connect to the google listening socket on port 80

You:PortY <-> Google:80

In these cases it is unlikely that either PortX or PortY will be 80, the port numbers at each end of a link do not have to match (and in reality rarely do match).

The port defines the application (or protocol) thaat the conenction will be using and most port numbers below 1024 are reserved for specific applications (there is a list here).

The reason that Yahoo, Google and all other web servers listen on port 80 is that your browser has to know which port it has to connect to in order to attach to the web-server. The only way to do this globally is if the port number is fixed, so all web-servers listen on port 80.

This is not a requirement though, you could set up a web server that listened on port 1200 but then you would have to include the port number in the URL when you typed the address into your browser so that it wouldn't use the default of 80.
Jan 25 '07 #5
Ushach
17
how incoming packets of yahoo,google reach their destination.how the packets bind to a particular socket?
Jan 26 '07 #6
Banfa
9,065 Expert Mod 8TB
The packet contins the IP address and port number that it is destined for so the socket driver can read that and send it to the correct socket/program.
Jan 26 '07 #7
Cyberdyne
627 Expert 512MB
Start your PC and connect to Yahoo.com and then in a separate Window Connect to Google.com

then I want you to go to start and press start .. type in cmd and hit OK

when the command prompt window comes up I want you to type in netstat there you can see the website connections and port number they use, hopefully this will give you a better idea to you question.


Regards, Cyber.
Jan 27 '07 #8
Ushach
17
The packet contins the IP address and port number that it is destined for so the socket driver can read that and send it to the correct socket/program.
That means Socket Driver ia a program which stores SocketNo,PortNo,Ipaddress and then maps the Incoming packet according to it.Is it inbuilt of operating system?
Jan 27 '07 #9
Banfa
9,065 Expert Mod 8TB
That means Socket Driver ia a program which stores SocketNo,PortNo,Ipaddress and then maps the Incoming packet according to it.Is it inbuilt of operating system?
It isn't a program and it isn't really part of the OS.

The drivers that drive the network hardware are part of the OS but the Socket Driver is a library that you build into your program that then communicates with the network hardware driver.

How the data is managed between the lower levels of the software I don't know but I would imagine that actually the Network Driver would be the one to store that data (otherwise the Netstat function would have trouble working).
Jan 27 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Francis Lavoie | last post by:
Hello I have some questions regarding webframework, I must say that I quite lost and these questions are basicly to help me understand the way it work. I have some knowledge with PHP and JSP....
3
by: praba kar | last post by:
Dear All, I am new to Python. I am in need of some sorting functions (eg) numerical sorting functions and alphapetical sorting functions. I have searched through net But I cannot find any...
3
by: Samuel | last post by:
I wrote a very simple httpmodule and tried to compile it with no success. This is my code: ============== Imports System Imports System.Web Imports Microsoft.VisualBasic NameSpace...
7
by: Squignibbler | last post by:
Hi all, I have a question regarding the C++ programming language regarding the nature of the relationship between pointers and arrays. If the statement MyArray is functionally identical to...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
2
by: Dean R. Henderson | last post by:
For an ASP.NET web application, is there a way for one session (with appropriate security authorization) to set a HttpSessionState variable to point to another session and execute the Abandon...
5
by: archana | last post by:
Hi all, I am using timer to do some functionality on user specified time. I am using system.timers.timer class and its timer to do this functionality. What i am doing is i set autoreset to...
1
by: Dave | last post by:
Hi guys, i have a small question regarding register_globals I have managed to change the way my forms work so they will process with register_globals turned off. However i have one page which...
1
by: Jim Flanagan | last post by:
Hello - I am in need of more help regarding an approach to accomplishing the following: We have a need to change the Volume serial numbers of a bunch of preprogrammed IDE Solid State Drive...
8
by: somenath | last post by:
Hi All, I have a doubt regarding the pointer assignment . Please have a look at the following program . #include<stdio.h> #include<stdlib.h> #define NAMESIZE 10 #define SAFE_FREE(t) if(t)\...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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,...
0
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...

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.