• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

protocols quary: need help

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello dovelopers,

i have a confusion regarding protocols like ftp,http,etc as i worked using http and smtp in java. i know the best way to understand it is to go through diffrent resources, but i think if i am not using few of these then it will be harder me to understand these.

however, i know these theoratically but i cant understand diffrence practically.
ok , http is for accesing web pages over a web, ftp for transferring files between diffrent hosts and smtp for handeling mail services.
but this sentence ftp for transferring files between diffrent hosts, confusing me, because smtp also used for same perpose.

please let me clear, when a request is made for a file over a web then at which point http used? at which point tcp/ip used ? at which point ftp used? please give examples on acual process running upon these protocls over a network

hope, question will be cleared to you

[ November 26, 2007: Message edited by: Nidhi Nagre ]
[ November 26, 2007: Message edited by: Nidhi Nagre ]
 
Ranch Hand
Posts: 691
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Http protocol is built on top of TCP protocol.
Will get more information here.

SMTP works on port 25 it mainly used for sending mails.

FTP works on port 21, used out-of-band control and mainly used for file transfer.

All internally needs TCP connection.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

but this sentence ftp for transferring files between diffrent hosts, confusing me, because smtp also used for same perpose.


SMTP is for sending mail, not for transferring files. Files can be included in mails as attachments, but that's not its primary purpose. You can't somehow transfer files over SMTP without sending mail.

when a request is made for a file over a web then at which point http used? at which point tcp/ip used ? at which point ftp used?


There are many ways (using various protocols) to transfer files over the internet, but if you say "web", it is commonly understood to mean HTTP. Most web browsers also support FTP, so it's possible to use them to download files from "ftp://" URLs as well as "http://" URLs. Both HTTP and FTP use TCP as a foundation, which in turn is built on top of IP.
 
Nidhi Nagre
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks mr Ulf,


SMTP is for sending mail, not for transferring files. Files can be included in mails as attachments, but that's not its primary purpose. You can't somehow transfer files over SMTP without sending mail.



by the way, which which one is used for transferring files, http or ftp? or both? or it dipends on the size of files data?


There are many ways (using various protocols) to transfer files over the internet, but if you say "web", it is commonly understood to mean HTTP. Most web browsers also support FTP, so it's possible to use them to download files from "ftp://" URLs as well as "http://" URLs. Both HTTP and FTP use TCP as a foundation, which in turn is built on top of IP.



i tried to open the following page using URL ftp://www.orkut.com but IE 7.0 couldn't open this page. may be that ftp is not supported by IE7.0, isn't it? or any other reason?

well, i have also seen about TCP Vs UDP. do it comes under TCP/IP. ok, i know how TCP is related with http and ftp but dont know how UDP? what is it used for? and moreover how IP is related with all of these.

just give me few example then all the things would be cleared to me.

thanks
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

which which one is used for transferring files, http or ftp? or both? or it dipends on the size of files data?


Both are. Which one is appropriate and/or applicable depends on the circumstances.

i tried to open the following page using URL ftp://www.orkut.com but IE 7.0 couldn't open this page


www.orkut.com is a web server, not an ftp server. The protocols are not interchangeable - while it's possible to do some file transfers over HTTP (within limits), FTP can't be used to access web sites.

well, i have also seen about TCP Vs UDP. do it comes under TCP/IP. ok, i know how TCP is related with http and ftp but dont know how UDP? what is it used for? and moreover how IP is related with all of these.



TCP and UDP are both built on top of IP. The principal difference between TCP and UDP is that UDP is not a guaranteed protocol - if you send a UDP packet you have no guarantee that it arrives, or that you get a notifcation if it doesn't. TCP is guranteed - a TCP packet either arrives at its destination, or the sender gets an error message that it didn't. This feature of UDP makes it tricky to build more sophisticated protocols on top of it.

You might get a better understanding by reading up on the TCP/IP protocol stack and its layers.
[ November 27, 2007: Message edited by: Ulf Dittmer ]
 
Nidhi Nagre
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks again,

it means, when a request is made over a network then, since the request is being passing down (from application to physical) across each layer, it uses diffrent protocols(http,ftp,tcp,udp etc dipends on circumstances) those are specific to a particular layer, right?


www.orkut.com is a web server, not an ftp server. The protocols are not interchangeable - while it's possible to do some file transfers over HTTP (within limits), FTP can't be used to access web sites.



can we define any protocol(http or ftp) for a webserver according to requirement?
in which case ftp is defined and in which http?

and does all the protocols(at each layer) are used automaticaly according to their requirements by a request? or is it predifined context?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

when a request is made over a network then, since the request is being passing down (from application to physical) across each layer, it uses diffrent protocols(http,ftp,tcp,udp etc dipends on circumstances) those are specific to a particular layer, right?


Yes.

can we define any protocol(http or ftp) for a webserver according to requirement?


No. A web server uses HTTP. If you want to use FTP, you must use an FTP server.

in which case ftp is defined and in which http?


See above. The protocol is not defined, it depends on what kind of server you're talking to.

do all the protocols(at each layer) are used automaticaly according to their requirements by a request? or is it predifined context?


I'm not quite sure what you're asking, but the protocols to be used in lower layers are determined by the higher layer protocol. Most high-level protocols (SMTP, POP, FTP, HTTP, NNTP, Telnet, ...) use TCP underneath, which is based on IP. See the Wikipedia link I posted for details.
 
Nidhi Nagre
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a zillion to you.

i think,certailny the people like you are front end of the guys who is having a crave to become eficient developer in this field.

thanks one 2nd

one more thing,

when we are talking about, like http has port 80, ftp has port 21, then what does this mean.
where the ports are available and how http ftp works on these ports?

how clients uses a port number to communicae to a host?
is the port is logical entity or a physical entity?
[ November 27, 2007: Message edited by: Nidhi Nagre ]
 
Jignesh Patel
Ranch Hand
Posts: 691
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nidhi Nagre:


when we are talking about, like http has port 80, ftp has port 21, then what does this mean.
where the ports are available and how http ftp works on these ports?

how clients uses a port number to communicae to a host?
is the port is logical entity or a physical entity?

[ November 27, 2007: Message edited by: Nidhi Nagre ]



My understanding is ports are physical entity. Client will identiy they machine my their URL which in turns maps to their IP. Now for that machine if it is a HTTP request then it is redirect to the http listener at port 80.

Ulf can add more detail to his.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jignesh Patel:
My understanding is ports are physical entity. Client will identiy they machine my their URL which in turns maps to their IP. Now for that machine if it is a HTTP request then it is redirect to the http listener at port 80.



The word "physical" makes me uncomfortable, because it sounds like there is a particular wire coming into a machine that is labelled 80, and which is used for HTTP. A port number really is little more than an identifier to indicate to the receiving machine who should handle this incoming request. The machine then sends the request to the process that has registered itself for port 80; in this case an HTTP server. For each port there can only be a single process listening for incoming connections.

I wouldn't talk of URLs in a discussion of ports, because ports predate URLs by a long time. It's also useful to remember that 80 is not the only port that can be used for HTTP - it's just the default port (Tomcat generally listens on port 8080.) Every protocol can run on every port; of course it reduces confusion (and the potential for for errors) if the default port is used. See this for a list of protocols and their default ports.
 
Hey, check out my mega multi devastator cannon. It's wicked. It makes this tiny ad look weak:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic